Convert volume from voxels to mm^3 or cm^3

Hey Guys,

I am quite new in ITK. I implemented using LabelGeometryImageFilter.
I extracted label volumes. Output results are in voxels.
I would like to convert to cc`3 or mm^3.
Could you help me how I can do that ?
What is the best way ?

I would be appreciate for any help.

Best :slight_smile:

Multiply the number of voxels by the volume of a single voxel:

auto sp = image->GetSpacing();
double voxelVolume = sp[0]*sp[1]*sp[2];
1 Like

Thanks for reply.
I was thinking about something like this …

volume_in_voxels = labelGeometryImageFilter->GetVolume(labelValue);
volume_in_cc = volume_in_voxels/(spacing[0]*spacing[1]*spacing[3]*1000)

But I am not sure that I am right … ??

That seems right.

1 Like