Posted by
Krs5 on
Dec 28, 2014; 2:38pm
URL: http://imagej.273.s1.nabble.com/Batch-stack-to-images-with-renaming-tp5011012p5011055.html
OK I understand what you try to do. See if the code below does what you want.
macro split_color{
dir1 = getDirectory("Choose source directory");
list = getFileList(dir1);
dir2 = getDirectory("Choose destination directory");
setBatchMode(true);
for (i=0; i<list.length; i++) {
open(dir1+list[i]);
title1=File.nameWithoutExtension;
for (j=1; j<=3; j++){
run("Make Substack...", " slices="+j);
run("8-bit");
if (j==1) c = "blue";
else if(j==2) c = "purple";
else c = "green";
saveAs("tif", dir2+title1+"-"+c+".tif");
wait(100);
close();
}
close();
}
showMessage("Macro is finished");
}
Kees
________________________________________
From: ImageJ Interest Group [
[hidden email]] on behalf of cellcyclist [
[hidden email]]
Sent: 28 December 2014 04:50
To:
[hidden email]
Subject: Re: Batch stack to images, with renaming
The 34 files should give one file for each color per image, 102 files at the
end. The 34 files are the original files, I would like to be able to take
large numbers of files and separate out them into the separate colors.
sorry about the stack/channel mix up, I don't really know what I am doing :)
Thanks so much for your time I really appreciate it
--
View this message in context:
http://imagej.1557.x6.nabble.com/Batch-stack-to-images-with-renaming-tp5011012p5011053.htmlSent from the ImageJ mailing list archive at Nabble.com.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html