# Get center of gravity of a segment

**URL:** <https://discourse.slicer.org/t/get-center-of-gravity-of-a-segment/4287>\
**Category:** Development\
**Created:** [October 4, 2018, 4:49pm UTC](https://discourse.slicer.org/t/get-center-of-gravity-of-a-segment/4287 "2018-10-04T16:49:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [October 4, 2018, 6:49pm UTC](https://discourse.slicer.org/t/get-center-of-gravity-of-a-segment/4287/4 "2018-10-04T18:49:06Z")

</div>

You can also use segmentation node’s [GetSegmentCenter](http://apidocs.slicer.org/master/classvtkMRMLSegmentationNode.html#a84bcb732330fc5a8efe74ef851cfbedb) or [GetSegmentCenterRAS](http://apidocs.slicer.org/master/classvtkMRMLSegmentationNode.html#aba8915642b3966206ad88980db489922) method. It works for both labelmap and closed surface representations. It is used for giving a position inside the segment (used when you right-click the segment and select “Jump slices”) and so it does not use center of gravity. If you need strictly center of gravity then you can have a look at the source code of this method and create a modified version.

---

_[View the full topic](https://discourse.slicer.org/t/get-center-of-gravity-of-a-segment/4287)._
