Cropping mesh using landmark points

I used the model to model distance module to create the heat map displayed below to represent the difference between the mean shape of my sample and extreme shape at the positive end of a principal component from a Generalized Procrustes Analysis which I performed using the GPA module from the SlicerMorph extension. My problem is the heat map calculates the difference over the whole mesh, and I only want the heat map to display in the parts of the skull where I have points from the original GPA analysis (shown below).

I’m looking for a way to crop a mesh using the pseudo-landmark points I have labeled in green here so that I can then apply the heat map to only the part of the mesh on which I have points. I’ve tried different methods with the dynamic modeler module and currently the best option that I’ve come up with is to use 2 planes to crop out the parts of the mesh I don’t want to display (shown below), but this doesn’t look so great. I am planning to visualize the full model behind the new mesh so it at least looks like a fish head, but would also like a less choppy way to do this if possible.

Any suggestions appreciated!


1 Like

You should be able to use Dynamic modeler module’s Curve cut or Boundary cut tools to cut a surface with a curve that you draw on the surface. For this, you would need to copy your landmarks that are at the boundary into a new curve node as control points.

If you don’t want to construct a new curve then you can compute distance from your landmark points using vtkHausdorffDistancePointSetFilter then use vtkThreshold to extract the surface patch

You can also try to use Markups to model extension to convert your landmarks to a closed surface, use that closed surface with Surface to surface distance module, then finally extract the surface patch using vtkThreshold.

These require a few lines of Python scripting (get the polydata from a model node, run 1-2 VTK filters, and set the final result in a model node). There are examples in the script repository and you can ask here if you get stuck.

1 Like