Login  Register

Re: Problem with ROI (bounding rectangle)

Posted by Michael Schmid on Jan 15, 2008; 9:52am
URL: http://imagej.273.s1.nabble.com/Problem-with-ROI-bounding-rectangle-tp3697595p3697596.html

Hi Jacub,

The ImageProcessor operations work on the rectangular area
enclosing the roi.

So you should set the roi to the ImageProcessor and call
ip.reset(ip.getMask()) after the operation.
The ImageProcessor must have a snapshot taken before the
operation: either call ip.snapshot() or in a PlugInFilter
specify the SNAPSHOT flag.

For (Extended)PlugInFilters that do not change the roi, the
PlugInFilterRunner of ImageJ takes care about snapshot and
reset if the SUPPORTS_MASKING flag is set.

Michael
________________________________________________________________

On 15 Jan 2008, at 10:17, JCS Trans Jakub Szafarek wrote:

> Hi,
>
> I am the new user of ImageJ library... So I have got one question.
> I want to make PolygonRoi, make it active and add to each pixel in  
> selected ROI some Value.
> I wrote code:
>
> roi=new Polygon(xpoints,ypoints, 4, imageplus, Roi.POLYGON);
> imageplus.setRoi(roi)
> imageprocesor.add(value)
>
>
> When I Start aplication, roi is made, is selected and "add"  
> operation is done well, but it makes "add" for the selected  
> polygonroi and the bounding rectangle of this roi,
>
> What is wrong? what must I change to work it correct?
>
>
> Thx a lot
>
> Jakub