I have a large number of aorta segmentations (nifti masks), and I would like to figure out how to load each one and compute the largest diameter (aneurysm). It looks as if computing a Voronoi diagram using VMTK is an ideal solution, but I would like to write an extension to automatically load the segmentations from a folder, run the appropriate computations, and save the output. I would really appreciate it if someone could point me to any examples that I might start to learn from/adapt for this purpose.
From using the VMTK extension manually, I think the steps I would need to script are:
- Load the nifti mask as a volume (seemingly can’t be loaded as a segmentation without loading a corresponding volume as well)
- Apply a simple threshold to get a segmentation (mask will be 0 or 1)
- Simplify mesh/create model appropriate for VMTK processing
- Compute Voronoi diagram and centerlines
- Extract data as table(?) and/or save the largest diameter