Questions about equations of Shape Descriptors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Questions about equations of Shape Descriptors

Ruszkai Ákos
Hello,

I think I'm asking trivial questions again, but I better be sure about this.

http://rsbweb.nih.gov/ij/docs/menus/analyze.html says:

*Round* (roundness): 4*area/(π*sqr(major axis)), or the inverse of the
aspect ratio.

So... does area in this equation mean "area of best fit ellipse" ? I suppose
it does, as we're talking about "major axis" in the denominator.
Also, does sqr mean pow(major axis, 2) aka (major axis)^2 ?
In that case, how'd you write square root?

Regards,

Ákos
Reply | Threaded
Open this post in threaded view
|

Re: Questions about equations of Shape Descriptors

Gabriel Landini
On Thursday 25 February 2010 21:10:46 you wrote:
> http://rsbweb.nih.gov/ij/docs/menus/analyze.html says:
>
> *Round* (roundness): 4*area/(π*sqr(major axis)), or the inverse of the
> aspect ratio.
>
> So... does area in this equation mean "area of best fit ellipse" ?

No, it is area of the blob, which in IJ is the number of pixels.
Note that other plugins (such as the particles8 and 4 plugins) compute area
differently than IJ, and so the result values might not be exactly the same.

> suppose it does, as we're talking about "major axis" in the denominator.

Major axis, here means "maximum Feret diameter" of the blob.

> Also, does sqr mean pow(major axis, 2) aka (major axis)^2 ?
> In that case, how'd you write square root?

pow (n, 2) is n^2.
sqrt(n) is the square root of n, see the macro functions.

G.
Reply | Threaded
Open this post in threaded view
|

Re: Questions about equations of Shape Descriptors

Ruszkai Ákos
On 25 February 2010 23:34, Gabriel Landini <[hidden email]> wrote:

> On Thursday 25 February 2010 21:10:46 you wrote:
> > http://rsbweb.nih.gov/ij/docs/menus/analyze.html says:
> >
> > *Round* (roundness): 4*area/(π*sqr(major axis)), or the inverse of the
> > aspect ratio.
> >
> > So... does area in this equation mean "area of best fit ellipse" ?
>
> No, it is area of the blob, which in IJ is the number of pixels.
> Note that other plugins (such as the particles8 and 4 plugins) compute area
> differently than IJ, and so the result values might not be exactly the
> same.
>
> Ok, thank you, that sounds reasonable.
However...


> Major axis, here means "maximum Feret diameter" of the blob.
>

Then it's either very misleading, or even worse, not true at all. For Aspect
ratio, the site says:

*AR* (aspect ratio): major axis/minor axis. Enable "Fit Ellipse" in
*Analyze>Set
Measurements* to have the major and minor axis displayed.

As far as I know, AR is calculated by the other way around: minor/major. Or
am I false here again? I'm aware of the thing that it simply shows how
elongated the area I measure, and it only has real relevance if I have
predefined axis's which I compare to,  but somehow eg. 3:4 is just doesn't
feel the same like 4:3.



> > Also, does sqr mean pow(major axis, 2) aka (major axis)^2 ?
> > In that case, how'd you write square root?
>
> pow (n, 2) is n^2.
> sqrt(n) is the square root of n, see the macro functions.
>

Umm... are we exactly sure that circularity is 4π*area/sqr(perimeter) ?
Because http://www.ncbi.nlm.nih.gov/pubmed/17933272 tells me circularity is:

4π*area/(perimeter)^2 which is != 4π*area/sqr(perimeter) !

Another misleading thing for me: if AR is calculated from the fit ellipse
axis's (either way why would the descriptin say  **Enable "Fit
Ellipse" in *Analyze>Set
Measurements* to have the major and minor axis displayed), why does it say
"major axis" again in *

Round* (roundness): 4*area/(π*sqr(major axis)), or the inverse of the aspect
ratio.

?

