# I have a centerline and Can I have a endoscopy with it

**URL:** <https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357>\
**Category:** Development\
**Created:** [January 14, 2019, 2:40pm UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357 "2019-01-14T14:40:35Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [January 14, 2019, 2:40pm UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/1 "2019-01-14T14:40:35Z")

</div>

I have a centerline and Can I get a endoscopy with it.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [January 14, 2019, 6:25pm UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/2 "2019-01-14T18:25:52Z")

</div>

There’s no particular interface for that right now - but if you create fiducials from some of the centerline points it should work.

---

<div class="post-metadata">

**Author:** ![wpgao](https://avatars.discourse-cdn.com/v4/letter/w/8e8cbc/32.png) [@wpgao](https://discourse.slicer.org/u/wpgao)\
**Post date:** [January 15, 2019, 1:32am UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/3 "2019-01-15T01:32:44Z")

</div>

The trajectory of the endoscopy is described using a list of fiducials. If you want to let the endoscopy move along it, you should represent the centerline with a list of fiducials!

---

<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:** [January 15, 2019, 4:38am UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/4 "2019-01-15T04:38:06Z")

</div>

There will be soon a markup “curve” node available soon (within 1-2 months), mostly based on current markup “fiducial” node, so representing curves using fiducials is the right way to go.

---

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [January 15, 2019, 5:33am UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/5 "2019-01-15T05:33:00Z")

</div>

OK, Thanks,  
And I get a “makeup” but with a wrong order. Can I change the order of points with CLI?  
 ![360%E6%88%AA%E5%9B%BE-181744937](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/7/b74082e99f0d698f4eccbbb52b9c4ecd3794daa8.jpeg)

---

<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:** [January 15, 2019, 5:51am UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/6 "2019-01-15T05:51:02Z")

</div>

There are a couple of options. CLIs can read/write markup lists, so you can make any changes.

MarkupsToModel extension contains code that can automatically reorder markups to make up the most reasonable curve.

---

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [January 15, 2019, 8:51am UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/7 "2019-01-15T08:51:14Z")

</div>

> **[SlicerMarkupsToModel/MarkupsToModel at master · SlicerIGT/SlicerMarkupsToModel](https://github.com/SlicerIGT/SlicerMarkupsToModel/tree/master/MarkupsToModel)**
>
> master/MarkupsToModel

I just studied python myself, but the above code of MarkupsToModel seems not python language…

My fiducials generated from extra-skeleton with a reverse order not suitable for endoscopy timer.  
so I went reorder just like the picture below（I need the right column from [C-1,C-2,C-3,] to [,C-3，C-2，C-1]）  
 ![360%E6%88%AA%E5%9B%BE20190115163846999](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/4/240c7911ac853dd6a351e7d2d5963fe933639c01.jpeg)

---

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [January 15, 2019, 8:56am UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/8 "2019-01-15T08:56:13Z")

</div>

Can I have a script to deal with that problem?

---

<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:** [January 15, 2019, 1:11pm UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/9 "2019-01-15T13:11:42Z")

</div>

Yes, of course. You can manipulate markups directly in Python (by modifying the MRML node), or by using Python-wrapped _Markups_ or _Markups to model_ module logic classes.

---

<div class="post-metadata">

**Author:** ![szhang](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@szhang](https://discourse.slicer.org/u/szhang)\
**Post date:** [June 15, 2020, 11:50am UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/10 "2020-06-15T11:50:11Z")

</div>

> [@pieper](#):
>
> if you create fiducials from some of the centerline points it should work.

Hello @pieper, to follow up on this topic, is there a way to convert centerline in the format of Surface Mesh (vtkpolydata) into markup fiducial points? Thank you!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 15, 2020, 3:53pm UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/11 "2020-06-15T15:53:43Z")

</div>

Hi @szhang - if you do the extraction to Markup Curves that will work with Endoscopy. What method did you use to create the vtkPolyData?

---

<div class="post-metadata">

**Author:** ![szhang](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@szhang](https://discourse.slicer.org/u/szhang)\
**Post date:** [June 15, 2020, 4:25pm UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/12 "2020-06-15T16:25:44Z")

</div>

Hi @pieper, I used VMTK to extract the centerline as vtkPolyData, which can be represented as Points in 3D Display, but then how to convert these points in vtkPolyData into 1) fiducial points to make curves or 2) directly into Markup Curves ?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 15, 2020, 5:28pm UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/13 "2020-06-15T17:28:21Z")

</div>

I see, yes, makes sense but I haven’t done it myself. @lassoan must have done that for his curve tree work.

---

<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:** [June 15, 2020, 6:03pm UTC](https://discourse.slicer.org/t/i-have-a-centerline-and-can-i-have-a-endoscopy-with-it/5357/14 "2020-06-15T18:03:55Z")

</div>

In latest SliverPreview releases, you have the option to specify output markups curve node. If you specify that node then you’ll get centerline as curve node(s) as well. You can use these curve nodes in endoscopy module to create flythrough videos.
