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

Mathieu Malaterre mathieu.malaterre at gmail.com
Sun Apr 25 09:04:44 EDT 2010


On Fri, Apr 23, 2010 at 11:32 AM, Jean-Pierre Roux
<jpr at creatis.insa-lyon.fr> wrote:
> Hi,
>
> With the old itm dicom reader (gdcm 1.2), the value returned by
> File::GetZSpacing() was computed using an ACR-NEMA heuristics (using 0018
> 0050 Slice Thickness and 0018 0088 Spacing Between Slices).
> It was known as giving sometimes unaccurate results.
>
> The only way to be sure to get an accurate result was to use
> SerieHelper::GetZSpacing() -based on Jolinda Smith's algorithm, to order the
> images according to their Image Position (Patient)-
>
> I'm not aware enough on gdcm2 to tell how to do thru ITK, but, sure the
> problem is solved using Serie information, and *cannot* be solved using a
> single slice.
>
> --> Mathieu, -as soon as Eyjafjallajökull ashes release you-  any comment
> would be very helpfull.

I already answered to Mario on gdcm2-dev mailing list. The root
problem is that he only uses a single slice. He then expect that
Z-Spacing should be equal to Slice Tickness, which is not true in the
general case.

gdcm.Image.GetSpacing() will do the hard work, no need to dive into
GDCM internal code. Or as Luis mention, use itk.Image.GetSpacing()
with the restriction that Z-Spacing cannot -always-  accurately be
determined in the case of a single slice.

HTH
-- 
Mathieu


More information about the Insight-users mailing list