Define field of view

Hello,

I developed a small simple module to open a VTK/VTU file and perform a series of calculations. Every time I open the file, I need to manually adjust the field of view (zoom and move to the center of the window viewer) for each of the red/yellow/green slice viewers. Is there a way (code) so that the views are automatically adjusted?

Thanks,
JJ

Hi - yes, just search the source code for FitSliceToAll. There are some variants and options.

1 Like

See also this example: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Center_the_3D_View_on_the_Scene

1 Like