Another potential bug within the Roi class - Sorry about that!!!

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Another potential bug within the Roi class - Sorry about that!!!

CARL Philippe (LBP)
Dear all (probably Wayne),
I found another issue within the Roi class for which I'm almost sure it is a bug.
So I'm using the getContainedPoints() method on Rois of different types and the method is very nicely working for rectangular, polygon, freehand,... selections.
Nevertheless, with an oval selection the size of the array returned by the getContainedPoints() method is equal to zero when the oval selection is created and/or translated.
The size of the returned array becomes different from zero only once the size of the oval selection is modified (i.e. increased or decreased).
I thank you very much in advance for your help on this.
My best regards,
Philippe


Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Another potential bug within the Roi class - Sorry about that!!!

Michael Schmid-3
Hi Philippe,

sorry, I can't reproduce the problem.

I tried the following in JavaScript interactive mode:
(the indented lines are the output)

r=new OvalRoi(1,2,3,4);
   Roi[Oval, x=1, y=2, width=3, height=4]
p=r.getContainedPoints();
   [Ljava.awt.Point;@3153ceb9
p.length
   8

It also works with an oval roi created by hand on the 'blobs' sample,
and starting with

r=IJ.getImage().getRoi();

I also don't see anything suspicious in the getContainedPoints() code.


Michael
________________________________________________________________
On 21.10.19 21:24, CARL Philippe (LBP) wrote:

> Dear all (probably Wayne),
> I found another issue within the Roi class for which I'm almost sure it is a bug.
> So I'm using the getContainedPoints() method on Rois of different types and the method is very nicely working for rectangular, polygon, freehand,... selections.
> Nevertheless, with an oval selection the size of the array returned by the getContainedPoints() method is equal to zero when the oval selection is created and/or translated.
> The size of the returned array becomes different from zero only once the size of the oval selection is modified (i.e. increased or decreased).
> I thank you very much in advance for your help on this.
> My best regards,
> Philippe
>
>
> Philippe CARL
> Laboratoire de Bioimagerie et Pathologies
> UMR 7021 CNRS - Université de Strasbourg
> Faculté de Pharmacie
> 74 route du Rhin
> 67401 ILLKIRCH
> Tel : +33(0)3 68 85 41 84
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Another potential bug within the Roi class - Sorry about that!!!

Michael Schmid-3
Hi everyone,

just for the record, there was a bug in OvalRoi.getMask (which gets
called by getContainedPoints), causing the getContainedPoints to
sometimes incorrectly return 0 points inside an oval ROI. The reason was
that the cached Mask was not updated while drawing the oval with the mouse.

It is fixed in ImageJ daily build (1.52r52).

Michael
________________________________________________________________

On 22.10.19 12:54, Michael Schmid wrote:

> Hi Philippe,
>
> sorry, I can't reproduce the problem.
>
> I tried the following in JavaScript interactive mode:
> (the indented lines are the output)
>
> r=new OvalRoi(1,2,3,4);
>    Roi[Oval, x=1, y=2, width=3, height=4]
> p=r.getContainedPoints();
>    [Ljava.awt.Point;@3153ceb9
> p.length
>    8
>
> It also works with an oval roi created by hand on the 'blobs' sample,
> and starting with
>
> r=IJ.getImage().getRoi();
>
> I also don't see anything suspicious in the getContainedPoints() code.
>
>
> Michael
> ________________________________________________________________
> On 21.10.19 21:24, CARL Philippe (LBP) wrote:
>> Dear all (probably Wayne),
>> I found another issue within the Roi class for which I'm almost sure
>> it is a bug.
>> So I'm using the getContainedPoints() method on Rois of different
>> types and the method is very nicely working for rectangular, polygon,
>> freehand,... selections.
>> Nevertheless, with an oval selection the size of the array returned by
>> the getContainedPoints() method is equal to zero when the oval
>> selection is created and/or translated.
>> The size of the returned array becomes different from zero only once
>> the size of the oval selection is modified (i.e. increased or decreased).
>> I thank you very much in advance for your help on this.
>> My best regards,
>> Philippe
>>
>>
>> Philippe CARL
>> Laboratoire de Bioimagerie et Pathologies
>> UMR 7021 CNRS - Université de Strasbourg
>> Faculté de Pharmacie
>> 74 route du Rhin
>> 67401 ILLKIRCH
>> Tel : +33(0)3 68 85 41 84
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>

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