# Extracting coordinates of muscle segmented on all slices from MRI scans

**URL:** <https://discourse.slicer.org/t/extracting-coordinates-of-muscle-segmented-on-all-slices-from-mri-scans/23441>\
**Category:** Support\
**Created:** [May 16, 2022, 1:45pm UTC](https://discourse.slicer.org/t/extracting-coordinates-of-muscle-segmented-on-all-slices-from-mri-scans/23441 "2022-05-16T13:45:36Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [June 8, 2022, 12:09pm UTC](https://discourse.slicer.org/t/extracting-coordinates-of-muscle-segmented-on-all-slices-from-mri-scans/23441/9 "2022-06-08T12:09:01Z")

</div>

If you have only two coordinates you should use something like appears on this post

> [@Center coordinates of volume slices?](https://discourse.slicer.org/t/center-coordinates-of-volume-slices/23133/8):
>
> Think I got it working (C++) by //---------------------------------------------------------------------- void GetBackgroundVolumeXYCenter(double slicePos[2]) { vtkMRMLSliceCompositeNode\* compositeNode = nullptr; compositeNode = vtkMRMLSliceCompositeNode::SafeDownCast(this-\>GetSliceNode()-\>GetScene()-\>GetFirstNodeByClass("vtkMRMLSliceCompositeNode")); const char\* backgroundVolumeID = compositeNode-\>GetBackgroundVolumeID(); double volumeBounds[6] = { 0.0 }; double volumeCente…

If you have 1 slice only you dhould add a 0 to the third coordinate

---

_[View the full topic](https://discourse.slicer.org/t/extracting-coordinates-of-muscle-segmented-on-all-slices-from-mri-scans/23441)._
