Login  Register

Re: merge channels within a macro

Posted by Nilwik Rachel (BW) on Sep 26, 2012; 4:40pm
URL: http://imagej.273.s1.nabble.com/merge-channels-within-a-macro-tp5000212p5000213.html

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