Converting Array of Points to Segmentation Node

Operating system: Windows
Slicer version: 5.6.1
Expected behavior: I am trying to programmatically create several segments within a file, to be passed into the Vascular Modelling Toolkit in order to extract the centerlines.
Actual behavior: I currently can create arrays for each vessel containing the location of every voxel within that particular vessel, but have not figured out how to convert this to a segmentation.

I saw that I could use a labelMapNode to create a segmentation, but am having trouble finding the best way to do this. Any advice on this matter would be greatly appreciated.

After a few hours of tinkering yesterday, I did manage to figure out how to achieve this. I ended up making an array matching the shape of the original volume, but making each vessel have a unique id (1-numOfVessels). After this, I created a new vtkMRMLLabelMapNode and used the method that updates the labelmap volume based on an array before porting that labelmap into a segmentation. Now I just need to figure out exactly how to pass these segmentations into VMTK and I should be looking good.

1 Like