Posted by
Michael Schmid on
Jan 23, 2009; 1:51pm
URL: http://imagej.273.s1.nabble.com/Possible-bug-with-perimeter-calculation-on-composite-selections-tp3693924p3693932.html
Hi Chris,
partly this has been discussed a while ago in the mailing list, see
https://list.nih.gov/cgi-bin/wa?A2=ind0803&L=IMAGEJ&P=R2098&I=-3In your case:
A single square is a square roi.
Two squares cannot be a square roi, so the whole thing is transformed
into a shape roi. In this case, one can't distinguish between a
square and a circle with a diameter of 1, so a single pixel gets a
perimeter of 3 (approximation of Pi) - nothing bad about this.
Also your squares are now considered shapes, so it is not astonishing
that you get a different value (edges will be considered rounded) -
but the difference is too much!
E.g., for a 6x6 square measured as a shape roi I get a perimeter of
18 - less than for a circle with a diameter of 6 (where I get 20).
Also you get a factor of 3 for the perimeter/side_length ratio.
So it seems that this is a bug - possibly in Java java.awt.geom?
(I use Java 1.5.0_16 on Intel OSX).
Michael
________________________________________________________________
On 23 Jan 2009, at 13:06, Chris Bradhurst wrote:
> Hello All,
>
> I'm getting unexpected results for the perimeter value returned by the
> ImageJ measure command (version 1.41o) when applying to composite
> disjoint
> selections.
>
> e.g.:
> Just one square selection (20x20 pixels):
> Area: 400, Perimeter 80 - as expected.
>
> Hold shift and create an additional non-overlapping 20x20 square:
> Area: 800, Perimeter 120 - (should be 160)
>
> Create a third 20x20 non-overlapping square:
> Area: 1200, Perimeter 180 - (should be 240)
>
> In each case the area is correct, but the perimeter doesn't seem
> right when
> there is 2 or more squares in the selection.
>
> Any thoughts would be appreciated.
>
> Kind Regards,
> -Chris.