I have several segmented tumors with catheters inserted to sample the biological environment. I know the shape and location of each catheter membrane. I want to sample this to determine what percentage of the membrane is in the tumor versus out of the tumor.
Using Slicer 4.10.1
N = slicer.util.getNodes('Segmentation').GetSegmentation()
B=Seg.GetSegmentRepresentation('Segment_1','Binary labelmap')
Gives me a vtkSegmentationCorePython.vtkOrientedImageData
object.
Using,
cell_ID=B.FindCell(point,...)
cell=B.GetCell(cell_ID)
for i in range(8):
pointValue+= weights[i]*pointData.GetValue(cell.GetPointId(i))
I can check for a given “point” on my membrane being within or without the segmented tumor.
However, the above predicts points that are offset from world coordinates by a consistent direction (scale invariant)…that varies between original volumes.
Exporting the above segmentation to a new labelmap (“Segmentation-label”) and sampling:
SegLabel=slicer.util.getNode('Segmentation-label')
B=SegLabel.GetImageData()
I am able to sample points and tell if they are within or without the segmented tumor.
Is there something I could do better to get the point-by-point segmentation label?