HomePhabricator
Diffusion MITK 6a3ea89dafb4

Allow parallel use of segmentation and multilabel segmentation

Description

Allow parallel use of segmentation and multilabel segmentation

Summary:
(0) Remove unused classes so we do not need to adapt them for nothing

(1) Add context to ToolManagerProvider

This basically changes the artificial Singleton idiom to a key/value
registry.

Classic segmentation code should not need any adaption. Multilabel
segmentation should always add (the same) context.

(2) Add ToolManagerProvider context in multilabel segmentation classes

This allows the parallel use of segmentation and multilabel segmentation
tools. Even to an extent where, for example, one can activate both
"Add" tools at the same time and draw into different images at the same
time.

However, the current logic didn't expect that and it is now possible to
move into "invalid" state machine stack states. For example, activate both
"Add" tools, deactivate one of them and the cross hair will now move with
the cursor while drawing with the remaining active tool (this is supposed
to only happen in the global interaction).

Possible quick fix would be to only allow a single tool to be active at
a time. This was implemented before without the case in mind that there
might be more than a single ToolManager.

(3) Deactivate tools of *all* ToolManagers when activating another tool

This change will allow only a globally single tool at a time. Works
well with the current implementation of the legacy tool interaction
handling.

Ref T27046

Test Plan:

  • Extensive manual testing in GUI
  • Existing ToolManager unit tests should not break because of backwards compatibility

Reviewers: floca, O1 MITK Reviewer Group I

Reviewed By: floca, O1 MITK Reviewer Group I

Maniphest Tasks: T27046

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

Details