# Get individual control point from a combobox in a scripted module

**URL:** <https://discourse.slicer.org/t/get-individual-control-point-from-a-combobox-in-a-scripted-module/18468>\
**Category:** Development\
**Tags:** python, gui\
**Created:** [July 1, 2021, 8:25pm UTC](https://discourse.slicer.org/t/get-individual-control-point-from-a-combobox-in-a-scripted-module/18468 "2021-07-01T20:25:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yihao\_Liu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yihao_liu/32/11401_2.png) [@Yihao\_Liu](https://discourse.slicer.org/u/Yihao_Liu)\
**Post date:** [July 1, 2021, 8:25pm UTC](https://discourse.slicer.org/t/get-individual-control-point-from-a-combobox-in-a-scripted-module/18468/1 "2021-07-01T20:25:18Z")

</div>

How to select an individual control point from a combobox?

I attempted to do this by a qMRMLNodeComboBox, with its node type as “vtkMRMLMarkupsFiducialNode”. This can only allow selecting a node which contains multiple control points (or fiducials, I am not sure what to call it in Slicer’s term). Looking at the documentation, I don’t think there is a node type “vtkControlPoint” or something like this. [Slicer: vtkMRMLDisplayableNode Class Reference](http://apidocs.slicer.org/master/classvtkMRMLDisplayableNode.html)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 2, 2021, 3:44am UTC](https://discourse.slicer.org/t/get-individual-control-point-from-a-combobox-in-a-scripted-module/18468/2 "2021-07-02T03:44:02Z")

</div>

You can use the [qSlicerSimpleMarkupsWidget](http://apidocs.slicer.org/master/classqSlicerSimpleMarkupsWidget.html) to show a list of markup control points that the user can choose from. If you don’t need a node selector or adjust options then you can hide those parts.

```python
w = slicer.qSlicerSimpleMarkupsWidget()
w.setMRMLScene(slicer.mrmlScene)
w.setCurrentNode(getNode('F'))
w.setNodeSelectorVisible(False)
w.setOptionsVisible(False)
w.show()

```

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/4/64d2567fbe6de4381a8cbbcdbcdc26d4caad887a.png)

---

<div class="post-metadata">

**Author:** ![Yihao\_Liu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yihao_liu/32/11401_2.png) [@Yihao\_Liu](https://discourse.slicer.org/u/Yihao_Liu)\
**Post date:** [July 2, 2021, 5:49pm UTC](https://discourse.slicer.org/t/get-individual-control-point-from-a-combobox-in-a-scripted-module/18468/3 "2021-07-02T17:49:32Z")

</div>

Thanks for the answer. I am using qSlicerSimpleMarkupsWidget as a display of the individual control points, but in addition to this, I also wanted to have an option where the user can select a point and get the coordinate in the backend (in the scripted module code), for some other processing.

I wonder what do you mean by “… the user can choose from”? Does it mean when the user click on the list, once one control point is highlighted as shown in your picture, it can be received in the backend?

One possible solution I am trying is to just have a generic combobox, and list a bunch of numbers to the total number of the elements in the markup array, but obviously this is not very “elegant”, as people may say…

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 2, 2021, 6:16pm UTC](https://discourse.slicer.org/t/get-individual-control-point-from-a-combobox-in-a-scripted-module/18468/4 "2021-07-02T18:16:19Z")

</div>

You can connect the [currentMarkupsControlPointSelectionChanged](http://apidocs.slicer.org/master/classqSlicerSimpleMarkupsWidget.html#ac00084bd475a818296ca3a92b2922841) signal to a function in your module widget class to get notified when the user selects a control point.

---

<div class="post-metadata">

**Author:** ![Yihao\_Liu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yihao_liu/32/11401_2.png) [@Yihao\_Liu](https://discourse.slicer.org/u/Yihao_Liu)\
**Post date:** [July 2, 2021, 6:19pm UTC](https://discourse.slicer.org/t/get-individual-control-point-from-a-combobox-in-a-scripted-module/18468/5 "2021-07-02T18:19:01Z")

</div>

I see! Thanks a lot!
