Resizing slice view doesn't preserve field of view

Hi,

Let’s suppose I intensionally changed field of view in slice node:

sliceNode = layoutManager = slicer.app.layoutManager().sliceWidget('Red').sliceView().mrmlSliceNode()
sliceNode.SetFieldOfView(100, 300, 1)

and then I change slice view either by gragging QSplitter or by clicking on maximize button (on the picture) and apparently restores field of view to default.

Is this a drawback and the behaviour will be fixed in the future or it is done intensionally and to preserve my custom aspect ratio I need to hardcode my module?

image

The field of view needs to match the shape of the window, which can change when the layout changes. We can’t have the aspect ratio of the image change (it would distort the anatomy). So if you change the field of view in your custom code you will need to reset it when the layout changes.

2 Likes