Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. // @float sigma
  2. // @File(label="Select the input folder", style="directory") inputFolder
  3. // @File(label="Select the output folder", style="directory") outputFolder
  4.  
  5. setBatchMode(true);
  6. processFolder(inputFolder);
  7. setBatchMode("exit and display");
  8.  
  9. function processFolder(input) {
  10. list = getFileList(input);
  11. for (i = 0; i < list.length; i++) {
  12. if(!File.isDirectory(input + list[i]))
  13. processFile(input, outputFolder, list[i]);
  14. }
  15. }
  16.  
  17. function processFile(input, output, file) {
  18. // do the processing here by replacing
  19. // the following two lines by your own code
  20. print("\\Update0:Processing: " + input +"/"+ file);
  21. open(input+"/"+file);
  22. run("Gaussian Blur...", "sigma=1.60");
  23. saveAs(output+"/"+file);
  24. close();
  25. }
  26.  
  27. // Can be called from the command line using (change the folder locations):
  28. // ./ImageJ-linux64 --ij2 --headless --run ../../workflows/gaussian_blur.ijm "sigma='1.6', inputFolder='../../datasets/imagej-sample-images/noisy/', outputFolder='../../out/gb'"
  29. // or without the names of the input parameters:
  30. // ./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