New feature: draw curve on surface

In the latest 3D Slicer Preview Release, markup curves can now be drawn on surface of model nodes. This allows users to do measurements on surfaces or extract selected parts of a surface. By default, curve is created by connecting control points with the shortest path on surface, but optionally point scalar values can be used to make the curve attracted to certain points (e.g., ridge or valley points).

To try this, download Slicer Preview Release revision 28793 (or later), load a model, draw a curve, and set the curve type to “Shortest distance on surface” within the Markups module. The path between control points is calculated by minimizing the weighted distance. Weighting can be changed by using the cost function and distance weighting function options. If a control point is not on the surface then the closest point on the mesh is used instead.

Constraining curves is applicable not to just surfaces but to other geometries, such as bronchial or vascular trees (such as those created by VMTK):

In the near future, we plan to implement a module that can clip a model based on surface curves and planes.

For developers:
The relevant new functions in the vtkMRMLMarkupsCurveNode are:

  • SetCurveTypeToShortestDistanceOnSurface(vtkMRMLModelNode*)
  • SetSurfaceCostFunctionType(int)
  • SetSurfaceDistanceWeightingFunction(const char*)

Development was funded in part by CANARIE’s Research Software Program, OpenAnatomy, and Brigham and Women’s Hospital through NIH grant R01MH112748.


works perfectly … :blush: Thanks

1 Like

Great and perfect!!!

I imported STL binary file. I am using 4.11.0 version. I tried to draw lines. “Active Scalar” doesn’t show “curv” How can it be enabled?

Also another question. I want only export drawn lines as STL. Is that possible?

You need to load a mesh that has point scalars, or compute scalars yourself. You can use VTK filters to compute curvature, distances, etc.

I have similar question as oc34.

I have no visible active scalars for my 3D model, despite having curvature values per point. More specifically, I calculated surface curvature in MeshLab and exported it as PLY with saving curvature values per point as quality (property float quality). However, after importing PLY model into Slicer, no active scalars are visible.


Maybe the curvature is not saved in the PLY file or VTK’s PLY importer ignores additional arrays. Can you upload a sample PLY file somewhere that contains curvature and post the link here?

Note that you can compute curvature in Slicer by copy-pasting 3 lines of Python code into the Python console and if needed we can add a small module with a GUI, so there should be no need to use external software for such a simple operation.

Link to the sample 3D model in PLY file format (bunny) with curvature saved as quality from MeshLab -
Any suggestions how to overcome the import problems, would be very welcome.

Thanks. I didn’t know about possibility of calculating curvature in Slicer. Is it possible to calculate anything else the Gauss curvature? A small module with GUI with possibility of calculation of surface curvature would be amazing. With all four paramters, i.e., mean, Gauss, max, and min. Eventually, shape index and curvedness would be nice, too. But for a start basics would be plenty.



Are there any updates regarding calculating surface curvature in Slicer.

Thank you

It seems that VTK’s PLY reader only supports a set of predefined vertex properties. If you want VTK to read more then probably you need to implement it or contract a developer to do it for you.

VTK can compute mean, Gauss, max, and min curvatures - see documentation.

You can copy paste those few lines of code to the Python console in Slicer and if that is not convenient enough then you can create a very simple scripted module as explained in this tutorial.

Is there a methodological paper to cite when using weighed pathfinding by using shortest distance on surface & surface curvature in surface curve creation?


You can cite the paper that inspired the VTK implementation. Please always cite 3D Slicer as well (it helps us demonstrating impact when applying for continued grant funding for Slicer development, maintenance, and support).