I have a vtkSegmentation with vtkSegments. When I use the method CopySegmentFromSegmentation(segmentation, segmentId), the corresponding vtkSegment is copied and overlaps the existing vtkSegments in the original vtkSegmentation.
Is there a way to overwrite the existing vtkSegments when copying a new vtkSegment, instead of overlapping?
Copying is different operation than painting. It will not affect any existing segments. If you want to make all segments overwrite the segments before them in the segment list, you can flatten the segmentation into a single layer. If you want to keep overlapping segments and just make some segments overwrite others then you can use the “Logical operators” effect.