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

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!

We have a tool, MarkupEditor, 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…

The MarkupEditor 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).