# How to make a 3D screen selection for Markup ControlPoints?

**URL:** <https://discourse.slicer.org/t/how-to-make-a-3d-screen-selection-for-markup-controlpoints/27575>\
**Category:** Support\
**Tags:** python, markups-fiducials, module, screen-capture, extensions\
**Created:** [February 1, 2023, 2:36am UTC](https://discourse.slicer.org/t/how-to-make-a-3d-screen-selection-for-markup-controlpoints/27575 "2023-02-01T02:36:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunshine](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@sunshine](https://discourse.slicer.org/u/sunshine)\
**Post date:** [February 1, 2023, 2:36am UTC](https://discourse.slicer.org/t/how-to-make-a-3d-screen-selection-for-markup-controlpoints/27575/1 "2023-02-01T02:36:04Z")

</div>

Hello everyone,

I am working on my Python Scripted extension, trying to implement a rectangle (drawn by mouse) selection on the screen (3D Widget / Window) to select all the ControlPoints covered by the rectangle.

Could anyone share some ideas on what functions I should call, or what existing modules I can use to achieve this?

Thank you so much in advance!

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [February 1, 2023, 4:24am UTC](https://discourse.slicer.org/t/how-to-make-a-3d-screen-selection-for-markup-controlpoints/27575/2 "2023-02-01T04:24:58Z")

</div>

We have a tool, [MarkupEditor](https://github.com/SlicerMorph/Tutorials/tree/main/MarkupsEditor), that does something similar (by drawing closed curve Markup) as part of the SlicerMorph extension. I linked the tutorial.

The selection process (add/remove) can be improved. If you don’t want to rebuild from scratch, feel free to contribute to it…

> <https://github.com/SlicerMorph/SlicerMorph/blob/master/MarkupEditor/MarkupEditor.py>

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [February 1, 2023, 11:51am UTC](https://discourse.slicer.org/t/how-to-make-a-3d-screen-selection-for-markup-controlpoints/27575/3 "2023-02-01T11:51:53Z")

</div>

> [@muratmaga](#):
>
> We have a tool, [MarkupEditor](https://github.com/SlicerMorph/Tutorials/tree/main/MarkupsEditor), that does something similar (by drawing closed curve Markup) as part of the SlicerMorph extension. I linked the tutorial.

The [MarkupEditor](https://github.com/SlicerMorph/Tutorials/tree/main/MarkupsEditor) was just updated today with a bug fix, so I recommend downloading from the Github repository directly or installing from the extension manager after the next build (likely tomorrow).
