Getting the indices of multiple selected ROIs in a macro

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

Getting the indices of multiple selected ROIs in a macro

Trevor Joyce
Hi,

I’m relatively new to ImageJ programming and I’m stumbling over a seemingly simple problem. I’ve defined multiple ROIs in an image and within a macro I’m trying to extract the indices of a subset (i.e. more than one) that have been selected in the ROI Manager.  I’d like to save these indices as an array to use later in the macro. The roiManager("index”) function only “returns the index of the first selected ROI if more than one is selected”.

I’ve come across online documentation for “ij.plugin.frame.RoiManager.getSelectedIndexes”, “ij.plugin.frame.RoiManager.getIndexes”, “ij.plugin.frame.RoiManager.getSelectedRoisAsArray” which all seem like they would accomplish this task, but I haven’t had any success getting functions these functions to work in a macro. Any suggestions for a work around or a way to use these functions in a macro?

The instructions for compiling and running ij/plugin/frame/RoiManager.java from source code seem throw up several errors and warnings in my editor window (ImageJ 1.50i).

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