How to open .TRE file?

Dataset at “https://public.kitware.com/Wiki/TubeTK/Data” have “VascularNetwork.tre” file. How can i open this file using Python?

Hi @Duy_H,

Welcome to ITK! :sunny:

To read VascularNetwork.tre,

import itk

file_name = '/tmp/path/to/VascularNetwork.tre'

Dimension = 3
reader = itk.SpatialObjectReader[Dimension].New()
reader.SetFileName(file_name)
reader.Update()

tubes = reader.GetGroup()
print(tubes)