Macro for splitting channels - troubleshooting.
Posted by Harschnitz on Sep 18, 2016; 10:45am
URL: http://imagej.273.s1.nabble.com/Macro-for-splitting-channels-troubleshooting-tp5017203.html
Hi there,
I'm a bit of a newbie in trying to write macro's for ImageJ, and have run into some trouble with what should be a relatively straightforward task. I would very much appreciate some feedback on writing a macro that splits channels in a 3-channel TIF and saves the 3 new TIFs, and does that with all the images in the same folder. So something like:
1. Open the ().czi image from a folder
2. Split channels
3. Save each of the 3 new files as a TIF
4. Open next file from the same folder and then 2-4 until all files from this folder are opened, converted and saved
5. Close all the windows
I tried to record such macro... but did not go very far. The macro I came up with looks something like:
T = getTitle();
selectWindow(T);
run("Split Channels");
selectWindow("C1-"+T);
Blue = getTitle();
selectWindow("C2-"+T);
Green = getTitle();
selectWindow("C3-"+T);
Red = getTitle();
run("Close All")
While this does run, it only converts the stack to a .tiff file. As I said, I'm quite new to this so am not quite sure what I'm getting wrong.
I would be really grateful to someone who could help me with this macro. Thanks for your time!
Best, Oliver
p.s. If I could incorporate a function to make a maximum intensity projection of each channel that would be awesome, as this will be my next challenge!