Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
To be able to record interactions activate Interaction Event Recorder in MITK-build cmake. The following table explains how to step-wise create an interaction sequence, which is necessary for developing interaction tests. The given example shows how the AddTool Segmentation Interaction Test was developed. For implementation examples refer to mitkToolInteractionTest.cpp or mitkPlanarFigureInteractionTest.cpp
Step | AddTool Segmentation Example |
---|---|
Load Image | MITK-Data/Pic3D.nrrd |
Do not scroll image slices before recording starts | - |
Activate Interaction | Click on Add in segmentation plugin |
Define output filename (be careful: plugin appends interactions to existing files) | SegmentationInteractor_AddTool.xml |
Start recording | Click on record symbol (red circle) in Event Recorder Plugin |
Perform Interaction | Draw a segmentation in the render window |
Stop recording | Click on stop symbol (red square) in Event Recorder Plugin |
Save record (<interaction>.xml) to your testing environment | MITK-Data/InteractionTestData/Interactions/SegmentationInteractor_AddTool.xml |
Save interaction result (Image, Surface, etc.) to your testing environment | InteractionTestData/ReferenceData/SegmentationInteractor_AddTool.nrrd |
In order to use interaction tests, the class mitk::InteractionTestHelper has to be used. The usage of this class is explained with an example of the SegmentationTool test. The TestHelper needs to know the location of the recorded interaction file. This is done by giving the filename to the constructor.
The InteractionTestHelper stores its own DataStorage. We want to use this DataStorage and provide all necessary DataNodes.
Let the InteractionTestHelper know about the relevant time step (particularly necessary with 4D images)
When everything is set up, the loaded Interaction can be played back.