Login  Register

Roi Manager Problem

Posted by Peter Haub on May 04, 2011; 4:42am
URL: http://imagej.273.s1.nabble.com/Roi-Manager-Problem-tp3684713.html

Dear IJDevTeam,

there seems to be a problem with Roi Manager / Edit Mode when selecting
rois in an image stacks (seen in ImageJ 1.44d).

If the images in the stack contain a high density of rois, the selection
of a particular roi in an image will result in the selection of a
different roi in an image with a lower image number.

The reason for this behavior seems to be the comparison of only the x
and y mouse positions with the roi label but not the image number z.

My work around is a modification in
ImageCanvas.java
..
boolean roiManagerSelect(int x, int y) {
..
..
for (int i=0; i<n; i++) {
     if (labelRects[i]!=null&&   labelRects[i].contains(x,y)) {
       ..
       ..
       // Check slice number
       slice = getSliceNumber(list.getItem(i));
       if (slice != imp.getCurrentSlice()) continue;
       ..
       ..
      }
}

Maybe there is a better solution.

If somebody is interested I can provide some test data.
(Please let me know where to upload a small example stack and roi collection.)


ps: I could not understand why it is sometimes not possible to reproduce
this behavior directly after loading stack and rois, and why it will
appear after selecting a roi in image 1 first.


Peter