# How to measure 3D volume's dimensions?

**URL:** <https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170>\
**Category:** Support\
**Tags:** quantitative, 3d-model\
**Created:** [October 4, 2017, 10:42am UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170 "2017-10-04T10:42:20Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohamed](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@Mohamed](https://discourse.slicer.org/u/Mohamed)\
**Post date:** [October 4, 2017, 10:42am UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/1 "2017-10-04T10:42:20Z")

</div>

Operating system: Windows 10  
Slicer version: 4.7.0-2017-09-21

Hi, I wanted to know how to measure the dimensions of the 3D volume data. For example the perimeter or mass.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [October 4, 2017, 12:30pm UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/2 "2017-10-04T12:30:42Z")

</div>

If you segment and make a model you can get volume and surface area. To get mass you’d need to know the density, which Slicer doesn’t store.

[https://www.slicer.org/wiki/Documentation/Nightly/Modules/Models](https://www.slicer.org/wiki/Documentation/Nightly/Modules/Models)

Maybe you can give more details about what you are trying to do and we can give further pointers.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 4, 2017, 12:53pm UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/3 "2017-10-04T12:53:10Z")

</div>

You can get density (mean intensity of a volume in a selected segment) by Segment Statistics module. Segment Statistics also computes surface, volume, and other properties of segments. You need to use recent nightly version of Slicer and create segments using Segment Editor module.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [October 4, 2017, 1:07pm UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/4 "2017-10-04T13:07:01Z")

</div>

> [@lassoan](#):
>
> You can get density (mean intensity of a volume in a selected segment)

but to know the overall mass of the segmented volume you’d still need to know the mapping from “signal” density to “mass” density which probably depends on many factors which may not be in the imaging data.

---

<div class="post-metadata">

**Author:** ![gcsharp](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gcsharp/32/863_2.png) [@gcsharp](https://discourse.slicer.org/u/gcsharp)\
**Post date:** [October 4, 2017, 1:38pm UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/5 "2017-10-04T13:38:01Z")

</div>

For CT, it is reasonable to neglect atomic number and assume all materials are density-scaled water. Density would be (1000+intensity)/1000 g/cc.

---

<div class="post-metadata">

**Author:** ![Mohamed](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@Mohamed](https://discourse.slicer.org/u/Mohamed)\
**Post date:** [October 5, 2017, 11:18am UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/6 "2017-10-05T11:18:09Z")

</div>

Thanks Steve for your answer. Yes i was looking for that data as i want to compare the data size before and after decimation.  
Thanks again for referring the doc.  
Thanks for everyone’s answer as well.

Regards,

---

<div class="post-metadata">

**Author:** ![stevenagl12](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/stevenagl12/32/3391_2.png) [@stevenagl12](https://discourse.slicer.org/u/stevenagl12)\
**Post date:** [November 9, 2018, 7:27pm UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/7 "2018-11-09T19:27:14Z")

</div>

When using segment statistics, why does it generate 3 different values for volume in mm3 and cm3 per segment? Also, is there a way to compute maximum/minimum 3D diameter with any of the statistics modules? I know radiomics has it, but I guess radiomics is down…

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 9, 2018, 8:10pm UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/8 "2018-11-09T20:10:50Z")

</div>

> [@stevenagl12](#):
>
> why does it generate 3 different values

There are several ways of computing these metrics. The main difference is what is the representation used (surface or volumetric) and if the entire segment is used or only the part that overlaps with the selected scalar volume.

> Also, is there a way to compute maximum/minimum 3D diameter with any of the statistics modules?

Currently diameter computation is not offered by any of the Segment Statistics plugins.

SimpleITK’s LabelShapeStatisticsImageFilter can compute many kind of diameters and it is already available in Slicer. So, it would be just a matter of adding a few ten lines of code to run the segment’s labelmap representation through this filter and add outputs to the table. Would you be interested in working on this?

> [@stevenagl12](#):
>
> radiomics is down

It should be back soon. You can monitor the status [here](https://github.com/Radiomics/SlicerRadiomics/issues/50). Maybe add a note there to show that you would like to get this up and working again (and maybe offer your help, if you can).

---

<div class="post-metadata">

**Author:** ![Lottemarijn](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@Lottemarijn](https://discourse.slicer.org/u/Lottemarijn)\
**Post date:** [May 27, 2019, 9:11am UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/9 "2019-05-27T09:11:05Z")

</div>

> [@lassoan](#):
>
> There are several ways of computing these metrics. The main difference is what is the representation used (surface or volumetric) and if the entire segment is used or only the part that overlaps with the selected scalar volume.

I want to compare a segmentation from an ultrasound image to that of a CT-image. Which of the three values is most accurate to use for this purpose?  
Thanks

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 27, 2019, 12:30pm UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/10 "2019-05-27T12:30:43Z")

</div>

Is there a significant difference between the reported values?

---

<div class="post-metadata">

**Author:** ![Lottemarijn](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@Lottemarijn](https://discourse.slicer.org/u/Lottemarijn)\
**Post date:** [May 27, 2019, 12:44pm UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/11 "2019-05-27T12:44:36Z")

</div>

Thank you Andras for getting back to me so soon.

First of all, the values are very different when I use my segmentation or segmentation preview as input (which I don’t understand).

Secondly, the different volumes (1 and 2, when I use segmentation preview) are respectively 3482,77 mm3 and 3449,25 mm3. Not the biggest difference, but since I will be comparing two different images, I need to make sure that the volume i am using is as accurate as possible and is calculated with the same input as the computed surface area.

Also, I noticed that earlier in this discussion topic, you’ve stated that it was not possible to compute the maximum/minimum 3D diameter. Is this still correct?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 27, 2019, 1:22pm UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/12 "2019-05-27T13:22:10Z")

</div>

> [@Lottemarijn](#):
>
> values are very different when I use my segmentation or segmentation preview as input (which I don’t understand).

Until you apply an auto-complete effect (Grow from seeds, Watershed, etc.) current segmentation stores seeds and preview segmentation stores the final results. Apply the segmentation effect before quantification.

> [@Lottemarijn](#):
>
> the different volumes (1 and 2, when I use segmentation preview) are respectively 3482,77 mm3 and 3449,25 mm3.

It does not matter which method you use (the difference is less than 1%), just choose one and use always that. If you primarily work with labelmaps (and use 3D surface for visualization only) then you may prefer labelmap based method; if you mainly work with surfaces then you may choose the volume computed from the generated surface.

> [@Lottemarijn](#):
>
> it was not possible to compute the maximum/minimum 3D diameter. Is this still correct?

Correct. It would not be difficult to implement something like this, but for arbitrary shapes, maximum/minimum 3D diameter is not a well-defined metric. How would you define maximum/minimum 3D diameter for your segmented objects?

---

<div class="post-metadata">

**Author:** ![Lottemarijn](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@Lottemarijn](https://discourse.slicer.org/u/Lottemarijn)\
**Post date:** [May 27, 2019, 1:35pm UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/13 "2019-05-27T13:35:25Z")

</div>

> [@lassoan](#):
>
> Until you apply an auto-complete effect (Grow from seeds, Watershed, etc.) current segmentation stores seeds and preview segmentation stores the final results. Apply the segmentation effect before quantification.

You are right! this worked for me.

> [@lassoan](#):
>
> It does not matter which method you use (the difference is less than 1%), just choose one and use always that. If you primarily work with labelmaps (and use 3D surface for visualization only) then you may prefer labelmap based method; if you mainly work with surfaces then you may choose the volume computed from the generated surface.

Thank you for your explanation.

> [@lassoan](#):
>
> Correct. It would not be difficult to implement something like this, but for arbitrary shapes, maximum/minimum 3D diameter is not a well-defined metric. How would you define maximum/minimum 3D diameter for your segmented objects?

I understand that it would be difficult for arbitrary shapes. However, it could also be interesting to know the maximum diameter in the three different axes or the average diameter in those three different axes. Is this possible with the current modules and extensions?

---

<div class="post-metadata">

**Author:** ![JoostJM](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joostjm/32/1091_2.png) [@JoostJM](https://discourse.slicer.org/u/JoostJM)\
**Post date:** [June 17, 2019, 8:20am UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/14 "2019-06-17T08:20:35Z")

</div>

@Lottemarijn, the SlicerRadiomics extension (based on PyRadiomics) has maximum diameters implemented in the shape feature classes.

For class shape (describing 3D volumes) this is the maximum diameter in row (=saggital), column (=coronal) and slice (=axial) plane, as well as the maximum 3D overall.  
These diameters are calculated on the 3D surface mesh, as the other shape features also work with this representation. This mesh is build-up from point that lie half-way between a voxel-center that is part of the segmentation and one that is not. Moreover, this class also implements volume and surface area calculated on the mesh (MeshVolume and SurfaceArea), as well as volum based on counting the voxels (VoxelVolume)

For class shape2D (describing 2D surfaces), equivalent features for 2-dimensional surfaces have been implemented. Instead of MeshVolume and VoxelVolume, there is MeshSurface and PixelSurface, respectively and instead of SurfaceArea, there is Perimeter. This also implements a maximum diameter, but it is just the one (2D).

---

<div class="post-metadata">

**Author:** ![Lottemarijn](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@Lottemarijn](https://discourse.slicer.org/u/Lottemarijn)\
**Post date:** [July 10, 2019, 12:26pm UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/15 "2019-07-10T12:26:13Z")

</div>

Hey Joost,

Thanks for responding to this topic.  
I’ve tried to use the SlicerRadiomics extension for calculation these diameters, but the module doesnt function properly. When I press the “Apply” button, after selecting the input image volume and input region, the button changes to “Working…”. After this the program crashes.  
Do you have a suggestion on how to solve this problem?

---

<div class="post-metadata">

**Author:** ![JoostJM](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joostjm/32/1091_2.png) [@JoostJM](https://discourse.slicer.org/u/JoostJM)\
**Post date:** [December 10, 2019, 6:52am UTC](https://discourse.slicer.org/t/how-to-measure-3d-volumes-dimensions/1170/16 "2019-12-10T06:52:46Z")

</div>

My apologies for this late reply,  
There have been some updates to the extension, so it may work now. If not, can you share an anonymized image/mask so we can debug the issue?  
Alternatively, you can also try to extract features using the PyRadiomics command line interface.
