Posted by
daschneider9 on
Oct 30, 2013; 4:44pm
URL: http://imagej.273.s1.nabble.com/Macros-for-Colour-Deconvolution-plugin-saving-multiple-files-tp5005383p5005386.html
Andrew,
I'm working on similar analysis work flow and so will be interested to see responses to your post. However, regarding your last question, check to see if the window title in fact includes the file extension. If so, the selectWindow needs the full file name. So maybe your example needs to be more like this:
selectWindow(imgName + " (Colour[3]).tif");
Hope that helps,
Dave
-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of drew_c
Sent: Wednesday, October 30, 2013 9:17 AM
To:
[hidden email]
Subject: Macros for Colour Deconvolution plugin - saving multiple files
Hi All,
I'm new to writing macros for image j so please bare with me. I'm trying to process a batch of images with multiple savepoints and with the colour deconvolution plugin. Any help with this is greatly appreciated.
The workflow that I would like to do is as follows:
1. select the input directory
2. select the output directory
3. run("Subtract Background...", "rolling=50 light"); 4. run("Colour Deconvolution", "vectors=[H DAB]");
At this point I would like to save colour1 as ''original image name_colour1'', and colour2 as ''original image name_colour2''. I do not need colour3.
Now don't mind ending the macro here and starting up a new macro becuase as
colour1 and colour2 images need to be treated differently in terms of thresholding and particle analysis so it might get complicated within the same macro. What I do need to next do is:
(5. select the input directory)
(6. select the output directory)
7. setAutoThreshold("Default");
8. //run("Threshold...");
9. setThreshold(0, 146);
10. run("Convert to Mask");
11. run("Fill Holes");
12. run("Convert to Mask");
13. run("Watershed");
14. run("Set Scale...", "distance=63 known=10 pixel=1 unit=um"); 15. run("Analyze Particles...", "size=30.00-300.00 circularity=0.00-1.00 show=Outlines display exclude summarize");
Here again I would like to save 2 images: The modified (thresholded, holed, masked, and watershedded) image as ''original image name_colour1_modified''
and the new outline image as ''original image name_outline''
I would really appreciate any help I can get - I've tried all sorts of things such as:
selectWindow(imgName + " (Colour[3])"); close();
But I get errors saying that there is no such window, and the closest that I'm getting to is being able to save 1 random window only.
Hope there is someone there who can spare some time!
BW
Andrew
--
View this message in context:
http://imagej.1557.x6.nabble.com/Macros-for-Colour-Deconvolution-plugin-saving-multiple-files-tp5005383.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