How is computed the Geometric Center of an Image

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

The image center (physical coordinates) is:

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