input = getDirectory("Choose the directory where the TIFF files are"); psf = File.openDialog("Select where the PSF file is stored"); output = input + "deconvolved_25it/"; File.makeDirectory(output) setBatchMode(true); list = getFileList(input); for (i = 0; i < list.length; i++) if (endsWith(list[i],'.tif')) decon(input, output, list[i], psf); setBatchMode(false); function decon(input,output,filename,pathToPsf) { //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // WPL //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pathToBlurredImage = input + filename; pathToDeblurredImage = output + filename; boundary = "REFLEXIVE"; //available options: REFLEXIVE, PERIODIC, ZERO resizing = "AUTO"; // available options: AUTO, MINIMAL, NEXT_POWER_OF_TWO output = "SAME_AS_SOURCE"; // available options: SAME_AS_SOURCE, BYTE, SHORT, FLOAT precision = "SINGLE"; //available options: SINGLE, DOUBLE threshold = "-1"; //if -1, then disabled maxIters = "25"; nOfThreads = "8"; showIter = "true"; gamma = "0"; filterXY = "1.0"; filterZ = "1.0"; normalize = "false"; logMean = "false"; antiRing = "true"; changeThreshPercent = "0.01"; db = "false"; detectDivergence = "true"; call("edu.emory.mathcs.restoretools.iterative.ParallelIterativeDeconvolution3D.deconvolveWPL", pathToBlurredImage, pathToPsf, pathToDeblurredImage, boundary, resizing, output, precision, threshold, maxIters, nOfThreads, showIter, gamma, filterXY, filterZ, normalize, logMean, antiRing, changeThreshPercent, db, detectDivergence); }