# Straighten the vessel segments in a network

**URL:** <https://discourse.slicer.org/t/straighten-the-vessel-segments-in-a-network/13456>\
**Category:** Support\
**Created:** [September 12, 2020, 7:25am UTC](https://discourse.slicer.org/t/straighten-the-vessel-segments-in-a-network/13456 "2020-09-12T07:25:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [September 12, 2020, 7:25am UTC](https://discourse.slicer.org/t/straighten-the-vessel-segments-in-a-network/13456/1 "2020-09-12T07:25:52Z")

</div>

Hi All,

I have got a network of blood vessels and I’m looking for ways to straighten each segment/branch in the network. I found some discussions on straightening single segments, I’m not sure if it is possible to straighten segments in a network.

Any suggestions on how to do this in Slicer, if possible, will be really helpful.

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [September 18, 2020, 4:10pm UTC](https://discourse.slicer.org/t/straighten-the-vessel-segments-in-a-network/13456/3 "2020-09-18T16:10:36Z")

</div>

This is a kind reminder

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [September 22, 2020, 12:48pm UTC](https://discourse.slicer.org/t/straighten-the-vessel-segments-in-a-network/13456/4 "2020-09-22T12:48:00Z")

</div>

Hi All,

I would like to know if this is possible in Slicer.

---

<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:** [September 22, 2020, 1:39pm UTC](https://discourse.slicer.org/t/straighten-the-vessel-segments-in-a-network/13456/5 "2020-09-22T13:39:40Z")

</div>

Yes, there are many ways to do this in Slicer. Since of course it is impossible to straighten an entire network (straightening one vessel segment determines how you need to warp the entire 3D space, so if you have multiple vessel segments then you would have contradicting space warping requirements), you need to tell us how you want your straightened network segments to be represented.

For example, @pieper worked recently on placenta vascular network flattening ([http://people.csail.mit.edu/abulnaga/publication/abulnaga-2019-placenta/abulnaga-2019-placenta.pdf](http://people.csail.mit.edu/abulnaga/publication/abulnaga-2019-placenta/abulnaga-2019-placenta.pdf)), if that’s what you are after. Or, you can straighten each vessel segment and concatenate them into an artificial tree. Or, you can design a template and register to that template using landmark points (e.g., specific vessel branching points).

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [September 22, 2020, 3:15pm UTC](https://discourse.slicer.org/t/straighten-the-vessel-segments-in-a-network/13456/6 "2020-09-22T15:15:18Z")

</div>

Hi @lassoan

Thanks a lot for the details.  
I’d like to do the following

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/a/4a6e3bec4e4525572cab1d066ac280309521503d.jpeg)

The image on the left has the curves that we generate after using the extract centerline module.  
For instance, the Network properties table returns the lengths of the centerline path in each branch  
of the blood vessel. I would like to convert these curves paths to straight lines shown in the right image. i.e the length of each line segment shown in the right will be equal to the centerline length/branch length computed from the left.

I had a look at the reference shared above. From what I understand the optimization algorithm flattens the entire 3D volume. But I am interested in straightening only the line segments ( i.e centerline curves displayed).

> [@lassoan](#):
>
> Or, you can straighten each vessel segment and concatenate them into an artificial tree. Or, you can design a template and register to that template using landmark points (e.g., specific vessel branching points).

Could you please explain a bit more on how to do this? I think I must proceed in this direction.

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [September 27, 2020, 4:24pm UTC](https://discourse.slicer.org/t/straighten-the-vessel-segments-in-a-network/13456/7 "2020-09-27T16:24:27Z")

</div>

@lassoan This is a kind reminder.

---

<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:** [September 28, 2020, 3:59am UTC](https://discourse.slicer.org/t/straighten-the-vessel-segments-in-a-network/13456/8 "2020-09-28T03:59:37Z")

</div>

What you show in the screenshot is not the same that you describe (in the screenshot, vessel branching points are simply connected with a straight line; length of vessel segments are not preserved). If you want to preserve vessel segment lengths then it makes the problem much harder! You might find solutions in scientific papers or in software libraries but there is a good chance that you need to implement it yourself. But probably it makes more sense to apply more commonly used analysis methods.

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [September 28, 2020, 6:06am UTC](https://discourse.slicer.org/t/straighten-the-vessel-segments-in-a-network/13456/9 "2020-09-28T06:06:38Z")

</div>

@lassoan

> [@lassoan](#):
>
> in the screenshot, vessel branching points are simply connected with a straight line; length of vessel segments are not preserved

Yes, I agree with your point. I was trying to find a way to preserve the lengths.

> [@lassoan](#):
>
> . But probably it makes more sense to apply more commonly used analysis methods.

By this are you referring to the centerline extraction results? Could you please clarify?

> [@lassoan](#):
>
> You might find solutions in scientific papers or in software libraries but there is a good chance that you need to implement it yourself.

I’ve been trying to use optimization. It’s not working unfortunately for large networks

---

<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:** [September 28, 2020, 1:32pm UTC](https://discourse.slicer.org/t/straighten-the-vessel-segments-in-a-network/13456/10 "2020-09-28T13:32:56Z")

</div>

> [@Deepa](#):
>
> > [@lassoan](#):
> >
> > . But probably it makes more sense to apply more commonly used analysis methods.
> 
> By this are you referring to the centerline extraction results? Could you please clarify?

I mean that you can research the scientific literature for papers that work on similar problems and try to use similar methods that they do.
