HomePhabricator
Diffusion MITK 03cb15e10697

Fix invalid states of Segmentation View for certain selection scenarios

Description

Fix invalid states of Segmentation View for certain selection scenarios

Summary:

Overview

The essence of this change is that I refactored both On<...>SelectionChanged() methods
into a single method, resp. call this new common method from both methods.

Certain invalid view states could be achieved by fiddling around with multiple nodes
and different selections and the only reason for these invalid states was that
changes of selection were handled separately while (partly) neglecting the overall
selection situation.

Now, the whole selection situation is always assessed while it is ensured that
necessary state changes only occur when the selection(s) really changed.

While the checks did not change in principle, the code does not early out as much as
before anymore, giving it the chance to synchronize the tool manager with the members
of the view class for example. Therefore, it was ensured that the code is able to handle all
combinations of selection scenarios.

Additional effects

If a segmentation is selected without a reference image, the layer, label, and label set
widgets are kept enabled now since all actions of these widgets do not require a reference
image. Their purpose is solely to organize the internal data structure of a label set image.

There's also an additional warning now if the reference image is invisible. Before, only
an invisible segmentation triggered a warning.

Fixes T29353

Test Plan:
Load images and segmentations and heavily use the selection, layer, label, and label set
widgets on them as well as adding/removing nodes from the DataManager to check for invalid
states.

Reviewers: kalali, floca, O1 MITK Reviewer Group I

Reviewed By: floca, O1 MITK Reviewer Group I

Maniphest Tasks: T29353

Differential Revision: https://phabricator.mitk.org/D735

Details

Provenance
kislinskAuthored on Oct 17 2022, 2:11 AM
kislinskPushed on Oct 17 2022, 9:05 AM
Reviewer
O1: MITK Reviewer Group I
Differential Revision
Restricted Differential Revision
Parents
rMITK94c627cbe744: Show interpolation warning only with multiple labels
rMITK1df5a1490746: Improve New/Rename Label dialog
Branches
Unknown
Tags
Unknown
Tasks
T29353: [SEG] segmentation view ends up in invalid state if segmentations are loaded before images