I want to pre-select the background and foreground volumes manually. Like seen below, right now there are no volumes selected for the background and foreground layer.
I have tried the following methods but even after updating the view, the combo box value itself is not changed.
lm = slicer.app.layoutManager()
sliceWidget = lm.sliceWidget(‘Red’)
ForeCombo = findChild(sliceWidget, ‘ForegroundComboBox’)
ForeCombo.setCurrentNodeID(‘whole_mouse_80micron_ct’)
I have also tried directly modifying the slice widget like so:
red_logic = slicer.app.layoutManager().sliceWidget(“Red”).sliceLogic()
red_cn = red_logic.GetSliceCompositeNode()
red_logic.GetSliceCompositeNode().SetBackgroundVolumeID(slicer.util.getNode(‘dwi’).GetID())
Any help would be appreciated!