# Clarification on L3 SMA calculations and Pixel Spacing

**URL:** <https://discourse.slicer.org/t/clarification-on-l3-sma-calculations-and-pixel-spacing/47219>\
**Category:** Support\
**Tags:** segmentation, python\
**Created:** [June 3, 2026, 9:33am UTC](https://discourse.slicer.org/t/clarification-on-l3-sma-calculations-and-pixel-spacing/47219 "2026-06-03T09:33:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![merckins](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@merckins](https://discourse.slicer.org/u/merckins)\
**Post date:** [June 3, 2026, 9:33am UTC](https://discourse.slicer.org/t/clarification-on-l3-sma-calculations-and-pixel-spacing/47219/1 "2026-06-03T09:33:41Z")

</div>

Hello,

I’m working on calculating CT L3 SMA, but some aspects are still unclear to me. I may be overlooking something, so I would really appreciate any feedback.

I have original CT volumes with differing pixel spacings, and L3 slices were selected from these volume. For example, an L3 slice from patient 1 has the following image dimensions (from 3D Slicer) (512 x 512 x 1) and image spacing information (0.806, 0.806, 1.0mm).

I also have a segmentation mask with the following dimensions (512 x 512 x 1) and the following image spacing information (1,1,1). The mask was the output of a segmentation algorithm + some postprocessing steps.

When I try to calculate the SMA using the original CT spacings, I get more reasonable values. However, when I calculate the SMA using (1,1) spacing, the calculated L3 SMAs are too large. So in this case it’s 192 cm2 vs. 295.13 cm2. For some others the SMA is in the 300s.

Here is my python code for calculating the SMA:

```auto
# read dicom file - orig CT slice
ds = pydicom.dcmread(str(file_dcm))

spacing_x, spacing_y = ds.PixelSpacing 
#print(“Pixel spacings:”, spacing_x, spacing_y)

# calculate SMA
pixel_area = spacing_x * spacing_y 
# pixel_area = 1

sma = np.sum(muscle == 1) * pixel_area / 100 # cm²

```

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:** [June 3, 2026, 8:57pm UTC](https://discourse.slicer.org/t/clarification-on-l3-sma-calculations-and-pixel-spacing/47219/2 "2026-06-03T20:57:01Z")

</div>

Since now skeletal muscles can be segmented properly in 3D, I would recommend to not bother with 2D slices. You can get the muscles using TotalSegmentator or other models and then get all the cross-sectional areas of all the muscles or any other structures in across a line using `Segment Cross-Section Area` module in Sandbox extension or using [Segment Geometry](https://github.com/jmhuie/Slicer-SegmentGeometry) or [SlicerVMTK](https://github.com/vmtk/SlicerExtension-VMTK#the-vmtk-extension-for-3d-slicer) extensions. Getting the cross sections in all the slices instead of an arbitrarily selected point at L3 level would give you more confidence in your data.

In general, make sure you always work in physical space, i.e., always know the geometry of your image (origin, spacing, axis directions; usually stored as an IJK to LPS matrix), and always maintain the geometry information when you process an image (copy IJK to LPS from the input image to the output image).

---

<div class="post-metadata">

**Author:** ![merckins](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@merckins](https://discourse.slicer.org/u/merckins)\
**Post date:** [June 4, 2026, 7:31am UTC](https://discourse.slicer.org/t/clarification-on-l3-sma-calculations-and-pixel-spacing/47219/3 "2026-06-04T07:31:29Z")

</div>

Thank you for the response. I will focus on the 3D volume instead.
