Hello, my name is Gabriel,
I am in my final year of engineering school and I am relatively new to ITK, VTK, and Slicer. I have a question regarding the functioning of segmentation zones and how they are determined.
I am working on a project for the semi-automatic segmentation of the pulmonary arteries in the lungs. For this, we have a RANSAC algorithm that fits cylinders to the vessels in the lungs and creates a list of points along the vessels’ trajectories. We also retain the radius of the cylinder for each point in the list.
Next, we want to create seeds for the grow-from-seed process. Therefore, we create a new segmentation, and for each point, we create a sphere inside it, slightly smaller than the radius of the corresponding cylinder. These spheres are then added to a vtkAppendPolyData.
Afterward, we add our segment (vtkAppendPolyData.GetOutput()) to our segmentation using AddSegmentFromClosedSurfaceRepresentation.
for pointIdx in range(len(points)):
sphere = vtk.vtkSphereSource()
sphere.SetCenter(points[pointIdx])
sphere.SetRadius(radius[pointIdx])
sphere.Update()
append.AddInputData(sphere.GetOutput())
append.Update()
self.segmentationNode.AddSegmentFromClosedSurfaceRepresentation(append.GetOutput(), segment_name, segment_color)
However, the result is disappointing:
It seems that the spheres are intersecting, creating peculiar holes when visualized in Slicer. I have tested visualizing by creating a mesh with Pyvista, and it works fine without these strange holes.
Do you know why this is happening and how I could fix it?
I think, it may be because some sphere intersect with each other and the algorithm that interpret weither or not it is a closed surface do It by counting each times it encounter an edge, but I’m unsure.
(Also, if you have any advice on how to better learn ITK, VTK, and Slicer, I would appreciate it.)