[Insight-users] Re: pixels To cm..

Miller, James V (Research) millerjv at crd.ge.com
Mon Oct 25 13:17:13 EDT 2004


RelabelComponentImageFilter has a method called

GetSizeOfObjectInPhysicalUnits(unsigned long obj)

that will return the size of the specified object in 
the physical units of the pixel spacing (usually mm).

So if you used the RelableComponentImageFilter already
(already called Update() on the filter), you can 
query the size of the object in physical units
(you can also query the size of the object in pixels).

If your pixel spacing is in mm and you want the size
in cm^2, you will need to scale the number returned
GetSizeOfObjectInPhysicalUnits() from mm^2 to cm^2.

Jim



-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
Sent: Sunday, October 24, 2004 5:23 PM
To: yasser salman
Cc: Insight-users at itk.org
Subject: [Insight-users] Re: pixels To cm..




Hi  Yasser,

Well, in your first email you said that you already segmented
a tumor using ConfidenceConnected, and then computed the number
of pixels inside the tumor by using the RelabelComponentImage
Filter.


The expression:

                 "areaInPixels"

in my previous email was making reference to the

         "Number of Pixels inside the tumor"




    Regards,


        Luis



--------------------------------------------

yasser salman wrote:

> Hi luis ..,
> about *areaInPixels* did u mean No. of pixels in ROI
> or what..,
> yasser
> --- Luis Ibanez <luis.ibanez at kitware.com> wrote:
> 
> 
>>Hi Yasser,
>>
>>
>>1) For converting an Area measured in Pixels^2 to
>>    an area in mm^2 units you must multiply by the
>>    product of the pixel spacing:
>>
>>
>>    ImageType::SpacingType spacing =
>>image->GetSpacing();
>>
>>    const double factor = spacing[0] * spacing[1];
>>
>>    double areaInMillimeters = areaInPixels *
>>factor;
>>
>>
>>2) If you run the program in 3D, and count the
>>    number of pixels inside a region, that will be
>>    a measure of volume. If you want to convert it
>>to
>>    mm^3 then you must do a similar operation to the
>>    one in (1):
>>
>>    ImageType::SpacingType spacing =
>>image->GetSpacing();
>>
>>    const double factor = spacing[0] * spacing[1] *
>>spacing[2];
>>
>>    double areaInMillimeters = areaInPixels *
>>factor;
>>
>>     Note that you can run ITK algorithms in 3D
>>natively.
>>     You *do not* need to do slice-by-slice
>>processing.
>>
>>
>>3) In both 2D and 3D, if your original segmentation
>>method
>>    give you any indication of partial volume in the
>>pixels
>>    in the boundary, you could use it in order to
>>reduce the
>>    uncertainty of the volume estimation. This is
>>the case
>>    of LevelSet, for example.
>>
>>
>>
>>
>>NOTE: Given that pixels represent a discretization
>>of the
>>       original object, the sum of pixels inside a
>>region
>>       is just an *estimation* of the region or
>>volume.
>>       The estimation is good if the region is
>>convex and
>>       large since the discretization errors only
>>occur in
>>       the boundaries of the region.  Conversely, if
>>you have
>>       a region with concave regions and thin
>>protrusions,
>>       the sum of pixels will give you a poor
>>estimation of
>>       the region's volume. The estimation may be
>>off by a 100%
>>       of the real value, when the protrusions are
>>about 1 pixel
>>       wide. If you want to make a formal estimation
>>of the volume,
>>       you probably want to consult some of the
>>papers on evaluation
>>       of geometrical features in discrete spaces.
>>
>>       Look, of example a the book
>>
>>          "Geometry of Digital Spaces" by Gabor T.
>>Herman,
>>
>>
>>
>>
>>Regards
>>
>>
>>
>>     Luis
>>
>>
>>
>>
>>--------------------------
>>yasser salman wrote:
>>
>>
>>>Hi All,
>>>i already segment a tumor region in 2D using
>>>ConfidenceConnectedImageFilter and count the no of
>>>pixels using RelabelComponentImageFilter , 
>>>how can i convert these no of pixels into cm2 or
>>
>>mm2
>>
>>>(the corresponding area in cm or mm).
>>>another question plz, if i run this program to a
>>>volume, is the no of pixels in 3D (volume) equal
>>
>>to 
>>
>>>the sum of all pixels in segmented region in 2D
>>>slices,
>>>
>>>yasser
>>>
>>>
>>>
>>>		
>>>_______________________________
>>>Do you Yahoo!?
>>>Declare Yourself - Register online to vote today!
>>>http://vote.yahoo.com
>>>
>>>
>>
>>
>>
>>
>>
> 
> 
> 
> 		
> _______________________________
> Do you Yahoo!?
> Declare Yourself - Register online to vote today!
> http://vote.yahoo.com
> 
> 




_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list