# What algorithm/formula was used to calculate the signal intensity mean and SD in the module segment statistics?

**URL:** <https://discourse.slicer.org/t/what-algorithm-formula-was-used-to-calculate-the-signal-intensity-mean-and-sd-in-the-module-segment-statistics/22770>\
**Category:** Support\
**Tags:** segmentation, dicom, python\
**Created:** [March 31, 2022, 1:17am UTC](https://discourse.slicer.org/t/what-algorithm-formula-was-used-to-calculate-the-signal-intensity-mean-and-sd-in-the-module-segment-statistics/22770 "2022-03-31T01:17:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jue](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jue](https://discourse.slicer.org/u/Jue)\
**Post date:** [March 31, 2022, 1:17am UTC](https://discourse.slicer.org/t/what-algorithm-formula-was-used-to-calculate-the-signal-intensity-mean-and-sd-in-the-module-segment-statistics/22770/1 "2022-03-31T01:17:09Z")

</div>

I used 3d slicer software to segment an adipose tissue from the MRI dicom image, and the module Segment Statistics automatically calculated and displayed the signal intensity mean and SD of this segmentation.  
How the signal intensity mean and SD of this segmentation was calculated and what algorithm/formula was used.

I find a code  
` self.scalarSelector.setToolTip( "Select the scalar volume for intensity statistics calculations")`  
but I couldn’t understand what kind of the algorithm/formula was used.

Thank you very much.

---

<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:** [March 31, 2022, 1:33pm UTC](https://discourse.slicer.org/t/what-algorithm-formula-was-used-to-calculate-the-signal-intensity-mean-and-sd-in-the-module-segment-statistics/22770/2 "2022-03-31T13:33:05Z")

</div>

If you have any doubts then you can always look up the implementation. [Segment Statistics module uses vtkImageAccumulate](https://github.com/Slicer/Slicer/blob/942a83bbe72646afb788fd6059596a1ca658b9d0/Modules/Scripted/SegmentStatistics/SegmentStatisticsPlugins/ScalarVolumeSegmentStatisticsPlugin.py#L32-L60) and that class internally uses [this formula](https://github.com/Kitware/VTK/blob/master/Imaging/Statistics/vtkImageAccumulate.cxx#L225-L247), which is the _corrected sample standard deviation_.

---

<div class="post-metadata">

**Author:** ![dszimatore](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@dszimatore](https://discourse.slicer.org/u/dszimatore)\
**Post date:** [January 14, 2023, 6:33pm UTC](https://discourse.slicer.org/t/what-algorithm-formula-was-used-to-calculate-the-signal-intensity-mean-and-sd-in-the-module-segment-statistics/22770/3 "2023-01-14T18:33:55Z")

</div>

Hello! Which command did you use to obtain the signal intensity in the “Segment staistics” module? I can obtain only informarmation about volume.  
Thank you!

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [January 14, 2023, 7:33pm UTC](https://discourse.slicer.org/t/what-algorithm-formula-was-used-to-calculate-the-signal-intensity-mean-and-sd-in-the-module-segment-statistics/22770/4 "2023-01-14T19:33:51Z")

</div>

You can enable Scalar Volume Statistics but need to select the reference volume:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/8/58b193d0cf24536a8cee02225760809702e29233.png)

---

<div class="post-metadata">

**Author:** ![dszimatore](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@dszimatore](https://discourse.slicer.org/u/dszimatore)\
**Post date:** [January 15, 2023, 11:38am UTC](https://discourse.slicer.org/t/what-algorithm-formula-was-used-to-calculate-the-signal-intensity-mean-and-sd-in-the-module-segment-statistics/22770/5 "2023-01-15T11:38:15Z")

</div>

I didn’t catch that “mean” was referred to signal intensity!  
Thank you very much!
