# how to control vtkResliceImageViewer via api

**URL:** https://discourse.vtk.org/t/how-to-control-vtkresliceimageviewer-via-api/3029
**Category:** Support
**Created:** [April 12, 2020, 5:29am UTC](https://discourse.vtk.org/t/how-to-control-vtkresliceimageviewer-via-api/3029 "2020-04-12T05:29:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![yuhuimoon](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/c6cbf5/32.png) [@yuhuimoon](https://discourse.vtk.org/u/yuhuimoon)
#### Post date: [April 12, 2020, 5:29am UTC](https://discourse.vtk.org/t/how-to-control-vtkresliceimageviewer-via-api/3029/1 "2020-04-12T05:29:50Z")

</div>

I have add **vtkResliceImageViewer** to my app and it works well. The reslice mode was set to **oblique**. The viewer can render nifti image and be controlled by mouse interaction.

![2020-04-12_133107](https://discourse.vtk.org/uploads/default/original/2X/9/9d3ca77b8842213a0f9888f36f6abf852c3db784.png)

Now I want to control the viewer via api. I’m able to set normal of the image plane in the viewer so the viewer can render changing images along the normal direction as the following code:

`viewer->getReslice()->SetNormal(normalArray);`

But I can not find any way to set image slice index/position, slice origion and some other parameters successfully. I’ll be very appreciated if someone give me some tips!
