# How to change render window plane programmingly?

**URL:** <https://discourse.slicer.org/t/how-to-change-render-window-plane-programmingly/24111>\
**Category:** Support\
**Tags:** python, volume-rendering\
**Created:** [June 30, 2022, 6:44am UTC](https://discourse.slicer.org/t/how-to-change-render-window-plane-programmingly/24111 "2022-06-30T06:44:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![user4](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/user4/32/13172_2.png) [@user4](https://discourse.slicer.org/u/user4)\
**Post date:** [June 30, 2022, 6:44am UTC](https://discourse.slicer.org/t/how-to-change-render-window-plane-programmingly/24111/1 "2022-06-30T06:44:48Z")

</div>

Hi,all.  
I want to change the view plane in render window using python,as marked in red box here.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/6/9674a97cc1f045f4373fd36687ad90331ef70357.png)  
That is to say,If I click the P-A orientation,I can get a Coronal plane of the image, I want to use few lines of code to do that.Is there any interface in Script Repository I can use?  
Thank you in advance for your help!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 30, 2022, 8:39pm UTC](https://discourse.slicer.org/t/how-to-change-render-window-plane-programmingly/24111/2 "2022-06-30T20:39:16Z")

</div>

Here’s the recipe for solving this general class of problems is described here:

[https://slicer.readthedocs.io/en/latest/developer\_guide/python\_faq.html#how-to-find-a-python-function-for-any-slicer-features](https://slicer.readthedocs.io/en/latest/developer_guide/python_faq.html#how-to-find-a-python-function-for-any-slicer-features)

Give that a shot and let us know if you don’t find what you need.

---

<div class="post-metadata">

**Author:** ![user4](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/user4/32/13172_2.png) [@user4](https://discourse.slicer.org/u/user4)\
**Post date:** [July 1, 2022, 1:41am UTC](https://discourse.slicer.org/t/how-to-change-render-window-plane-programmingly/24111/3 "2022-07-01T01:41:39Z")

</div>

Thanks,pieper.  
I have tried,but still can not find the 3D pannel.What keywords in this case should I put in order to search on github repo?

---

<div class="post-metadata">

**Author:** ![qiqi5210](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/qiqi5210/32/15920_2.png) [@qiqi5210](https://discourse.slicer.org/u/qiqi5210)\
**Post date:** [July 1, 2022, 2:56am UTC](https://discourse.slicer.org/t/how-to-change-render-window-plane-programmingly/24111/4 "2022-07-01T02:56:49Z")

</div>

See slicer source code ` qMRMLThreeDViewControllerWidget.cxx`  
`slicer.app.layoutManager().threeDWidget('View1').threeDView().lookFromAxis(ctk.ctkAxesWidget.Posterior)`  
The above Python code can realize the functions you want.

---

<div class="post-metadata">

**Author:** ![user4](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/user4/32/13172_2.png) [@user4](https://discourse.slicer.org/u/user4)\
**Post date:** [July 1, 2022, 7:06am UTC](https://discourse.slicer.org/t/how-to-change-render-window-plane-programmingly/24111/5 "2022-07-01T07:06:02Z")

</div>

Thanks,Mary.  
You just saved me a lot of time.
