RoiManager function getSelectedIndex

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

RoiManager function getSelectedIndex

Nico Stuurman
Hi Wayne and others,

In an attempt to use the ROI Manager to direct analysis only to selected regions, I ran into the problem of finding out which ROIs are selected.  I use the function ROIManager.roiM.getSelectedRoisAsArray(), however, this function returns the same result when all ROIs are selected and no ROIs are selected (the latter behavior seems at odds with the name of the function).  To figure out which of these two situations is true, the documentation (http://rsbweb.nih.gov/ij/developer/api/ij/plugin/frame/RoiManager.html#getSelectedIndex%28%29) promises the function "int getSelectedIndex()", however, this does not appear to be present in the various copies of ImageJ hanging around on my computer.  There is also a function "int[] getSelectedIndexes()", however, this one is private so I can not use it.

Anyone any ideas how to proceed?

Thanks!


Nico
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: RoiManager function getSelectedIndex

Rasband, Wayne (NIH/NIMH) [E]
On Nov 14, 2012, at 6:26 PM, Nico Stuurman wrote:

> Hi Wayne and others,
>
> In an attempt to use the ROI Manager to direct analysis only to selected regions, I ran into the problem of finding out which ROIs are selected.  I use the function ROIManager.roiM.getSelectedRoisAsArray(), however, this function returns the same result when all ROIs are selected and no ROIs are selected (the latter behavior seems at odds with the name of the function).  To figure out which of these two situations is true, the documentation (http://rsbweb.nih.gov/ij/developer/api/ij/plugin/frame/RoiManager.html#getSelectedIndex%28%29) promises the function "int getSelectedIndex()", however, this does not appear to be present in the various copies of ImageJ hanging around on my computer.  There is also a function "int[] getSelectedIndexes()", however, this one is private so I can not use it.
>
> Anyone any ideas how to proceed?

The getSelectedIndex() method is available in ImageJ 1.47c and later. It returns -1 if no ROIs are selected.

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