Why "closed curve" cannot generate Baffle model in Baffle Planner module?

Operating system: Ubuntu 18.04
Slicer version: self-build, Slicer 4.13.0
Expected behavior:
First I load a stl file, then I switch to “Markups” module, and draw a closed curve around the stl model. Then I switch to “Baffle Planner module”, and select the drawed closed curve as Input curve, and select “Create new Model as …”, then a surface will generate automatically.

But, If in Markups module, I select draw a closed curve, by selecting curve type to “Shortest distance on surface” and stl as Model Node. The closed curve drawed will attch on the stl model. Then when I switch to Baffle Planner module, and select the latest curve, and select “Create new Model as …” in Baffle modle, but there is no new Baffle model generated, and there exist no error and warnings in the output.

So, why the new baffle model cannot generate in this condition? How to solve this problem?

Above picture is baffle model generated in the first condition.

Above picture is generate failed in the second condition when I draw closed curve attach on the stl model.

Hi, @lassoan , could you help me explain, why the Baffle Model can’t generate automatically when I draw a closed curve attch on the stl model in the second picture.

Could you share the scene saved as an .mrb file? (upload somewhere and post the link here)

Thank you for reply.
I have uploaded the Slicer mrml file, and related stl, Baffle.vtk and so on, wrapped into a zip file, named: SurfaceCutDemo-0809.zip. Please down the zip file via: SurfaceCutDemo-0809.zip - Google Drive
Expect to your reply.

Thank you, the sample data set helped to understand the problem. The issue is that the “Shortest distance on surface” method connects mesh points and therefore the curve is very jagged and the points are very much out of plane, and so it is very hard to generate a triangulated surface for it (that is required for area measurement).

You can get a better-behaved, smooth curve if you keep curve type = spline, and you resample the control points on the surface using “Resample” section. You just need to make sure that the control points are evenly distributed along the vessel.

SlicerVMTK extension can compute diameter of the airways, it provides minimum inscribed sphere radius for all points of the centerline curve.

Recently @chir.set added true (free-form) cross-sectional area computation to “Centerline metrics” module in SlicerVMTK, which will be available from tomorrow for latest Slicer Preview Releases (and maybe latest Slicer Stable Release, too). There are a few things to improve, which may make the cross-section more accurate - you can track the status of these improvements here:

Thank you for your reply.
But when I change the curve type as ‘spline’, and use Resample section, and select
“Output node” as ‘Overwrite current node’,
“Constrain points to surface” to the loaded stl model.
And then I switch to Baffle Planner module, and select closed curve as Input curve, but when I select “Create new model” in the Baffle model. But no Baffle surface generate automaticlly.
So I think “the curve is too jagged to cause no Baffle surface generate” is not the main reason, maybe because the curve controlPoint or the connect line is inside the stl model.

attched zip file is mrml file stored. SurfaceCutDemo-0810.zip - Google Drive

We use two different approaches in Slicer for fitting closed surface on an arbitrary closed curve: “ProjectWarp” and “DiskWarp”. They are described here. Baffle planner uses DiskWarp, which is more tolerant to out-of-plane points, but only works for quasi-circular contours. Markups closed curves use “ProjectWarp”, which works for arbitrarily concave shapes, but more sensitive to contour points being out of plane.

If you find the surface computed by baffle planner appropriate then you can go to Models module and get the surface are in the Information section: