SlicerIGT / SlicerMarkupsToModel

3D Slicer extension to create tube or closed surface model from markup fiducials
BSD 3-Clause "New" or "Revised" License
11 stars 10 forks source link

"Curve is a Loop" checkbox not working with Model input node #32

Closed AlexJaeger closed 2 years ago

AlexJaeger commented 2 years ago

Hello,

I am encountering an issue when I attempt to generate a Curve model when the Input Node is a Model.

Workflow:

  1. Import centerline model (attached centerline_model.vtk in zip file) of lung airway. This was generated with Slicer VMTK from a surface model. Centerline model.zip
  2. Using MarkupsToModel set Model type to "Curve", set Input node to "Centerline model" and ensure the "Curve is a loop" box is left unchecked. Remaining setting are left at their defaults.
  3. Curve is generated.

Problem: The endpoints of the generated model connect back to the beginning of the centerline curve (i.e. the trachea) even when the "Curve is a loop" checkbox is left unchecked. This results in the undesirable model shown below: image

Attempted fixes:

  1. Modifying the centerline by changing the location of the first trachael point of the line.
  2. This issue does not occur when the input node is of the MarkupFiducial type, in which case the "Curve is a loop" checkbox functions as intended.

Thank you

lassoan commented 2 years ago

The module creates a single tube from the input points (cell information is ignored, you don't even need to specify cells), therefore what you describe is the intended behavior. If you want to create a model that contains tubes instead of the centerline curve then you can type a few lines of script into the Python console that gets the polydata from the model, sets it as input in a vtkTubeFilter and create a model from the output. See relevant examples in the script repository. If you get stuck you can ask help on the Slicer forum.

AlexJaeger commented 2 years ago

Excellent, thanks you Andras for the quick reply.