I am interested if there is some way to zoom in/out so that each segment whether big or small, fits right away into the view covering let’s say 70% of the viewport.
In other words, not to manually zoom in and out each time.
I hope this was not too weirdly expressed, but yeah the zoom should change so that the segment can be seen right away… instead of constantly zooming in and out to show it…
You need to implement a custom action for this (that you can put on the toolbar, in a subject hierarchy right-click menu action, and/or bind to a keyboard shortcut). In the implementation you would need to get the bounds of the segment very similarly how the center is computed in vtkMRMLSegmentationNode::GetSegmentCenter method.
Well I guess I have to figure out three more tasks:
Get slicer to understand the size and the shape of the viewport
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). 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.
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…