# How to determine the center point coordinates of the modeling area?

**URL:** https://discourse.slicer.org/t/how-to-determine-the-center-point-coordinates-of-the-modeling-area/22205
**Category:** Support
**Tags:** segmentation, python, 3d-model
**Created:** [February 28, 2022, 7:50am UTC](https://discourse.slicer.org/t/how-to-determine-the-center-point-coordinates-of-the-modeling-area/22205 "2022-02-28T07:50:33Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)
#### Post date: [March 1, 2022, 1:10am UTC](https://discourse.slicer.org/t/how-to-determine-the-center-point-coordinates-of-the-modeling-area/22205/2 "2022-03-01T01:10:34Z")

</div>

这个应该能够帮到你

> [@Centering on a segment from a script](https://discourse.slicer.org/t/centering-on-a-segment-from-a-script/6209/9):
>
> Using a custom extension is certainly a solution, but in the long term I would recommend developers to use Slicer core functions if available. Slicer-4.10 returning a swig pointer (such as \_000001bfd4897340\_p\_void) is a minor inconvenience. You can still access the values using the helper function below (in the nightly version the VTK hint is there so the position is directly returned as a Python tuple). def getListFromPointer(bufferPtr, scalarType=vtk.VTK\_DOUBLE, numberOfElements=3): """Con…

---

_[View the full topic](https://discourse.slicer.org/t/how-to-determine-the-center-point-coordinates-of-the-modeling-area/22205)._
