Posted by
Olivier Burri on
URL: http://imagej.273.s1.nabble.com/Batch-Processing-channel-split-window-name-tp5016467p5016471.html
Hi,
How do you batch process your file? Are you sure that there are only images with 3 channels exactly in the folder where you are running the batch?
I have tested this with a few images in a folder and this works.
What is the error exactly? It can't find the C1 or the C2 or the C3?
I'd suggest adding a run("Close All"); at the end of your macro code, to make sure that there's no lingering images from a previous file.
Other than that, maybe using selectImage rather than selectWindow?
-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of MickMunson
Sent: jeudi, 19 mai 2016 14:06
To:
[hidden email]
Subject: Batch Processing, channel split window name.
Hi,
I am very new to macro creating so apologies if it is something simple I am missing.
I have created a macro to first of all split a three colour image and then to process these channels relative to each other. This macro seems to work perfectly fine if I manually open a single image then run the macro, however I am having trouble when I use this to batch process a series of images from a folder. Normally if I open then split the channels it creates three windows, C1-/C2-/C3- file name. When batch processing it hits an error saying file by this name doesn't exist. I'm not sure if there is an easy way to troubleshoot this? Also is there any easy way to store the data from each file processed that can be included in the macro?
Macro:
T = getTitle();
selectWindow(T);
run("Split Channels");
selectWindow("C1-"+T);
Blue = getTitle();
selectWindow("C2-"+T);
Green = getTitle();
selectWindow("C3-"+T);
Red = getTitle();
selectWindow(Red);
setAutoThreshold("Default dark");
run("Threshold...");
setThreshold(20, 255);
setOption("BlackBackground", false);
run("Convert to Mask");
selectWindow(Green);
setAutoThreshold("Default dark");
run("Threshold...");
setThreshold(20, 255);
setOption("BlackBackground", false);
run("Convert to Mask");
run("Create Selection");
selectWindow(Red);
run("Restore Selection");
run("Enlarge...", "enlarge=2 pixel");
run("Clear", "slice");
run("Invert");
run("Select None");
run("Analyze Particles...", "size=0.10-Infinity pixel show=Outlines display exclude include summarize");
Many thanks for your time and help.
--
View this message in context:
http://imagej.1557.x6.nabble.com/Batch-Processing-channel-split-window-name-tp5016467.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