To be exactly sure, I've double checked with graphical experiment, and Feret
diamater is != Major axis of best fit ellipse.
I hope it's not only my brain that can't add things up here, sorry if I'm
annoying or too much incomprehent.

Regards,

Ákos
Reply | Threaded
Open this post in threaded view
|

Re: Questions about equations of Shape Descriptors

vischer
The area of an irregular roi, and that its of best-fitting ellipse, are the same (so are their moments of inertia).


Unfortunately, the equation

>> roundness = 4*area/(π*sqr(major axis))

has slipped into the documentation ages ago. It is correct, but it simply says:

 roundness = minor/major.

The "sqr" in the above equation does mean "square" (though it's not macro syntax).
Major axis and max Feret diameter are not the same. The best-fitting ellipse is a much more robust measurement than the Feret diameter, as all pixels inside an object are taken into account, not only the perimeter pixels.

Norbert Vischer
Reply | Threaded
Open this post in threaded view
|

Re: Questions about equations of Shape Descriptors

Ruszkai Ákos
Hello,

On 26 February 2010 01:39, Norbert Vischer <[hidden email]> wrote:

> The area of an irregular roi, and that its of best-fitting ellipse, are the
> same (so are their moments of inertia).
>
>
> The "sqr" in the above equation does mean "square" (though it's not macro
> syntax).
>

So I can assume "square" here truly means x^2

Major axis and max Feret diameter are not the same. The best-fitting ellipse
> is a much more robust measurement than the Feret diameter, as all pixels
> inside an object are taken into account, not only the perimeter pixels.
>

So the A for Area is best fitting ellipse area and major minor axis of best
fitting ellipse in AR, Round? And what about Circularity?
(I'm rewriting those parts in my thesis that describe what's what in the
equation now for at least the 4th time :D )

Regards

Ákos
Reply | Threaded
Open this post in threaded view
|

Re: Questions about equations of Shape Descriptors

Gabriel Landini
In reply to this post by vischer
On Friday 26 Feb 2010  09:06:33 you wrote:
> The "sqr" in the above equation does mean "square" (though it's not macro
> syntax).

That is right.

> Major axis and max Feret diameter are not the same. The
> best-fitting ellipse is a much more robust measurement than the Feret
> diameter, as all pixels inside an object are taken into account, not only
> the perimeter pixels.

Well it depends of what one is trying to characterise. For instance if one
needs to know something related to their length for very thin particles like a
latin cross, the fitted ellipse (that has the same area as the cross) has a
very small maximum diameter and so it underestimates the extent of the shape
(I know, it correlates with the area, but we already know that!). For convex
particles with no holes the fitted ellipse might approach the particle other
stats. So it really depends.

Just in case, I think that most "major" and "minor axis" instances of
morphological parameters (such as those in Russ' book) relate to the maximum
Feret and breadth (and should not be confused with the Major, Minor of the
fitted ellipse found in the IJ results table when one uses "Fit ellipse").
Otherwise one would end up measuring the shape descriptors of ellipses. I
mention this because it might become confusing when computing parameters like
the "equivalent ellipse area" that represents the area of an ellipse that has
the same long and short axis (ie Max Feret and breadth) as the particle.

As mentioned in Russ' book there are tons of morphological parameters  which
are small variations of others, sometimes with different names or just
factored by a constant.

Cheers

G.
Reply | Threaded
Open this post in threaded view
|

Re: Questions about equations of Shape Descriptors

Gabriel Landini
In reply to this post by Ruszkai Ákos
On Thursday 25 Feb 2010  10:17:02 you wrote:
> Then it's either very misleading, or even worse, not true at all. For
> Aspect ratio, the site says:
>
> *AR* (aspect ratio): major axis/minor axis. Enable "Fit Ellipse" in
> *Analyze>Set
> Measurements* to have the major and minor axis displayed.

In Particles8 I compute the aspect ratio as the ratio of Maximum Feret to the
Breadth of the particle. In IJ, that seems to be done on the fitted ellipse.
They are measuring different things.

> As far as I know, AR is calculated by the other way around: minor/major.

As far as I am aware that is not written  in stone, so it is a matter of
definition.

> Or
> am I false here again? I'm aware of the thing that it simply shows how
> elongated the area I measure, and it only has real relevance if I have
> predefined axis's which I compare to,  but somehow eg. 3:4 is just doesn't
> feel the same like 4:3

As you know, since you will be computing all your ARs with the same procedure
it should not make a difference in the result. If you want them the way round
do 1.0/AR.  That is why one has to be aware to the definition of the
parameters. Sometimes these do not match across different packages (or
plugins). The advantage here is that you can check the source to see exactly
how things are done. Try that in any "commercial" package.

> Umm... are we exactly sure that circularity is 4π*area/sqr(perimeter) ?
> Because http://www.ncbi.nlm.nih.gov/pubmed/17933272 tells me circularity
> is:
>
> 4π*area/(perimeter)^2 which is != 4π*area/sqr(perimeter) !

Perhaps I confused you in my reply. The formula is correct
4π*area/(perimeter)^2
I just pointed out that "sqrt" (no "t") is the square root in the macro
language. But I now realise that this was not what you were asking.

> Another misleading thing for me: if AR is calculated from the fit ellipse
> axis's (either way why would the descriptin say  **Enable "Fit
> Ellipse" in *Analyze>Set  Measurements* to have the major and minor axis
> displayed), why does it say "major axis" again in
> *Round* (roundness): 4*area/(π*sqr(major axis)), or the inverse of the
> aspect ratio.

This is confusing but only because the way IJ computes AR.
As mentioned before, AR in IJ is for the fitted ellipse, not the particle.
You need to write your own AR or use Particles8 to compute the AR of the
particle instead.

Cheers

G.
Reply | Threaded
Open this post in threaded view
|

Re: Questions about equations of Shape Descriptors

vischer
In reply to this post by Gabriel Landini
Hi Gabriel,

of course I agree with you that Feret is less abstract, and often comes close to what one really wants to know.
But any noise or other irregularities biases the Feret parameters to be overestimated.

In our lab, we measure rod-shaped bacteria (cylinders with hemispherical caps), and if we would use Min Feret to classify the diameter of the cylinder (13..15 px), a single noise pixel or slightly bent cylinders would lead to large overestimation.
So we better use the ellipse parameters and convert them with an equation into length and diameter. The converter equation assumes that the image of the rod has the same moments of inertia as the ellipse found by ImageJ.
For any shape that has two axes of symmetry, and that can be described with two parameters, such a converter equation can possibly be found.

regards, Norbert
Reply | Threaded
Open this post in threaded view
|

Re: Questions about equations of Shape Descriptors

Michael Cammer-2
In the ratio, at times we've also used the perimeter instead of the
Feret's diameter.  I think the rationale was that for very irregular
objects the Feret's doesn't change much while the perimeter could
continue to grow very large.
-Michael C

On Fri, Feb 26, 2010 at 8:01 AM, Norbert Vischer <[hidden email]> wrote:

> Hi Gabriel,
>
> of course I agree with you that Feret is less abstract, and often comes close to what one really wants to know.
> But any noise or other irregularities biases the Feret parameters to be overestimated.
>
> In our lab, we measure rod-shaped bacteria (cylinders with hemispherical caps), and if we would use Min Feret to classify the diameter of the cylinder (13..15 px), a single noise pixel or slightly bent cylinders would lead to large overestimation.
> So we better use the ellipse parameters and convert them with an equation into length and diameter. The converter equation assumes that the image of the rod has the same moments of inertia as the ellipse found by ImageJ.
> For any shape that has two axes of symmetry, and that can be described with two parameters, such a converter equation can possibly be found.
>
> regards, Norbert
>



--
Michael Cammer  *  http://coxcammer.com/
[hidden email]  or  [hidden email]
H 914-632-3044     Cell 914-309-3270
Reply | Threaded
Open this post in threaded view
|

Text on the Movie

ALEMBIC | Cesare
Dear List,
in ImageJ, there a way to insert a text over a movie, a text that
remains on all frames (or even some of the frames)?

Thanks in advance for your help.


_________________________________________________________________________________
Dr. Cesare Covino
ALEMBIC
Advanced Light and Electron Microscopy BioImaging Center
San Raffaele Scientific Institute
Milano - Italy
Reply | Threaded
Open this post in threaded view
|

Re: Text on the Movie

Mario Faretta
ciao Cesare,
try the Event Stamper Plugin in the "Movies" group
Hope it helps
Mario

 Cesare -ALEMBIC- ([hidden email]) wrote:
 >
 > Dear List,
 > in ImageJ, there a way to insert a text over a movie, a text that
 > remains on all frames (or even some of the frames)?
 >
 > Thanks in advance for your help.
 >
 >
 >
_________________________________________________________________________________
 > Dr. Cesare Covino
 > ALEMBIC
 > Advanced Light and Electron Microscopy BioImaging Center
 > San Raffaele Scientific Institute
 > Milano - Italy
 >

--
Mario Faretta
Department of Experimental Oncology
European Institute of Oncology
c/o IFOM-IEO Campus for Oncogenomics
via Adamello 16
20139 Milan
Italy
Phone: ++39-02574303054
email: [hidden email]
http://www.ifom-ieo-campus.it



[- Il Tuo 5 per Mille a favore della Ricerca dell'Istituto Europeo di
Oncologia

Tutti coloro che presentano il modello Unico, il modello 730 o più
semplicemente che ricevono dal proprio datore di lavoro il modello CUD, hanno
la facoltà di scegliere la destinazione del proprio 5 per mille.

Nella casella riservata al Finanziamento agli Enti della Ricerca Sanitaria
inserisci il codice fiscale dello IEO (08 69 14 40 153) ed apponi la Tua
firma.
Il Tuo 5 per Mille verrà destinato alla ricerca contro il cancro dell'Istituto
Europeo di Oncologia

NON COSTA NULLA E NON COMPORTA ALCUN AUMENTO DELLE IMPOSTE DA VERSARE
NON È UN'ALTERNATIVA ALL'8 PER MILLE
E' UN GESTO CONCRETO E DI GRANDE VALORE

Per saperne di più vai al sito dello IEO www.ieo.it < http://www.ieo.it >
oppure scrivi a [hidden email] < mailto:[hidden email]>

Segnala ad un amico questa opportunità

 -]
Reply | Threaded
Open this post in threaded view
|

Re: Text on the Movie

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by ALEMBIC | Cesare
On Mar 1, 2010, at 6:04 AM, Cesare -ALEMBIC- wrote:

> Dear List,
> in ImageJ, there a way to insert a text over a movie, a text that
> remains on all frames (or even some of the frames)?

You can do this using the image>Stacks>Label command. Set "Interval" to zero to display only the contents of the "Text" field. The daily build adds a "Slice range" option.

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: Text on the Movie

Knecht, David
Hi Wayne- Can the Label command be made to add the label to an overlay instead of onto the image so it can be hidden or removed?  Dave

On Mar 1, 2010, at 2:15 PM, Rasband, Wayne (NIH/NIMH) [E] wrote:

> On Mar 1, 2010, at 6:04 AM, Cesare -ALEMBIC- wrote:
>
>> Dear List,
>> in ImageJ, there a way to insert a text over a movie, a text that
>> remains on all frames (or even some of the frames)?
>
> You can do this using the image>Stacks>Label command. Set "Interval" to zero to display only the contents of the "Text" field. The daily build adds a "Slice range" option.
>
> -wayne

Dr. David Knecht    
Department of Molecular and Cell Biology
Co-head Flow Cytometry and Confocal Microscopy Facility
U-3125
91 N. Eagleville Rd.
University of Connecticut
Storrs, CT 06269
860-486-2200
860-486-4331 (fax)