Thank you very much for the helpful guidance regarding the property nodeTypes
. Based on your response and the answer that Csaba Pinter provided to the question raised by Thomas Dutrey titled Input segments in new module, I was able to implement two separate modules named VolumeSelector, SegmentSelector and RTBeamSelector.
As mentioned in the response, the key lines in the corresponding Python code files, VolumeSelector.py, SegmentSelector.py and RTBeamSelector.py, are the following lines, which determine the type of node in the Selector:
In the VolumeSelector.py file:
# input volume selector
#
self.inputSelector = slicer.qMRMLNodeComboBox()
self.inputSelector.nodeTypes = ( ("vtkMRMLScalarVolumeNode"), "" )
#self.inputSelector.addAttribute( "vtkMRMLScalarVolumeNode", "LabelMap", 0 )
self.inputSelector.selectNodeUponCreation = True
self.inputSelector.addEnabled = False
self.inputSelector.removeEnabled = False
self.inputSelector.noneEnabled = False
self.inputSelector.showHidden = False
self.inputSelector.showChildNodeTypes = False
self.inputSelector.setMRMLScene( slicer.mrmlScene )
self.inputSelector.setToolTip( "Pick the input to the algorithm." )
parametersFormLayout.addRow("Input Volume: ", self.inputSelector)
In the SegmentSelector.py file:
# input segment selector
#
self.inputSelector = slicer.qMRMLNodeComboBox()
self.inputSelector.nodeTypes = ( ("vtkMRMLSegmentationNode"), "" )
#self.inputSelector.addAttribute( "vtkMRMLSegmentationNode", "Segment", 0 )
self.inputSelector.selectNodeUponCreation = True
self.inputSelector.addEnabled = False
self.inputSelector.removeEnabled = False
self.inputSelector.noneEnabled = False
self.inputSelector.showHidden = False
self.inputSelector.showChildNodeTypes = False
self.inputSelector.setMRMLScene( slicer.mrmlScene )
self.inputSelector.setToolTip( "Pick the input to the algorithm." )
parametersFormLayout.addRow("Segment: ", self.inputSelector)
In the RTBeamSelector.py file:
# input RT beam selector
#
self.inputSelector = slicer.qMRMLNodeComboBox()
self.inputSelector.nodeTypes = ( ("vtkMRMLRTBeamNode"), "" )
#self.inputSelector.addAttribute( "vtkMRMLRTBeamNode", "RTBeam", 0 )
self.inputSelector.selectNodeUponCreation = True
self.inputSelector.addEnabled = False
self.inputSelector.removeEnabled = False
self.inputSelector.noneEnabled = False
self.inputSelector.showHidden = False
self.inputSelector.showChildNodeTypes = False
self.inputSelector.setMRMLScene( slicer.mrmlScene )
self.inputSelector.setToolTip( "Pick the input to the algorithm." )
parametersFormLayout.addRow("Beam: ", self.inputSelector)
Best regards.
Shahrokh