Login  Register

Re: Making new arbitrarily-shaped ROI's in plugin

Posted by dscho on May 05, 2011; 5:02pm
URL: http://imagej.273.s1.nabble.com/Making-new-arbitrarily-shaped-ROI-s-in-plugin-tp3684667p3684669.html

Hi,

On Thu, 5 May 2011, gibberfish wrote:

> I'm writing an ImageJ plugin where at a certain point I have to split a
> ROI into two separate ROI's. This should be done along a certain
> splitting path.

The easiest way is to work with ShapeROIs:
http://imagej.nih.gov/ij/developer/api/ij/gui/ShapeRoi.html

You basically can use the getShape() method to turn the ROI into an AWT
Shape and work with those. If you have a non-ShapeRoi, you can turn it
into a ShapeRoi with the ShapeRoi(Roi) constructor.

Ciao,
Johannes