# Converting MarkupsCurve to MarkupsFiducial

**URL:** <https://discourse.slicer.org/t/converting-markupscurve-to-markupsfiducial/20246>\
**Category:** Support\
**Tags:** markups-fiducials, markups\
**Created:** [October 19, 2021, 6:23pm UTC](https://discourse.slicer.org/t/converting-markupscurve-to-markupsfiducial/20246 "2021-10-19T18:23:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmalexander](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@kmalexander](https://discourse.slicer.org/u/kmalexander)\
**Post date:** [October 19, 2021, 6:23pm UTC](https://discourse.slicer.org/t/converting-markupscurve-to-markupsfiducial/20246/1 "2021-10-19T18:23:43Z")

</div>

I’ve imported a brachytherapy treatment plan that includes a MarkupsCurve for each catheter. I’m looking to convert each of these into models (ultimately, individual segments).

I can copy and paste all the control points in a MarkupsFiducial list, one catheter at a time, which allows me to create a model for each catheter.

I feel there must be an easier way! Anyone have any ideas? Perhaps I’m missing a set of tools that helps with this.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [October 19, 2021, 7:27pm UTC](https://discourse.slicer.org/t/converting-markupscurve-to-markupsfiducial/20246/2 "2021-10-19T19:27:02Z")

</div>

It is a hack, not a real solution, but you can save Markupcurves as fcsv (not JSON) and reload them into the slicer. That way they will be loaded as MarkupFiducials.

Or you use the import/export tab to export as a table and reimport as a markupFiducial, though I don’t think this will be less work than copy/pasting.

Probably scripting is the way to go.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 20, 2021, 5:38am UTC](https://discourse.slicer.org/t/converting-markupscurve-to-markupsfiducial/20246/3 "2021-10-20T05:38:46Z")

</div>

I guess we don’t have a module for this because it is so simple to get a model/segmentation using the Python console:

```python
curveNode = getNode('OC')
segmentationNode = getNode('Segmentation')

# Create mesh using tube filter
tube = vtk.vtkTubeFilter()
tube.SetInputData(curveNode.GetCurveWorld())
# Customize the tube parameters (optional)
tube.SetRadius(10)
tube.SetNumberOfSides(30)
tube.CappingOn()

# Add it to a new model node...
slicer.modules.models.logic().AddModel(tube.GetOutputPort())

# ...or add it to a segmentation as a new segment
tube.Update()
segmentationNode.AddSegmentFromClosedSurfaceRepresentation(
  tube.GetOutput(), "catheter", [0.0,1.0,0.0])

```

This code could be quite easily added as a “Convert” or “Export/Import” section in Markups module. If you think this would help you then you can [submit a feature request](http://issues.slicer.org/).
