# Zoom out camera automatically to fit in the segment, how?

**URL:** <https://discourse.slicer.org/t/zoom-out-camera-automatically-to-fit-in-the-segment-how/17716>\
**Category:** Development\
**Created:** [May 20, 2021, 8:09pm UTC](https://discourse.slicer.org/t/zoom-out-camera-automatically-to-fit-in-the-segment-how/17716 "2021-05-20T20:09:16Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![NoobForSlicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/noobforslicer/32/10900_2.png) [@NoobForSlicer](https://discourse.slicer.org/u/NoobForSlicer)\
**Post date:** [May 22, 2021, 5:06am UTC](https://discourse.slicer.org/t/zoom-out-camera-automatically-to-fit-in-the-segment-how/17716/8 "2021-05-22T05:06:30Z")

</div>

Well I guess I have to figure out three more tasks:

1. Get slicer to understand the size and the shape of the viewport
2. Figure out how to call zoom function for red,green and yellow viewports. I found how to do it for the 3d Camera ([Zoom in or out via python interactor version 4.8.0 on MAC](https://discourse.slicer.org/t/zoom-in-or-out-via-python-interactor-version-4-8-0-on-mac/2254)). Considering the movement of Camera and zoom in/out in 3D world is signitifcantly different, I suppose different view/zoom in and out methods are used for red,green and yellow viewport.
3. Zoom in/out to get bounds of segment fit the viewport

To get this done correctly, I will have to spend some time

I will be reading more today and tomorrow and in the next week about this, try to figure it out…

---

_[View the full topic](https://discourse.slicer.org/t/zoom-out-camera-automatically-to-fit-in-the-segment-how/17716)._
