# How is computed the Geometric Center of an Image

**URL:** <https://discourse.itk.org/t/how-is-computed-the-geometric-center-of-an-image/3247>\
**Category:** Algorithms\
**Created:** [July 1, 2020, 7:50pm UTC](https://discourse.itk.org/t/how-is-computed-the-geometric-center-of-an-image/3247 "2020-07-01T19:50:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luis\_Carlos\_Carneiro](https://discourse.itk.org/user_avatar/discourse.itk.org/luis_carlos_carneiro/32/1486_2.png) [@Luis\_Carlos\_Carneiro](https://discourse.itk.org/u/Luis_Carlos_Carneiro)\
**Post date:** [July 1, 2020, 7:50pm UTC](https://discourse.itk.org/t/how-is-computed-the-geometric-center-of-an-image/3247/1 "2020-07-01T19:50:52Z")

</div>

Dear All,

Just for tuning. How is computed the geometric center of an image?  
For example, for one of the dimensions:  
DimX \>\> 1 (integer)  
float(DIMX -1)/2.0 (float or double)

Thanks,

Luis Gonçalves

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [July 1, 2020, 8:09pm UTC](https://discourse.itk.org/t/how-is-computed-the-geometric-center-of-an-image/3247/2 "2020-07-01T20:09:14Z")

</div>

The image center (physical coordinates) is:

```auto
image_center = image.TransformContinuousIndexToPhysicalPoint([(index-1)/2.0 for index in image.GetSize()])

```
