# How to convert vascular segmentation result to “VascularNetwork.tre” file?

**URL:** <https://discourse.itk.org/t/how-to-convert-vascular-segmentation-result-to-vascularnetwork-tre-file/2949>\
**Category:** Algorithms\
**Created:** [April 15, 2020, 5:50pm UTC](https://discourse.itk.org/t/how-to-convert-vascular-segmentation-result-to-vascularnetwork-tre-file/2949 "2020-04-15T17:50:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TaoH](https://discourse.itk.org/user_avatar/discourse.itk.org/taoh/32/1374_2.png) [@TaoH](https://discourse.itk.org/u/TaoH)\
**Post date:** [April 15, 2020, 5:50pm UTC](https://discourse.itk.org/t/how-to-convert-vascular-segmentation-result-to-vascularnetwork-tre-file/2949/1 "2020-04-15T17:50:45Z")

</div>

Hello!  
I kown that TubeTK can convert “VascularNetwork.tre” file to vascular image. However, I want to convert a vascular segmentation result to the unbranched segments represented by centerline points and radius, like “VascularNetwork.tre” file.  
Do you have any advance for me? Thans a lot!  
Best Wishes,  
TaoH

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [April 15, 2020, 6:42pm UTC](https://discourse.itk.org/t/how-to-convert-vascular-segmentation-result-to-vascularnetwork-tre-file/2949/2 "2020-04-15T18:42:55Z")

</div>

@Stephen_Aylward might have some advice.

---

<div class="post-metadata">

**Author:** ![TaoH](https://discourse.itk.org/user_avatar/discourse.itk.org/taoh/32/1374_2.png) [@TaoH](https://discourse.itk.org/u/TaoH)\
**Post date:** [April 22, 2020, 5:18pm UTC](https://discourse.itk.org/t/how-to-convert-vascular-segmentation-result-to-vascularnetwork-tre-file/2949/3 "2020-04-22T17:18:17Z")

</div>

I think that this problem could be solved with TubeTK. Could you have any advice? Thanks! @Stephen_Aylward

---

<div class="post-metadata">

**Author:** ![Stephen\_Aylward](https://discourse.itk.org/user_avatar/discourse.itk.org/stephen_aylward/32/654_2.png) [@Stephen\_Aylward](https://discourse.itk.org/u/Stephen_Aylward)\
**Post date:** [September 29, 2020, 4:21am UTC](https://discourse.itk.org/t/how-to-convert-vascular-segmentation-result-to-vascularnetwork-tre-file/2949/4 "2020-09-29T04:21:55Z")

</div>

Hi,

Sorry for the delay in responding, but I just merged changes to TubeTK to support segmenting vessel models (centerlines and radii) from binary images of vessels. See  
[https://github.com/InsightSoftwareConsortium/ITKTubeTK/pull/31](https://github.com/InsightSoftwareConsortium/ITKTubeTK/pull/31)  
and the example, below, which was generated by the jupyter notebook in that merge.

 ![BinaryData](https://discourse.itk.org/uploads/default/original/2X/8/88af7c182c0da553696dcf646d9fb9b29b341cda.png) ![ExtractedVessels](https://discourse.itk.org/uploads/default/original/2X/3/387634aabf742f9be5f429e4622a05f78024ca71.png)

---

<div class="post-metadata">

**Author:** ![lisongang-PR](https://discourse.itk.org/user_avatar/discourse.itk.org/lisongang-pr/32/1858_2.png) [@lisongang-PR](https://discourse.itk.org/u/lisongang-PR)\
**Post date:** [November 14, 2024, 2:42am UTC](https://discourse.itk.org/t/how-to-convert-vascular-segmentation-result-to-vascularnetwork-tre-file/2949/7 "2024-11-14T02:42:36Z")

</div>

Hello, I used the code from the Jupyter Notebook example. I successfully obtained the result of `im1Dist`.

 ![image](https://discourse.itk.org/uploads/default/original/2X/5/57c27da2cf43283705c1586079c5480f07f37e75.jpeg)

But when running the following code, the program gets stuck. Why is this happening?

numSeeds = 200  
vSeg = ttk.SegmentTubes.New(Input=im1Dist)  
#vSeg.SetVerbose(True)  
vSeg.SetMinCurvature(0.0)  
vSeg.SetMinRoundness(0.0)  
vSeg.SetMinRidgeness(0.9)  
vSeg.SetMinLevelness(0.0)  
vSeg.SetRadiusInObjectSpace( 0.4 )  
vSeg.SetSeedMask( im1Dist )  
vSeg.SetSeedRadiusMask( im1Dist )  
vSeg.SetOptimizeRadius(False)  
vSeg.SetUseSeedMaskAsProbabilities(True)  
vSeg.SetSeedExtractionMinimumProbability(0.4)  
#vSeg.SetSeedMaskMaximumNumberOfPoints( numSeeds )  
vSeg.ProcessSeeds()
