Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // @float sigma
- // @File(label="Select the input folder", style="directory") inputFolder
- // @File(label="Select the output folder", style="directory") outputFolder
- setBatchMode(true);
- processFolder(inputFolder);
- setBatchMode("exit and display");
- function processFolder(input) {
- list = getFileList(input);
- for (i = 0; i < list.length; i++) {
- if(!File.isDirectory(input + list[i]))
- processFile(input, outputFolder, list[i]);
- }
- }
- function processFile(input, output, file) {
- // do the processing here by replacing
- // the following two lines by your own code
- print("\\Update0:Processing: " + input +"/"+ file);
- open(input+"/"+file);
- run("Gaussian Blur...", "sigma=1.60");
- saveAs(output+"/"+file);
- close();
- }
- // Can be called from the command line using (change the folder locations):
- // ./ImageJ-linux64 --ij2 --headless --run ../../workflows/gaussian_blur.ijm "sigma='1.6', inputFolder='../../datasets/imagej-sample-images/noisy/', outputFolder='../../out/gb'"
- // or without the names of the input parameters:
- // ./ImageJ-linux64 --ij2 --headless --run ../../workflows/gaussian_blur.ijm "'1.6', '../../datasets/imagej-sample-images/noisy/', '../../out/gb'"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement