a macro to automatically set up merge channels

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

a macro to automatically set up merge channels

Hao Wu
Hello, everyone!

I am trying to have a macro to set up merge channels automatically. The
following one is what I have now. Somehow, image J always let the red
channel out although if I print titlered, it shows the correct selection.
Any help would be really appreciated. Thanks a lot!

Best,
Hao

FileTitle=getInfo("image.filename");
selectWindow(FileTitle+" - C=2");
titleRed = getTitle;
selectWindow(FileTitle+" - C=1");
titleGreen = getTitle;
selectWindow(FileTitle+" - C=0");
titleBlue = getTitle;
//print(titleRed);
//print(titleGreen);
//print(titleBlue);
run("Merge Channels...", "red=titleRed green=titleGreen blue=titleBlue
gray=*None*");

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

Re: a macro to automatically set up merge channels

rayh
I think you have to insert your variables with quotation marks. Try this:

run("Merge Channels...", "red=[" + titleRed + "] green=[" + titleGreen + "] blue=[" + titleBlue + "] gray=*None*");


-Ray
Reply | Threaded
Open this post in threaded view
|

Re: a macro to automatically set up merge channels

Hao Wu
Hi, Ray!

That works! Thank you so much!!!!!!!!!!!

Best,
Hao




On Wed, Jul 30, 2014 at 9:35 AM, rayh <[hidden email]> wrote:

> I think you have to insert your variables with quotation marks. Try this:
>
> run("Merge Channels...", "red=[" + titleRed + "] green=[" + titleGreen + "]
> blue=[" + titleBlue + "] gray=*None*");
>
>
> -Ray
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/a-macro-to-automatically-set-up-merge-channels-tp5008941p5008968.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