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

**URL:** <https://discourse.slicer.org/t/is-it-possible-to-update-closed-surface-of-a-segment-instead-of-removing-closed-surface-when-underlying-vtkimagedata-is-modified/45639>\
**Category:** Development\
**Created:** [December 30, 2025, 7:01am UTC](https://discourse.slicer.org/t/is-it-possible-to-update-closed-surface-of-a-segment-instead-of-removing-closed-surface-when-underlying-vtkimagedata-is-modified/45639 "2025-12-30T07:01:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://discourse.slicer.org/u/Vincent)\
**Post date:** [December 30, 2025, 7:01am UTC](https://discourse.slicer.org/t/is-it-possible-to-update-closed-surface-of-a-segment-instead-of-removing-closed-surface-when-underlying-vtkimagedata-is-modified/45639/1 "2025-12-30T07:01:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 30, 2025, 3:34pm UTC](https://discourse.slicer.org/t/is-it-possible-to-update-closed-surface-of-a-segment-instead-of-removing-closed-surface-when-underlying-vtkimagedata-is-modified/45639/2 "2025-12-30T15:34:58Z")

</div>

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.
