Login  Register

merge channels within a macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

merge channels within a macro

Nilwik Rachel (BW)
Hi all,

I am analysing 4-channel microscopic recordings, in which every channel is saved as a separate image.
I would like to incorporate the Merge Channels function into the macro, and I have tried doing this by macro recording. What I get is this:

run("Merge Channels...", "c1=recording1-0003 c2=recording1-0002 c3=recording1-0001 c4=recording1-0004 create keep")

The 'recording1' part in this rule represent the current image name, the numbers represent the channels.
Of course, when running a macro, I would like it to be applicable to any file, not only the one I was using now... but I do want it to keep using the '-0001' etc extensions for directing every channel to the correct colour in the merged image.

Does anyone know how to achieve this?

Thank you very much in advance,
Rachel Nilwik



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

Re: merge channels within a macro

Nilwik Rachel (BW)
Thanks!! :)

-----Original Message-----
From: Ding, Lai [mailto:[hidden email]]
Sent: Wednesday, September 26, 2012 6:39 PM
To: Nilwik Rachel (BW)
Subject: RE: merge channels within a macro

Hello Rachel,

  You can use getInfo function to get the name of active image, like below


  name=getInfo("image.filename");

  run("Merge Channels...", "c1="+name+"-0003 c2="+name+"-0002 c3="+name+"-0001 c4="+name+"-0004 create keep")

Bets
Lai

Lai Ding, PhD | Optical Imaging Manager
Harvard NeuroDiscovery Center
Harvard Medical School
(617) 432-2799
http://www.neurodiscovery.harvard.edu/ 


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Nilwik Rachel (BW)
Sent: Wednesday, September 26, 2012 12:31 PM
To: [hidden email]
Subject: merge channels within a macro

Hi all,

I am analysing 4-channel microscopic recordings, in which every channel is saved as a separate image.
I would like to incorporate the Merge Channels function into the macro, and I have tried doing this by macro recording. What I get is this:

run("Merge Channels...", "c1=recording1-0003 c2=recording1-0002 c3=recording1-0001 c4=recording1-0004 create keep")

The 'recording1' part in this rule represent the current image name, the numbers represent the channels.
Of course, when running a macro, I would like it to be applicable to any file, not only the one I was using now... but I do want it to keep using the '-0001' etc extensions for directing every channel to the correct colour in the merged image.

Does anyone know how to achieve this?

Thank you very much in advance,
Rachel Nilwik



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

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