Is it possible to update closed surface of a segment instead of removing closed surface when underlying vtkImageData is modified?

Hi,

I am trying to modify a segment by modifying the underlying binary label map (an instance of vtkImageData) in C++.

When modified() of vtkImageData is called, the closed surface of the segment is removed automatically.

Is it possible to update closed surface of a segment instead of removing closed surface when underlying vtkImageData is modified?

Thanks in advance,

Best regards,

Vincent

If you replace the entire content of the vtkImageData then the application has no idea what has changed, so you need to recreate the closed surface representation. If you use vtkSlicerSegmentEditorLogic::ModifySegmentByLabelmap then modifications will be the minimum necessary.