FYI: crop changes slicelabel on single slice ImagePlus

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

FYI: crop changes slicelabel on single slice ImagePlus

Fred Damen
Greetings,

For some reason Duplicator.run(ImagePlus) will use a separate method to
crop a single slice ImagePlus vs a multi-slice ImagePlus, even when the
"stack" option was passed.  The single slice method removes all the "\n"
in the sliceLabel on my datasets.  I suspect that it is due to the
following line:
if (label.length()>250 && label.indexOf('\n')>0 &&
label.contains("0002,")) ...
Although the ImagePlus is not a DICOM dataset, my sliceLabel(s) meet the
first two conditions, albeit, I can not see where it meets the last
condition.

Fred

PS: this work for a single slice ImagePlus

      ImageStack ris = smrimp.getStack();
      ImageProcessor rip = ris.getProcessor(1);
      rip.setRoi(w/2-h/2,0,h,h);
      rip = rip.crop();
      String rsl = ris.getSliceLabel(1);
      ris = new ImageStack(h,h);
      ris.addSlice(rsl,rip);
      smrimp.setStack(ris);

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