Login  Register

Re: problem with Merge Channels and renaming

Posted by Wayne Rasband-2 on Jun 07, 2017; 7:24pm
URL: http://imagej.273.s1.nabble.com/problem-with-Merge-Channels-and-renaming-tp5018849p5018861.html

> On Jun 6, 2017, at 9:18 PM, Cammer, Michael <[hidden email]> wrote:
>
> I'm having a problem with renaming an image after using run("Merge Channels..." with ImageJ 1.51o (which according to the update command in the help menu is the daily build) and both Java 1.6 and 1.8.
>
> In the macro below, at the end an image that is not the result of the Merge Channels gets renamed.  If the only other wndow open is the original, then the original is renamed.


This bug is fixed in the latest ImageJ daily build (1.51o35). Or work around it by using batch mode, by adding selectImage("RGB”) before the last line in the macro, or by not using "Merge Channels", as in the the following example.

-wayne

  run("Leaf (36K)");
  run("RGB Stack");
  for (i=1; i<=3; i++) {
     setSlice(i);
     run("Enhance Contrast...", "saturated=0 equalize");
  }  run("RGB Color");
  rename("EQ_" + getTitle);


> /==================================
> macro "Proper Eq of RGB per channel" {
>  //original = getImageID;
>  title = getTitle;
>  run("Duplicate...", "title=temp");
>  run("Split Channels");
>  selectWindow("temp (blue)");
>  run("Enhance Contrast...", "saturated=0 equalize");
>  selectWindow("temp (green)");
>  run("Enhance Contrast...", "saturated=0 equalize");
>  selectWindow("temp (red)");
>  run("Enhance Contrast...", "saturated=0 equalize");
>  run("Merge Channels...", "c1=[temp (red)] c2=[temp (green)] c3=[temp (blue)]");
>  rename("EQ_" + title);
> }

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