I want to convert the centerline network generated from the segmentations of the Circle of Willis into a graph data structure. Currently the only way to do it in vmtk is to use the ‘vmtknetworkextraction’ class to do so - VMTK network extraction. However, it required the input to be a surface file.
In my case, I have a centerline tree hierarchical structure already generated in slicer as shown.
I can use the .json files containing the centerline curve information to create a graph using the NetworkX library in Python. But is there a way to directly convert the Centerline model_1.vtk file into a graph using the connectivity information stored as an ordered dictionary?
I am using the following code to get numpy arrays from the vtk file.
# Using vmtk filename = 'Centerline model_1.vtk' centerlineReader = vmtkscripts.vmtkSurfaceReader() centerlineReader.InputFileName = filename centerlineReader.Execute() clNumpyAdaptor = vmtkscripts.vmtkCenterlinesToNumpy() clNumpyAdaptor.Centerlines = centerlineReader.Surface clNumpyAdaptor.Execute() numpyCenterlines = clNumpyAdaptor.ArrayDict
I get the following as an output:
What does ‘EdgeArray’ and ‘EdgePCoordarray’ mean here? How do they represent the edge connectivity of the 1D centerline tree?