[Insight-users] How to calculate a volume

M.Staring at lumc.nl M.Staring at lumc.nl
Tue Feb 2 04:33:09 EST 2010


Hi Xi,

you can multiply the number of voxels that you found by the number of ml
of one voxel, which is the product of the gridspacing:

SpacingType spacing = image->GetSpacing();
double volumeOfOneVoxel = spacing[0] * spacing[1] * spacing[2];
double totalVolume = nrOfVoxelsInMask * volumeOfOneVoxel;

Regards,

Marius

> -----Original Message-----
> From: insight-users-bounces at itk.org 
> [mailto:insight-users-bounces at itk.org] On Behalf Of Xi LIANG
> Sent: dinsdag 2 februari 2010 9:54
> To: Insight Users
> Cc: Xi LIANG
> Subject: [Insight-users] How to calculate a volume
> 
> Dear all,
> 
> I am trying to calculate the volume of a 3D mask image. What 
> I did was to count the voxel number, but found some image 
> have different voxel space. Therefore, I think I should 
> calculate them in ml. Is there any example available to 
> calculate the volume? All suggestions are welcome.
> 
> Best regards, 
> 
> Xi
> 
> 
> 
> 
> ________________________________
> 
> Hotmail: Powerful Free email with security by Microsoft. Get 
> it now. <https://signup.live.com/signup.aspx?id=60969> 
> 


More information about the Insight-users mailing list