Page MenuHomePhabricator

[Segmentation] Undo/Redo does not work for many aspects of segmentation
Open, NormalPublic

Description

It is not hard to find undo/redo not doing what it is supposed to do while fiddling around with segmentation tools. We may want to assess the situation in detail before fixing it but I assume it is a bigger effort to get everything working with undo/redo. I add a few subtasks in regard to undo/redo, that I already found.

Event Timeline

In particular working with different groups seems to have impact on the amount of undo/redo shenanigans.

I assume that most problems stem from the following error/problem:

WriteSliceToVolume / DiffSliceOperation are not Group/Layer aware. Therefore DiffSliceOperation always returns the LabelSetImage instance which means that the Undo/Redo operation will always be done on the active layer (even if it is meant for another layer. To change that we would need to do the following

  1. Rework DiffSliceOperation to always return the needed GroupImage via DiffSliceOperation::GetImage.
  2. Therefore WriteSliceToVolume must be reworked so that the function also knows which labels are group is meant (and we should change them to only accept LabelSetImage*)
  3. Therefore WriteSliceToVolume must be reworked so that the function also knows which labels are group is meant (and we should change them to only accept LabelSetImage*)