Login  Register

Re: RoiManager?

Posted by Kenneth Sloan-2 on Jul 29, 2020; 1:06am
URL: http://imagej.273.s1.nabble.com/RoiManager-tp5023762p5023778.html

Following advice here, I'm trying to associate a user-drawn Roi with a specific slice in a StackWindow.

I do (in a Java plugin):

        int slice = ip.getCurrentSlice();
        Roi roi = ip.getRoi();
        roi.setPosition(slice);
        ip.setRoi(roi);

But, the Roi is displayed on every slice.  If I edit (or re-draw) the Roi while positioned at a different slice - it changes (and is displayed) everywhere.

What am I doing wrong, please?

I suppose I can work around this by storing the Rois in my own stack, and using an ImageListener to notice when the slice changes (on a slice change - re-instate the correct Roi from my saved stack).

But, I was optimistic that this would not be necessary, and that ImageJ would handle this all for me.
Is there some method I'm missing in the documentation?  Should I be using the StackWindow instead of the ImagePlus used to create the StackWindow? (I don't see any relevant methods in the StackWindow api).


--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.

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