Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
Display Interaction is implemented as EventObservers that are registered as Microservices. This allows them to be queried and modified from anywhere in the code. Application scenarios are e.g. wanting to disable certain interaction during a task, to avoid any conflicting actions, or to adapt the behavior to a special tool that is selected. One example in the MITK Workbench are the measurement tools. They are designed to operate on a single slice, such that we do not want the user to move the cross-hair once he started a measurement. Once he finished the measurement the usual interaction should be restored. The following code demonstrates how this is done.
To change the mitk::DisplayActionEventBroadcast behavior, we first need to set up MicroService capabilities in the module by adding:
Furthermore, following includes are needed for the code snipped to work:
The first code snippet queries the us for the DisplayActionEventBroadcast and then exchanges its configuration for a minimal version, that does not allow cross-hair actions. The original configuration is stored in a member that allows restoration of the original behavior once we're done with our action.
To restore the old configuration, query the DisplayActionEventBroadcast again and then restore the saved configuration:
Member declaration: