Hi,
I have some ModelNodes from .vtk files attacked to lineartransforms.
With this code i get new segments for each model in segmentation but with wrong location.
How to fix segments position?
name = model.GetName()
abstransform = model.GetParentTransformNode().GetTransformFromParent()
applyTransform = vtk.vtkTransformPolyDataFilter()
applyTransform.SetTransform(abstransform )
applyTransform.SetInputData(model.GetPolyData())
applyTransform.Update()
surface = applyTransform.GetOutput()
# Remove point arrays to make sure they don’t affect display color
while surface.GetPointData().GetNumberOfArrays()>0:
surface.GetPointData().RemoveArray(0)
segmentation.AddSegmentFromClosedSurfaceRepresentation(surface, name, [1,1,1])