Batch processing of 4 color Z stack images

Posted by cas229 on
URL: http://imagej.273.s1.nabble.com/Batch-processing-of-4-color-Z-stack-images-tp5022004.html

Hello- I'm looking for help on macro coding. I have done the macro recorder
and this works as needed but I would like to figure out a way to do batch
processing of multiple images. I only want to analyze 2 of the color
channels in the z stack. Could someone help guide me on the correct coding
terms to get multiple images processed without having to retype the file
names each time? I've read the batch processing guidelines on imageJ but am
still confused. I'm getting stuck on how to handle different window names
and different files (example: "SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif
copy - Series009 - C=1" is one channel and
"SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy - Series009 - C=0" is the
other of interest, but those names would be different for each file and each
z stack image: Each series is a z stack-
SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif- Series009 ... then there is
Series010, Series011 and so on...)

Any help making this macro more streamlined and less complication is VERY
much appreciated.

Thank you!

Colleen



open("/Users/colleensilky/Desktop/PhD Files/TBI-organoid IHC
repeat/SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy");
close();
selectWindow("SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy - Series009 -
C=1");
close();
selectWindow("SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy - Series009 -
C=0");
run("Z Project...", "projection=[Max Intensity]");
run("Median...", "radius=1");
run("Subtract Background...", "rolling=10");
run("Duplicate...", "title=[MAX_SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif
copy - Series009 - Mask]");
setAutoThreshold("Otsu dark");
//run("Threshold...");
//setThreshold(68, 255);
setOption("BlackBackground", true);
run("Convert to Mask");
run("Create Selection");
run("Create Mask");
saveAs("ZIP", "/Users/colleensilky/Desktop/Fiji Results/Results1/Mask
control 01 ROI.zip");
selectWindow("MAX_SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy -
Series009 - Mask");
roiManager("Add");
selectWindow("MAX_SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy -
Series009 - C=0");
setAutoThreshold("Otsu dark");
//run("Threshold...");
run("From ROI Manager");
run("Analyze Particles...", "pixel show=Overlay exclude clear add");
roiManager("Measure");
saveAs("Results", "/Users/colleensilky/Desktop/Fiji Results/Results1/Results
control 1 Homer.csv");
saveAs("Tiff", "/Users/colleensilky/Desktop/Fiji
Results/Results1/MAX_SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy -
Series009 - C=0.tif");
selectWindow("MAX_SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy -
Series009 - Mask");
selectWindow("SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy - Series009 -
C=0");
selectWindow("SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy - Series009 -
C=2");
run("Z Project...", "projection=[Max Intensity]");
run("Median...", "radius=1");
run("Subtract Background...", "rolling=10");
run("Duplicate...", "title=[MAX_SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif
copy - Series009 - C=2-mask]");
setAutoThreshold("Otsu dark");
//run("Threshold...");
//setThreshold(46, 255);
run("Convert to Mask");
run("Create Selection");
run("Create Mask");
saveAs("ZIP", "/Users/colleensilky/Desktop/Fiji Results/Results1/Mask
control 02 ROI.zip");
selectWindow("MAX_SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy -
Series009 - C=2-mask");
roiManager("Add");
selectWindow("MAX_SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy -
Series009 - C=2");
setAutoThreshold("Otsu dark");
//run("Threshold...");
run("From ROI Manager");
run("Analyze Particles...", "pixel show=Overlay exclude clear add");
roiManager("Measure");
saveAs("Results", "/Users/colleensilky/Desktop/Fiji Results/Results1/Results
control 1 SYT1.csv");
saveAs("Tiff", "/Users/colleensilky/Desktop/Fiji
Results/Results1/MAX_SYT-Hom-MAP2-150DIV-Org8-1-Ctrl-170918.lif copy -
Series009 - C=2.tif");
run("Close All");



--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html