Re: Possible bug - Creating PolygonROI modifies values in float array

Posted by Rasband, Wayne (NIH/NIMH) [E] on
URL: http://imagej.273.s1.nabble.com/Possible-bug-Creating-PolygonROI-modifies-values-in-float-array-tp5003454p5003485.html

On Jun 14, 2013, at 12:17 PM, C Heeney wrote:

> I'm using ImageJ 1.47t  (under Fiji)
>
> I create a PolygonROI in java using the following command
>
>    PolygonRoi pr = new PolygonRoi(xt, yt, 4, Roi.POLYGON);
>
> Where xt and yt are arrays of float values.
> I'm using float to support possible decimal values, although in testing I actually have integer values.
> The values contained in these arrays are based on calculation:
>
>    xt[0] = FirstArray[0] + SecondArray[0] + SomeIntegerValue;
>
>
> If I report the values in the arrays (xt and yt)  before I create the polygon, I can see the values that I expect.
>
> If I report the values in those arrays AFTER I create the polygon (using the line above), they appear to have been modified. The "new" values appear to be the relative distance to the (leftmost, topmost) corner of the bounding rectangle.
>
>
> If I rewrite the code so that everything is of type "int", then the values before and after creating the polygon are as expected.
>
> Is this intentional?

This is a bug that is fixed in the ImageJ 1.47u daily build.

-wayne

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