Disabling Surface Constraints Snap for Activated Markups Node

Hi, I am currently using 3D Slicer 5.8.0 and developing scripted modules. As part of my work, I would like to know if there is an option to disable the automatic snapping to surface constraints when a Markups node is activated. While working with Markups, I have noticed that the control points tend to snap to the nearest surface, which is affecting the intended placement of the points. I am looking for a way to prevent this behavior.

Additionally, as shown in the attached image, there is a polydata that follows the control points of the Markups. However, when moving the control points, they attempt to snap to the mesh surface, causing both the mesh and the control points to move closer in the Near Plane direction. This unintended snapping behavior is interfering with the expected positioning of the control points.

Could you please advise if there is a way to disable this feature, either through the UI or via scripting? Any guidance would be greatly appreciated.

Thank you for your time and support.

In the python console you can do:

model = getNode("ModelName")
model.SetSelectable(False)
2 Likes

SetSelectable prevents control points being snapped to the node, and you can also completely disable snapping for a markup in the Markups module GUI (Display / Advanced / 3D Display / Placement mode → unconstrained) or using Python scripting (modifying the markup display node properties). If you are defining curves on a surface then you can select a single model that the curve will snap to (anywhere on the surface), using Curve settings / Constrain to model.

After applying the solution, the markup nodes no longer snap to the model nodes that should be ignored. I truly appreciate your assistance in resolving the issue.

Thank you once again for your support.

2 Likes