# How to avoid the holes caused by branch splitting, or repair it

**URL:** https://discourse.slicer.org/t/how-to-avoid-the-holes-caused-by-branch-splitting-or-repair-it/18582
**Category:** VMTK
**Created:** [July 8, 2021, 3:34pm UTC](https://discourse.slicer.org/t/how-to-avoid-the-holes-caused-by-branch-splitting-or-repair-it/18582 "2021-07-08T15:34:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![JunjieWu](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@JunjieWu](https://discourse.slicer.org/u/JunjieWu)
#### Post date: [July 8, 2021, 3:34pm UTC](https://discourse.slicer.org/t/how-to-avoid-the-holes-caused-by-branch-splitting-or-repair-it/18582/1 "2021-07-08T15:34:18Z")

</div>

I have something trouble in branch splitting of vascular bifurcation. Holes are created at the junction of the dividing lines, and i can’t use vmtksurfacecapper to fix it. How can i avoid it, or repair it ?

```auto
vmtkbranchclipper -ifile open_rmsh.vtp -centerlinesfile open_rmsh_clsp.vtp -ofile open_rmsh_sp.vtp --pipe \

```

 ![wanghuaxing_buquan_centerlines_GroupIds](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/4/4458f4c2433503a39ccd00b3d59fa815e958e372.png)  
 ![wanghuaxing_buquan分割效果](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/a/ba779feca8284c680fad6b7a01afc9f8f3c14ffc.png)  
 ![holes](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/2/b21318c4fa990cba04ce894fea50c6b1d188bbfc.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 11, 2021, 3:41pm UTC](https://discourse.slicer.org/t/how-to-avoid-the-holes-caused-by-branch-splitting-or-repair-it/18582/2 "2021-07-11T15:41:27Z")

</div>

Fixing self-intersections or non-manifold edges in a mesh is extremely difficult.

You can try various semi-automatic mesh cleaning tools in MeshMixer, MeshLab, Blender, etc.

Alternatively, you can convert the mesh to binary image and convert it back to mesh. You can do this in 3D Slicer:

- load the mesh as Segmentation (in Add data dialog, select “Segmentation” in Description column)
- in Segmentations module: create binary labelmap representation
- remove Closed surface representation
- create Closed surface representation
- export segmentation as surface mesh (in “Export to files” section)

---

<div class="post-metadata">

### Author: ![JunjieWu](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@JunjieWu](https://discourse.slicer.org/u/JunjieWu)
#### Post date: [July 14, 2021, 9:03am UTC](https://discourse.slicer.org/t/how-to-avoid-the-holes-caused-by-branch-splitting-or-repair-it/18582/3 "2021-07-14T09:03:55Z")

</div>

Thanks for your advice@lassoan  
I have been tried in 3D Slicer with your suggestion, and it indeed can repair the holes int the surface. However, the surface mesh totally changed, and the splitting lines of branch disappeared which is contrary to my original intention  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/7/f7ca489d563e651d22f9c1d8a5a737d4f2143227.png)  
I can manual repair holes with creating triangle in mesh tools. But it’s time-consuming. And mesh tools have difficult to identify the splitting results, usually identify the vascular as a whole.  
I need to try other way.

---

<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 14, 2021, 10:33pm UTC](https://discourse.slicer.org/t/how-to-avoid-the-holes-caused-by-branch-splitting-or-repair-it/18582/4 "2021-07-14T22:33:50Z")

</div>

Why do you need the branches to be split? What is your end goal?

---

<div class="post-metadata">

### Author: ![JunjieWu](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@JunjieWu](https://discourse.slicer.org/u/JunjieWu)
#### Post date: [July 15, 2021, 1:11am UTC](https://discourse.slicer.org/t/how-to-avoid-the-holes-caused-by-branch-splitting-or-repair-it/18582/5 "2021-07-15T01:11:07Z")

</div>

splitting vascular branch, forming multiple domains, statistical analysis of the calculation of different areas (WSS, TAWSS, OSI,etc), convenient for post-processing analysis.

---

<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 15, 2021, 2:57am UTC](https://discourse.slicer.org/t/how-to-avoid-the-holes-caused-by-branch-splitting-or-repair-it/18582/6 "2021-07-15T02:57:27Z")

</div>

What do you need the branch splitting for? So that you can compute average/min/max/percentiles of WSS, TAWSS, OSI for a vessel section? For that it should not matter that you have small errors in the mesh.
