Decomposing a composite ROI (in javascript)

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

Decomposing a composite ROI (in javascript)

Adrian Custer
Hey all,

thanks for ImageJ.

With an image open, we can draw a polygon 'selection' over the image,
then, with the 'shift' key pressed, add another piece to the selection.
Once we do Ctrl-b, the whole selection added to the Overlay.

When recuperating that RoI from the Overlay (in javascript):

var imp = IJ.getImage();
var ol  = imp.getOverlay();
var rois = ol.toArray();
var roi = rois[0];

the type of the Region of Interest is "COMPOSITE". When trying to get
the FloatPolygon directly from the RoI, imagej only gives the
coordinates of the bounding box of the various polygons.

Is it possible to decompose the COMPOSITE roi into the separate polygons
of which it is composed to get at their coordinates? From the API docs,
there does not seem to be a direct way from the composite ROI itself.

Thanks for any help,
   ~adrian custer

ImageJ mailing list: