Login  Register

problem with conversion to RGB - IJ 1.51k18 java 1.6.0_20

Posted by Cammer, Michael on Feb 24, 2017; 9:26pm
URL: http://imagej.273.s1.nabble.com/problem-with-conversion-to-RGB-IJ-1-51k18-java-1-6-0-20-tp5018189.html

We are having a problem converting hyperstacks to RGB in a macro.  Approximately one out of five times we run the macro, it does not work.  We tried adding a wait(200) step, but don't know if this really helps or not.

The error is that ImageJ cannot find image with id2.

[cid:image001.png@01D28EBA.CC7A15E0]

Any help appreciated.  The problem is with the second macro.  Included the first macro to show what types of files we are using (2 or 3 channel Z series confocal).

macro "Set up images [q]" {
  //run("Channels Tool...");
  Stack.setDisplayMode("composite");
  //run("Brightness/Contrast...");
  Stack.getDimensions(width, height, channels, slices, frames) ;
  for (n=1; n<=channels; n++) {
    Stack.setChannel(n);
    setMinAndMax(0, 65535);
  }
  Stack.setSlice(floor(slices / 3)) ;
}

/*  Draw a box around an area to be 3D projected.
     Run this macro.
*/
macro "Do 3D projections [F2]" {
   run("Duplicate...", "duplicate");
   id1 = getImageID();
   // change to get scale for each sample if Z different than 0.3 um
   run("3D Project...", "projection=[Brightest Point] axis=X-Axis slice=0.30 initial=0 total=360 rotation=10 lower=1 upper=255 opacity=0 surface=50 interior=25 interpolate");
   //run("RGB Color", "frames");  // buggy
   wait(200);   // appears the projection command needs this to hand off the image properly
   id2 = getImageID();
   run("RGB Color", "frames keep");
   selectImage(id1); close(); selectImage(id2); close();
}








=*===========================================================*=
Michael Cammer, DART Microscopy Laboratory, NYU Langone Medical Center
    Cell:  914-309-3270     Office: Skirball 2nd Floor main office, back right
      http://ocs.med.nyu.edu/microscopy & http://microscopynotes.com/


------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================

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

image001.png (8K) Download Attachment