# vtkImageReslice: how to make point in the center of output image

**URL:** https://discourse.vtk.org/t/vtkimagereslice-how-to-make-point-in-the-center-of-output-image/486
**Category:** Support
**Created:** [March 14, 2019, 9:34am UTC](https://discourse.vtk.org/t/vtkimagereslice-how-to-make-point-in-the-center-of-output-image/486 "2019-03-14T09:34:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![richardander](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/c6cbf5/32.png) [@richardander](https://discourse.vtk.org/u/richardander)
#### Post date: [March 14, 2019, 9:34am UTC](https://discourse.vtk.org/t/vtkimagereslice-how-to-make-point-in-the-center-of-output-image/486/1 "2019-03-14T09:34:48Z")

</div>

Hello,  
I am using vtkImageReslice to generate an image by resliceAxes which is created by a normal direction and passing a point . In the output image, I can define its size by SetOutputExtent.

my question is how to make the point always in the middle of output image.

Thank you!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [February 12, 2020, 8:47am UTC](https://discourse.vtk.org/t/vtkimagereslice-how-to-make-point-in-the-center-of-output-image/486/3 "2020-02-12T08:47:42Z")

</div>

Please try for yourself first and then share your code and screenshots.

---

<div class="post-metadata">

### Author: ![Ingmar](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/i/cc9497/32.png) [@Ingmar](https://discourse.vtk.org/u/Ingmar)
#### Post date: [August 26, 2021, 11:47pm UTC](https://discourse.vtk.org/t/vtkimagereslice-how-to-make-point-in-the-center-of-output-image/486/4 "2021-08-26T23:47:19Z")

</div>

I ended up with a workaround via

> imgReslice = vtk.vtkImageReslice()  
> imgReslice.AutoCropOutputOn()
> 
> ren = vtk.vtkRenderer()  
> ren.GetActiveCamera().Zoom(3)  
> ren.GetActiveCamera().SetFocalPoint(planeMatrix.GetElement(0,0), planeMatrix.GetElement(0,1), planeMatrix.GetElement(0,2))

Prb the better solution would be via SetOutputOrigin() (using the resliceorigin and the image extent somehow?), but I am unsure how to properly do that (ultimately the user should ideally not have to even think about that …)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [August 30, 2021, 10:05am UTC](https://discourse.vtk.org/t/vtkimagereslice-how-to-make-point-in-the-center-of-output-image/486/5 "2021-08-30T10:05:30Z")

</div>

please open your own topic.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [August 30, 2021, 10:05am UTC](https://discourse.vtk.org/t/vtkimagereslice-how-to-make-point-in-the-center-of-output-image/486/6 "2021-08-30T10:05:34Z")

</div>


