Constrain fiducials to surface

Hello,
I’m interested in making some improvements to the Markups Module, as discussed in this thread. I’m starting by looking at how to stick and slide fiducial points along a surface.

I’m new to Slicer so any suggestions or pointers would be welcome. @lassoan, I’d appreciate hearing any design ideas you have for this feature.

Thanks

Markups fiducials are displayed in 3D views using vtkAbstractPolygonalHandleRepresentation3D. By default, it uses vtkFocalPlanePointPlacer for converting 2D click position to 3D position (this class constrains point positions to a plane parallel to the focal plane), but using SetPointPlacer method of the representation, it should be possible to change the placer. For example, if you set a vtkPolyDataPointPlacer instance as placer then point positions will be constrained to selected polygonal actor. Model displayable manager should be able to provide polygonal actor corresponding to a model node.

1 Like

Thanks for your reply @lassoan. I’ve looked at the current implementation and would like to clarify how the handles are being used by the markups.

Would it be correct change the point placer of the handle created by vtkMRMLMarkupsFiducialDisplayableManager3D::CreateWidget or the handle of the Nth seed placed by vtkMRMLMarkupsFiducialDisplayableManager3D::SetNthSeed? If I understand correctly both are using vtkOrientedPolygonalHandleRepresentation3D and would be able to use the vtkPolyDataPointPlacer.

I started an experiment in this branch linked below. I didn’t use the vtkPolyDataPointPlacer approach, because we’d also like the method to work well on volume renderings and segmentations, etc. What I have almost works but not perfectly.