# Seeking Advice on Multi-Color Branching for Vascular Models

**URL:** <https://discourse.slicer.org/t/seeking-advice-on-multi-color-branching-for-vascular-models/36292>\
**Category:** Support\
**Tags:** segmentation, python, vmtk, 3d-model, vmtk-centerline\
**Created:** [May 21, 2024, 9:44am UTC](https://discourse.slicer.org/t/seeking-advice-on-multi-color-branching-for-vascular-models/36292 "2024-05-21T09:44:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![petit223](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@petit223](https://discourse.slicer.org/u/petit223)\
**Post date:** [May 21, 2024, 9:44am UTC](https://discourse.slicer.org/t/seeking-advice-on-multi-color-branching-for-vascular-models/36292/1 "2024-05-21T09:44:11Z")

</div>

Hello everyone,

I am currently working on a project where I aim to color different branches of a vascular model with distinct colors. I start by selecting a main vessel and use the first branching point as an anchor. From there, I want to apply different colors to three (or possibly more) branches. For this, I’ve been using the extract and centerline plugin, which has been incredibly helpful in identifying the necessary anchor points.

However, I’m at a bit of a standstill as I’m unsure how to apply colors to the surface of the vessels effectively. I would appreciate any suggestions or guidance from those who have tackled similar challenges. Any advice on techniques or tools that could be used for this purpose would be greatly appreciated.

Thank you for your help!

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/9/597285afb8f169edffa8b20787eb0f32efc1744c.png)  
（I drew a diagram to ensure that my above expression is clear）

---

<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:** [May 21, 2024, 10:24am UTC](https://discourse.slicer.org/t/seeking-advice-on-multi-color-branching-for-vascular-models/36292/2 "2024-05-21T10:24:16Z")

</div>

You may consider the ‘Branch clipper’ module in SlicerVMTK.

---

<div class="post-metadata">

**Author:** ![petit223](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@petit223](https://discourse.slicer.org/u/petit223)\
**Post date:** [May 21, 2024, 12:27pm UTC](https://discourse.slicer.org/t/seeking-advice-on-multi-color-branching-for-vascular-models/36292/3 "2024-05-21T12:27:17Z")

</div>

Thank you very much, I’m certain this is what I need. However, I have a small issue. For more fragmented models, the original anchor points are missing due to the model being divided into several segments (maybe calculi or space-occupying), making it impossible to extract the centerline. Do you have any suggestions on how to handle this?

---

<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:** [May 21, 2024, 1:18pm UTC](https://discourse.slicer.org/t/seeking-advice-on-multi-color-branching-for-vascular-models/36292/4 "2024-05-21T13:18:13Z")

</div>

> [@petit223](#):
>
> extract the centerline

> [@petit223](#):
>
> how to handle this

This question is quite different from the original.

I don’t really understand what you mean by ‘calculi, space-occupying’. The VMTK libraries called by the ‘Extract centerline’ module require good quality input. So your segmentation result is important, itself depending much on the quality of the original volume, in particular, the level of contrast available. I found that holes in the segmentation are very detrimental to centerline extraction. Fortunately, the ‘Smoothing’ effect of the ‘Segment editor’ has a ‘Fill holes’ functionality. Try that while looking for the most adequate settings of smoothing.

In general, providing pertinent images is helpful. At best, share your segmentation and your anonymized input volume as an MRB file. Guess work is not funny for the guys at the other end of the line.

---

<div class="post-metadata">

**Author:** ![petit223](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@petit223](https://discourse.slicer.org/u/petit223)\
**Post date:** [May 21, 2024, 2:56pm UTC](https://discourse.slicer.org/t/seeking-advice-on-multi-color-branching-for-vascular-models/36292/5 "2024-05-21T14:56:25Z")

</div>

I’m sorry for the inconvenience caused. In fact, this plugin aligns very well with my goals, but when I applied it to other segments, I encountered new problems. For this reason, I have divided the segment files I need to handle into two categories: Case A and Case B. Case A can be resolved very well, but Case B is where I encountered the new problems (That’s what I mentioned earlier, a missing section).

 ![无标题](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/e/0e13dce14970b04d9e884a204e615d8c40fbf772.png)

I understand what you mean. Indeed, my model after segmentation is not high-quality input for the ‘extract centerline’ plugin, but it is realistic. I agree that ‘Fill holes’ is one method.

---

<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:** [May 21, 2024, 3:08pm UTC](https://discourse.slicer.org/t/seeking-advice-on-multi-color-branching-for-vascular-models/36292/6 "2024-05-21T15:08:53Z")

</div>

In case B, ‘Fill holes’ won’t fill in the gap, that’s not what it’s meant to do. You should extract 3 distinct centerlines on 3 distinct segments. Why do you invest time in case B while case A is perfect?

---

<div class="post-metadata">

**Author:** ![petit223](https://avatars.discourse-cdn.com/v4/letter/p/e5b9ba/32.png) [@petit223](https://discourse.slicer.org/u/petit223)\
**Post date:** [May 29, 2024, 2:13pm UTC](https://discourse.slicer.org/t/seeking-advice-on-multi-color-branching-for-vascular-models/36292/7 "2024-05-29T14:13:31Z")

</div>

Sorry I just came back from a team equipment update. Actually, I deal with 3D reconstruction of magnetic resonance cholangiopancreatography. I will encounter the following situation:

> **[Pathological\_case.stl](https://drive.google.com/file/d/1G5_FOrOo_GbXJCx21v0VVYkOteBXnBJ5/view?usp=drive_link)**
>
> Google Drive file.
