# How to calculate surface length with centerline project into surface

**URL:** <https://discourse.slicer.org/t/how-to-calculate-surface-length-with-centerline-project-into-surface/18747>\
**Category:** VMTK\
**Created:** [July 15, 2021, 10:58am UTC](https://discourse.slicer.org/t/how-to-calculate-surface-length-with-centerline-project-into-surface/18747 "2021-07-15T10:58:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![junqiangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/junqiangchen/32/11541_2.png) [@junqiangchen](https://discourse.slicer.org/u/junqiangchen)\
**Post date:** [July 15, 2021, 10:58am UTC](https://discourse.slicer.org/t/how-to-calculate-surface-length-with-centerline-project-into-surface/18747/1 "2021-07-15T10:58:31Z")

</div>

hi,i have centerline and centerlinesection,i want to calculate surfce line length,like this,green line is centerline and blue line is surface line,how to get this blue line?

 ![捕获1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/3/23843525fd5b06f08ac31240862a8ee085e5c0a7.jpeg)  
 ![捕获2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/0/10e9fa9f376e4ac1464a9ab71c47cd009e837485.jpeg)  
 ![捕获3](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/7/176087bc936c2b6a4ed7c6802da44410993fc1b4.jpeg)

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [July 15, 2021, 1:27pm UTC](https://discourse.slicer.org/t/how-to-calculate-surface-length-with-centerline-project-into-surface/18747/2 "2021-07-15T13:27:16Z")

</div>

How did you draw the blue line ? It you do it as a markups curve, the length is available in its properties.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [July 15, 2021, 1:37pm UTC](https://discourse.slicer.org/t/how-to-calculate-surface-length-with-centerline-project-into-surface/18747/3 "2021-07-15T13:37:22Z")

</div>

You may also resample a markups curve on the surface of a model as ‘Shortest distance on surface.’

---

<div class="post-metadata">

**Author:** ![AshvinGupta](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@AshvinGupta](https://discourse.slicer.org/u/AshvinGupta)\
**Post date:** [July 15, 2021, 3:18pm UTC](https://discourse.slicer.org/t/how-to-calculate-surface-length-with-centerline-project-into-surface/18747/4 "2021-07-15T15:18:16Z")

</div>

Hello, just wondering, did you update your Slicer and VMTK? My 3d Slicer was working fine however after updating it the centreline module does not work anymore so am beginning to think this might just be a problem on my end?

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [July 15, 2021, 9:55pm UTC](https://discourse.slicer.org/t/how-to-calculate-surface-length-with-centerline-project-into-surface/18747/5 "2021-07-15T21:55:31Z")

</div>

Please see [VMTK extract centerline fails with VMTK using VTK9](https://discourse.slicer.org/t/vmtk-extract-centerline-fails-with-vmtk-using-vtk9/18644)

---

<div class="post-metadata">

**Author:** ![junqiangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/junqiangchen/32/11541_2.png) [@junqiangchen](https://discourse.slicer.org/u/junqiangchen)\
**Post date:** [July 20, 2021, 7:18am UTC](https://discourse.slicer.org/t/how-to-calculate-surface-length-with-centerline-project-into-surface/18747/6 "2021-07-20T07:18:17Z")

</div>

this result get from Commercial medical analysis software

---

<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:** [July 20, 2021, 12:02pm UTC](https://discourse.slicer.org/t/how-to-calculate-surface-length-with-centerline-project-into-surface/18747/7 "2021-07-20T12:02:56Z")

</div>

The blue line is easy to get. You just need to iterate through all the curve points, and offset the curve point position by the radius in the binormal direction.

You can get the binormal direction from the cross product of the tangent vector of the curve and the normal vector of the curve. You can get the normal vector of the curve from the cross product of the previous and next tangent vectors.

---

<div class="post-metadata">

**Author:** ![junqiangchen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/junqiangchen/32/11541_2.png) [@junqiangchen](https://discourse.slicer.org/u/junqiangchen)\
**Post date:** [July 21, 2021, 4:15am UTC](https://discourse.slicer.org/t/how-to-calculate-surface-length-with-centerline-project-into-surface/18747/8 "2021-07-21T04:15:01Z")

</div>

thank you lassoan, i use centerline normal vector and centerlinesection maxdiamter to produce the line,and calculate the intersection points between line and surface,like this:

 ![图片1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/a/2a88796b7e8408f66b17a7917f189d67b693eeae.png)

---

<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:** [July 21, 2021, 11:51am UTC](https://discourse.slicer.org/t/how-to-calculate-surface-length-with-centerline-project-into-surface/18747/9 "2021-07-21T11:51:18Z")

</div>

Yes, intersection with a plane (therefore using the same position and normal) generates similar curves, too, if the vessel has one single strong curve and so the vessel remains in one plane. If you have multiple curves in different directions then the vessel deviates from the plane and the intersection curves do not capture well the vessel shape anymore.
