# How to get the path between the root and a branch

**URL:** <https://discourse.vtk.org/t/how-to-get-the-path-between-the-root-and-a-branch/8157>\
**Category:** Development\
**Created:** [March 28, 2022, 12:45pm UTC](https://discourse.vtk.org/t/how-to-get-the-path-between-the-root-and-a-branch/8157 "2022-03-28T12:45:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lkuan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lkuan/32/6571_2.png) [@lkuan](https://discourse.vtk.org/u/lkuan)\
**Post date:** [March 28, 2022, 12:45pm UTC](https://discourse.vtk.org/t/how-to-get-the-path-between-the-root-and-a-branch/8157/1 "2022-03-28T12:45:58Z")

</div>

Hello Team,  
I have a centerline tree extracted from trachea. The centerline tree contains many discrete points. It can be visualized in the renderwindow correctly. The work I want to achieve is to build a path from the root to a branch. The root point and the branch point are known in advance. I consider it is not a difficulty problem. But I have not find an easy way to realize it.  
The centerline tree is saved in a vtp file. I guess that the vtp file contains points and connectionships. But I cannot find a appropriate vtk function to find the path from the root to a branch.

Thanks and kind regards!
