[Insight-users] How to calculate volume of an image

Mathieu Malaterre mathieu.malaterre at gmail.com
Sun Apr 25 09:06:40 EDT 2010


On Tue, Apr 20, 2010 at 6:24 PM, Mario Ceresa <mrceresa at gmail.com> wrote:
> Hello everybody!
>
> I'm completely lost on a seemingly stupid problem: how do I calculate
> the physical volume of an image (3D CT scan)?
>
> In the past I would have simply iterated over the interesting pixels
> in the image, accumulated them in a variable, say m_Vol, and then:
>
> std::cout << "Volume: " << m_VolLung*spacing[0]*spacing[1]*spacing[2]
>
> This believing that spacing 0 and 1 came from the "Pixel Spacing" tag
> of my DICOM header and spacing[2] from the "Slice Thickness" tag.

No do not ever use Slice Thickness. See a minimalistic answer:

http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Using_GDCM_API#Where_is_the_value_of_gdcm.Image.Spacing_coming_from_.3F

HTH
-- 
Mathieu


More information about the Insight-users mailing list