Re: irregular ROIs

Posted by dscho on
URL: http://imagej.273.s1.nabble.com/irregular-ROIs-tp3701774p3701776.html

Hi,

On Wed, 23 Aug 2006, Tony Shepherd wrote:

> can anyone tell me how to loop over an irregular (polygonal) ROI ?
>
> I tried taking a control loop from the tutorial called Inverter_ (pasted
> below)
>
> At the moment it only seems to loop over the bounding rectangle.
>
> Thanks,
>
> Tony.
> ..............................................
>
> public void run(ImageProcessor ip) {

You need to store a reference to the image, not the image processor. The
standard method is to add an ImagePlus member "image" and set that from
the setup() method.

Then, you can just do

        PolygonRoi roi = (PolygonRoi)image.getRoi();

Hth,
Dscho