# How, from python-scritps, to trigger the click-function of "center of the 3D view on the scene"?

**URL:** <https://discourse.slicer.org/t/how-from-python-scritps-to-trigger-the-click-function-of-center-of-the-3d-view-on-the-scene/8181>\
**Category:** Support\
**Created:** [August 26, 2019, 6:34pm UTC](https://discourse.slicer.org/t/how-from-python-scritps-to-trigger-the-click-function-of-center-of-the-3d-view-on-the-scene/8181 "2019-08-26T18:34:44Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)\
**Post date:** [August 27, 2019, 12:44pm UTC](https://discourse.slicer.org/t/how-from-python-scritps-to-trigger-the-click-function-of-center-of-the-3d-view-on-the-scene/8181/8 "2019-08-27T12:44:06Z")

</div>

Hi Good morning, @lassoan  
Here I show what I do using screen shots:

1. load a grey image and its label-like image  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/e/7e46f825ab591d1d82303d813f279bf98824239c.png)
2. With a modified “segment Editor”, I use “threshold” to have segments from the label-like image.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/7/07d225eaf45560074875dddcc265c9d7a9fff2df.png)
3. Click “Show 3D”  
for the Step-3, I would like to see 3D-view ready for my movie right away after my clicking, but right now I do not see anything inside the view1 (3D). So have to (A) click that “Center the 3D view on the scene”  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/d/0d11786b8dfbd99e99452de4e5d4333e6cb53354.png)  
and then I have to (B) scroll the mouse middle-button to zoom-in to see my segments  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/b/0b2037f3b4bc1e94f509cf8f6ec67bbebf9f2dad.jpeg)  
So in my mind I would like to get (A) and (B) done by scripts. My question is how to get (A) and (B) using python codes.  
Thanks a lot.  
Best,  
Aiden

---

_[View the full topic](https://discourse.slicer.org/t/how-from-python-scritps-to-trigger-the-click-function-of-center-of-the-3d-view-on-the-scene/8181)._
