# Understanding UI Editing and Python File Generation in 3DSlicer with Qt Designer

**URL:** <https://discourse.slicer.org/t/understanding-ui-editing-and-python-file-generation-in-3dslicer-with-qt-designer/40369>\
**Category:** Development\
**Created:** [November 25, 2024, 4:45pm UTC](https://discourse.slicer.org/t/understanding-ui-editing-and-python-file-generation-in-3dslicer-with-qt-designer/40369 "2024-11-25T16:45:32Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![shahrokh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shahrokh/32/1499_2.png) [@shahrokh](https://discourse.slicer.org/u/shahrokh)\
**Post date:** [November 30, 2024, 7:44am UTC](https://discourse.slicer.org/t/understanding-ui-editing-and-python-file-generation-in-3dslicer-with-qt-designer/40369/6 "2024-11-30T07:44:06Z")

</div>

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](https://discourse.slicer.org/t/input-segments-in-new-module/5064), 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:

```auto
    # 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:

```auto
    # 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:

```auto
    # 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

---

_[View the full topic](https://discourse.slicer.org/t/understanding-ui-editing-and-python-file-generation-in-3dslicer-with-qt-designer/40369)._
