Merry Christmas everyone.
I´ve made a function to init VR with a previously made ROI.
I want to have full interaction with Slicer VR module for advance use if i need it.
It looks like:
def InitVRDisplayNode(self):
volumeRenderingWidgetRep = slicer.modules.volumerendering.widgetRepresentation()
volumeRenderingWidgetRep.setMRMLVolumeNode(InputVolumeNode())
bonepreset = slicer.modules.volumerendering.logic().GetPresetByName(‘CT-AAA’)
volumeRenderingNode = slicer.mrmlScene.GetFirstNodeByName(‘VolumeRendering’)
volumeRenderingNode.GetVolumePropertyNode().Copy(bonepreset)
volumeRenderingNode.SetCroppingEnabled(1)
volumeRenderingNode.SetAndObserveROINodeID(RoiNode.GetID())
volumeRenderingNode.SetVisibility(1)
At this point, VR is visible but ROI changes do not crop VR and Slicer VR module do not interact with visible VR image.