Login  Register

Re: bug in "Merge Channels" with batch mode ?

Posted by Wayne Rasband on Mar 19, 2009; 2:20pm
URL: http://imagej.273.s1.nabble.com/bug-in-Merge-Channels-with-batch-mode-tp3693257p3693258.html

On Mar 19, 2009, at 7:41 AM, Christophe Leterrier wrote:

> I don't understand why the following macro closes the source image and
> just
> displays the "RGB" merged image (use any RGB image as the source) :
>
> macro "test" {
> setBatchMode(true);
> run("Duplicate...", "title=temp");
> run("Split Channels");
> run("Merge Channels...", "red=[temp (red)] green=[temp (green)]
> blue=[temp
> (blue)]");
> setBatchMode("exit and display");
> }
>
> tested with IJ 1.42k and the latest daily build.
> Is it a bug or is there something I don"t get in the way the batch mode
> works ?

This macro works as expected in batch mode if it is modified to use the
command recorder generated run("Merge Channels...", "...") call that
includes "gray=*None*" in the options string.

   setBatchMode(true);
   run("Duplicate...", "title=temp");
   run("Split Channels");
   run("Merge Channels...",
     "red=[temp (red)] green=[temp (green)] blue=[temp (blue)]
gray=*None*");
   setBatchMode("exit and display");

-wayne