Implementing Widgets for Selecting Nodes of Type Segment and Beam

Hello Dear Developers and Users,

My question is probably very basic, so I would appreciate your guidance Or guide me on which tutorial I should refer to in order to implement functions for widgets that select nodes of different types, such as Beam, Segment, Volume, or Model.

I want to develop a module containing a widget for selecting one of the Beam nodes under the RTPlan node and a widget for selecting one of the Segment nodes under the Segmentation node. To do this, I created an Extension called moduleRTPlan in the Extension Wizard. Then, I added a module named BeamTry01 to moduleRTPlan. Next, I switched to the BeamTry01 module in the Example Category. At this stage, I clicked on Edit UI to enter the Qt Designer environment and removed all the default widgets that were created. Now, I have two questions:

  1. From the Slicer [MRML Widget] list, which widget is appropriate for a Beam node?

  2. I understand that to create a widget for selecting one of the Segments under the Segmentation node, I should use a widget named qMRMLSegmentSelectorWidget.

In the following figure, you can see that I used qMRMLSegmentSelectorWidget to select a Segment from the Segmentation node. To select a Beam from the available list for the RTPlan node, I used the ctkCollapsibleButton widget. However, unfortunately, the Segment selection widget is completely inactive, and the Beam selection widget does not show any Beams.

Please guide me.

Best regards.
Shahrokh

If you are creating a new module, your main module widget should be derived from qSlicerModule.

Then you must connect signal mrmlSceneChanged(vtkMRMLScene*) from your module widget to the slot setMRMLScene(vtkMRMLScene*) of widgets where you want to choose a node or a segment of ROI (see Signal/Slot editor in Qt Designer).

You can check ui files using Qt designer for example in the ExternalBeamPlanning module (/Resourses/UI/qSlicerExternalBeamPlanning.ui).

For qMRMLNodeComboBox widgets you should set a required types of nodes (vtkMRMLRTPlanNode or vtkMRMLRTBeamNode) you want to choose from.

Dear Mikhail Polkovnikov,

Thank you very much for your guidance. As mentioned in my issue titled Understanding UI Editing and Python File Generation in 3DSlicer with Qt Designer - Development - 3D Slicer Community, the roadmap I have set for myself is to familiarize with the implementation of the components of the widgets that I need to use in my module. Then, I should connect these components together in the way you suggested. Completing these steps is time-consuming for me, but I will do my best to complete them.
Best regards.
Shahrokh