[Insight-users] characteristics

Luis Ibanez luis.ibanez at kitware.com
Wed, 28 Apr 2004 11:52:09 -0400


Hi David,

Almost everything in image processing has been
borrowed (or stolen) from other domains. The
notion of "Mass", as anything else in image
processing, is totally artificial. The way the
ImageMomentsCalculator is computing "Mass" is by
simply calculating the sum of intensities in the
image.

If you assume that this intensities (Mass) where
occupying a circular region of space, you will
expect this region to have a surface S close to
PI * R ^2. (Note that this approximation is
bad when R < 10 pixels, in which case you could
actually do better by just counting the pixels).

If all the pixels in this surface have been set
to an intensity value I = 255 value, then the
"Mass" will be given by

                 M = S * I

therefore

            M = PI * R^2 * I

If you know the intensity I and the "Mass"
M (given by the MomentsCalculator) you can
estimate the radius of the presumed circular
shape:

        R = sqrt(  M / ( PI * I )  )




Regards,


    Luis


----------------------
David Llanos wrote:

> Thank you Luis, I already solved the problem. But I have a doubt (to
> Insight' margin):
> I don't know the proportion between the total mass and him surface, of I
> toss, does an object with two dimensions have mass?
> 
> Regards,
> 
> David
> 
> 
> 
> ----- Original Message ----- 
> From: "Luis Ibanez" <luis.ibanez at kitware.com>
> To: "David Llanos" <gva02 at elai.upm.es>
> Cc: <insight-users at itk.org>
> Sent: Tuesday, April 27, 2004 3:56 AM
> Subject: Re: [Insight-users] characteristics
> 
> 
> 
>>Hi David:
>>
>>
>>Two errors:
>>
>>1) You are not calling "Compute()" in the ImageMomentCalculator.
>>
>>
> 
> http://www.itk.org/Insight/Doxygen/html/classitk_1_1ImageMomentsCalculator.html#a2
> 
>>    Therefore, when you try to get the Center of Gravity you are
>>    triggering and exception,... that you don't see, because of
>>    error 2 (below)
>>
>>2) You should have placed a try/catch block around your code
>>    and in the catch block, print out the description of the
>>    potential exception being thrown.
>>
>>
>>Also note that here you are feeding the ImageMomentCalculator
>>with the image read directly from a file. Does this file already
>>have a single region isolated ?  Your original problem was to
>>find the centers and radious of a set of circles in an image.
>>For the ImageMomentCalcultor to work for this purpose, you must
>>first isolate the circles, one per image.
>>
>>
>>Regards,
>>
>>
>>    Luis
>>
>>
> 
> 
>