# Calculation of centroid using image dimension,image spacing and image origin.

**URL:** <https://discourse.slicer.org/t/calculation-of-centroid-using-image-dimension-image-spacing-and-image-origin/34619>\
**Category:** Development\
**Created:** [February 29, 2024, 5:55pm UTC](https://discourse.slicer.org/t/calculation-of-centroid-using-image-dimension-image-spacing-and-image-origin/34619 "2024-02-29T17:55:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebin1234](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ebin1234/32/70096_2.png) [@ebin1234](https://discourse.slicer.org/u/ebin1234)\
**Post date:** [February 29, 2024, 5:55pm UTC](https://discourse.slicer.org/t/calculation-of-centroid-using-image-dimension-image-spacing-and-image-origin/34619/1 "2024-02-29T17:55:55Z")

</div>

I have a doubt in calculation of centroid using image dimension,image spacing and image origin. After that I have to place the 3D view in the center and anterior position . The camera should focus on this centroid . I did it but I am not getting proper result. The image is not present in center, anterior position. Can you please help me to solve this problem?.
