Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. setBatchMode(true);
  2. dir=getDirectory("Choose an Input Directory");
  3. print(dir);
  4. list = getFileList(dir);
  5. saveloc = getDirectory("Choose Ouput Directory");
  6.  
  7. for (i=0; i<list.length; i++) {
  8. if (endsWith(list[i], ".tif")){
  9. print(i + ": " + dir+list[i]);
  10. open(dir+list[i]);
  11. imgName=getTitle();
  12. run("Split Channels");
  13. selectWindow("C1-"+imgName);
  14. saveAs("Tiff", saveloc + "C1-"+imgName);
  15. close();
  16. selectWindow("C2-"+imgName);
  17. saveAs("Tiff", saveloc + "C2-"+imgName);
  18. close();
  19. selectWindow("C3-"+imgName);
  20. saveAs("Tiff", saveloc + "C3-"+imgName);
  21. close();
  22. run("Close All");
  23. } else {
  24. }
  25. }
  26.  
  27. run("Image Sequence...", "open=[saveloc] file=C1 use");");
  28. saveAs("Tiff", saveloc+"FullStackC1.tif");
  29. run("Close All");
  30.  
  31. run("Image Sequence...", "open=[saveloc] file=C2 use");");
  32. saveAs("Tiff", saveloc+"FullStackC2.tif");
  33. run("Close All");
  34.  
  35. run("Image Sequence...", "open=[saveloc] file=C3 use");");
  36. saveAs("Tiff", saveloc+"FullStackC3.tif");
  37. run("Close All");
  38.  
  39. list = getFileList(dir);
  40. for (i=0; i<list.length; i++) {
  41. if (startsWith(list[i], "C"))
  42. File.delete(dir+list[i]);
  43. }
  44.  
  45. Dialog.create("Progress");
  46. Dialog.addMessage("Complete!");
  47. Dialog.show;
  48.  
  49. setBatchMode(false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement