Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setBatchMode(true);
- dir=getDirectory("Choose an Input Directory");
- print(dir);
- list = getFileList(dir);
- saveloc = getDirectory("Choose Ouput Directory");
- for (i=0; i<list.length; i++) {
- if (endsWith(list[i], ".tif")){
- print(i + ": " + dir+list[i]);
- open(dir+list[i]);
- imgName=getTitle();
- run("Split Channels");
- selectWindow("C1-"+imgName);
- saveAs("Tiff", saveloc + "C1-"+imgName);
- close();
- selectWindow("C2-"+imgName);
- saveAs("Tiff", saveloc + "C2-"+imgName);
- close();
- selectWindow("C3-"+imgName);
- saveAs("Tiff", saveloc + "C3-"+imgName);
- close();
- run("Close All");
- } else {
- }
- }
- run("Image Sequence...", "open=[saveloc] file=C1 use");");
- saveAs("Tiff", saveloc+"FullStackC1.tif");
- run("Close All");
- run("Image Sequence...", "open=[saveloc] file=C2 use");");
- saveAs("Tiff", saveloc+"FullStackC2.tif");
- run("Close All");
- run("Image Sequence...", "open=[saveloc] file=C3 use");");
- saveAs("Tiff", saveloc+"FullStackC3.tif");
- run("Close All");
- list = getFileList(dir);
- for (i=0; i<list.length; i++) {
- if (startsWith(list[i], "C"))
- File.delete(dir+list[i]);
- }
- Dialog.create("Progress");
- Dialog.addMessage("Complete!");
- Dialog.show;
- setBatchMode(false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement