I’m trying to change slice view sizes as part of the setup of a custom layout. For instance:
def formatCustomLayout(self):
customLayout = ( XML code )
layoutNode = slicer.app.layoutManager().layoutLogic().GetLayoutNode()
customLayoutId = 500
layoutNode.AddLayoutDescription(customLayoutId, customLayout)
slicer.app.layoutManager().setLayout(customLayoutId)
slicer.app.layoutManager().sliceWidget('Long2').mrmlSliceNode().SetDimensions(100, 100, 1)
#end formatCustomLayout
A picture is attached, rather than including all the XML code for the custom layout. I didn’t see any property tags that set the initial size of the slice widgets.
What I’d like to do is make the height of L1 twice the height of L2, without having to manually adjust the slider between them. However, it seems that packing the MRML widget happens after the line where I set the dimensions.
How do I change the size of slice widgets within a layout from a script, or alternatively, specify relative size in XML property tags?
Thanks for any assistance.