# Segment statistics from each slice

**URL:** <https://discourse.slicer.org/t/segment-statistics-from-each-slice/19569>\
**Category:** Support\
**Created:** [September 8, 2021, 1:02pm UTC](https://discourse.slicer.org/t/segment-statistics-from-each-slice/19569 "2021-09-08T13:02:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![melindamareesmith](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@melindamareesmith](https://discourse.slicer.org/u/melindamareesmith)\
**Post date:** [September 8, 2021, 1:02pm UTC](https://discourse.slicer.org/t/segment-statistics-from-each-slice/19569/1 "2021-09-08T13:02:33Z")

</div>

Hello,  
I can see how to extract mean scalar value for a segment from the segment statistics, but what I would like to do is extract this for each MRI slice- in a similar way to how the segment cross-sectional area outputs area for each slice. Is it possible?  
Thank you

---

<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:** [September 8, 2021, 3:10pm UTC](https://discourse.slicer.org/t/segment-statistics-from-each-slice/19569/2 "2021-09-08T15:10:42Z")

</div>

Can you write a bit about your use case? What is the clinical application?

You can implement this either in a short Python script or enhance the Segment cross-sectional area module to take an additional input volume and get the mean value for each slice (it is a single line of Python code to get average intensity of a masked volume at a specific slice, you just need to propagate the selected volume to the `run` method and save the result in an additional table in the column).

---

<div class="post-metadata">

**Author:** ![melindamareesmith](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@melindamareesmith](https://discourse.slicer.org/u/melindamareesmith)\
**Post date:** [September 8, 2021, 9:04pm UTC](https://discourse.slicer.org/t/segment-statistics-from-each-slice/19569/3 "2021-09-08T21:04:41Z")

</div>

Thank you for your reply. I am wanting to use the mean intensity from fat/water MRI to calculate muscle fat infiltration. I can see this is possible from the segment statistics output, however I want to examine this slice-by-slice in addition to whole segment (muscle) that the segment statistics allows.
