Event when volume loading

Hi all,

I have create a box to select a volume to display :

self.inputFrame = qt.QFrame(self.displayCollapsibleButton)
self.inputFrame.setLayout(qt.QHBoxLayout())
self.displayFormLayout.addWidget(self.inputFrame)
self.inputSelectorDisp = qt.QLabel("Displayed Volume: ", self.inputFrame)
self.inputFrame.layout().addWidget(self.inputSelectorDisp)
self.inputSelectorDisp = slicer.qMRMLNodeComboBox(self.inputFrame)
self.inputSelectorDisp.nodeTypes = (("vtkMRMLScalarVolumeNode"), "")
self.inputSelectorDisp.addEnabled = False
self.inputSelectorDisp.removeEnabled = False
self.inputSelectorDisp.setMRMLScene(slicer.mrmlScene)
self.inputFrame.layout().addWidget(self.inputSelectorDisp)

I would like to know if it is possible to update it every time a new volume is loaded ? (I mean automaticaly selecting the last loaded volume). Maybe with an event every time a new volume is loaded ?

Thank you for your help,
Best

Thank you,
Best

Hi - Have a look at this example:

https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Show_volume_rendering_automatically_when_a_volume_is_loaded

2 Likes