# Which value gives me the true number of voxels in a segmentation segment?

**URL:** <https://discourse.slicer.org/t/which-value-gives-me-the-true-number-of-voxels-in-a-segmentation-segment/33271>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [December 6, 2023, 11:07pm UTC](https://discourse.slicer.org/t/which-value-gives-me-the-true-number-of-voxels-in-a-segmentation-segment/33271 "2023-12-06T23:07:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jashrand](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@jashrand](https://discourse.slicer.org/u/jashrand)\
**Post date:** [December 6, 2023, 11:07pm UTC](https://discourse.slicer.org/t/which-value-gives-me-the-true-number-of-voxels-in-a-segmentation-segment/33271/1 "2023-12-06T23:07:05Z")

</div>

I made a segmentation, and want to know the total number of voxels in the label I made.  
I right-clicked on the segmentation and chose “Calculate statistics…”

It gave me the statistics in the table, shown in the attached image here.  
However, there are two different values for the number of voxels.

```auto
Number of voxels [voxels] (1) : 577
Number of voxels [voxels] (2) : 699

```

Which of these values is the true number of voxels in my segment? And what is the difference between these two values?

Thanks!

 ![Screen Shot 2023-12-06 at 4.33.06 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/a/ea3b791d3ec718b778d39bc59fd53d63f9b6bfa9.jpeg)

---

<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:** [December 6, 2023, 11:10pm UTC](https://discourse.slicer.org/t/which-value-gives-me-the-true-number-of-voxels-in-a-segmentation-segment/33271/2 "2023-12-06T23:10:40Z")

</div>

You can find more information (e.g., which plugin computed the values) in the tooltip when you hover over the value in the table. Specification of all the computed values are available in the [module’s documentation](https://slicer.readthedocs.io/en/latest/user_guide/modules/segmentstatistics.html).

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [December 7, 2023, 6:16pm UTC](https://discourse.slicer.org/t/which-value-gives-me-the-true-number-of-voxels-in-a-segmentation-segment/33271/3 "2023-12-07T18:16:08Z")

</div>

I noticed in the documentation that @lassoan linked that the count of the number of segment voxels as computed by the scalar volume statistics is limited to the spatial region where the scalar volume is defined, whereas the number of voxels as reported by the labelmap statistics is based on the count of the voxels in the binary labelmap for the segment. If the segmentation geometry is the same as the scalar image volume geometry and the segment does not extend outside the scalar image region, then these two counts should be identical. However, they will differ if the segment extends outside of the scalar image volume. Is it possible that your segment is partially outside of the image volume?

---

<div class="post-metadata">

**Author:** ![jashrand](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@jashrand](https://discourse.slicer.org/u/jashrand)\
**Post date:** [December 8, 2023, 8:46pm UTC](https://discourse.slicer.org/t/which-value-gives-me-the-true-number-of-voxels-in-a-segmentation-segment/33271/4 "2023-12-08T20:46:31Z")

</div>

Yes, I think that was the issue. Thanks for helping me figure that out!
