Splitting IFA channels and saving (macro)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Splitting IFA channels and saving (macro)

epitman-2
Hi,

I am trying to make a macro where I split the images in a stack and then
save and close them for batch processing. I use the batch processing part of
ImageJ and run a macro. So far I have the code below but the best I have
managed is to just get 2 of the 4 channels to save (BF, Gr, Rd, Bl).

run("Stack to Images");

{a = getTitle();
selectWindow(a);
saveAs("Tiff", a);
close();}

{b = getTitle();
selectWindow(b);
saveAs("Tiff", b);
close();}

{c = getTitle();
selectWindow(c);
saveAs("Tiff", c);
close();}

{d = getTitle();
selectWindow(d);
saveAs("Tiff", d);
close();}



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

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Splitting IFA channels and saving (macro)

Cammer, Michael-2
You may want to look at
http://microscopynotes.com/imagej/macros/composite-colors/user-selected-contrast-colors-names-save8bit.html
and macro "Simple montage figure" in http://microscopynotes.com/imagej/macros/useful_collection_v100.txt 

There may be better ways to address this, but this is how we did it.

Cheers-
Michael Cammer



-----Original Message-----
From: epitman <[hidden email]>
Sent: Wednesday, June 5, 2019 11:23 PM
To: [hidden email]
Subject: Splitting IFA channels and saving (macro)

Hi,

I am trying to make a macro where I split the images in a stack and then save and close them for batch processing. I use the batch processing part of ImageJ and run a macro. So far I have the code below but the best I have managed is to just get 2 of the 4 channels to save (BF, Gr, Rd, Bl).

run("Stack to Images");

{a = getTitle();
selectWindow(a);
saveAs("Tiff", a);
close();}

{b = getTitle();
selectWindow(b);
saveAs("Tiff", b);
close();}

{c = getTitle();
selectWindow(c);
saveAs("Tiff", c);
close();}

{d = getTitle();
selectWindow(d);
saveAs("Tiff", d);
close();}



--
Sent from: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.1557.x6.nabble.com_&d=DwICAg&c=j5oPpO0eBH1iio48DtsedeElZfc04rx3ExJHeIIZuCs&r=E0xNnPAQpUbDiPlC50tp7rW2nBkvV7fujQf0RknE5bU&m=dQmUXUwjIMpoEamYtMUxEE5wMOxPoY7kzHbPvEVwI9U&s=TkMQvO5WYyXt3oa1A0hOi9FDntagvFYyIUk8VWHC7iM&e=

--
ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwICAg&c=j5oPpO0eBH1iio48DtsedeElZfc04rx3ExJHeIIZuCs&r=E0xNnPAQpUbDiPlC50tp7rW2nBkvV7fujQf0RknE5bU&m=dQmUXUwjIMpoEamYtMUxEE5wMOxPoY7kzHbPvEVwI9U&s=weOLhUj8jGi1QXNwOF7YVc2jx5EJhHR1tfTKlGL3SIM&e=

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