Login  Register

Re: Macro for splitting channels - troubleshooting.

Posted by Herbie on Sep 18, 2016; 11:32am
URL: http://imagej.273.s1.nabble.com/Macro-for-splitting-channels-troubleshooting-tp5017203p5017204.html

Good day Oliver,

did you have a look at the many example macros that come with ImageJ or
that are available from
<https://imagej.nih.gov/ij/macros/>?

"BatchProcessFolders"
could be of interest for looping through files in a folder...

HTH

Herbie

::::::::::::::::::::::::::::::::::::::::
Am 18.09.16 um 12:45 schrieb Harschnitz:

> 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!
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Macro-for-splitting-channels-troubleshooting-tp5017203.html
> Sent 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