NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Architecture - MIDAS Morphological Editor

Introduction

The MIDAS Morphological editor has been implemented within NiftyView using

Class Overview

Figure 1 shows the class overview, and Figure 2 shows the initial view of the MIDAS Morphological Editor plugin.

ArchitectureMIDASMorphEditor.png
Figure 1. An overview of the main classes involved in the construction of the MIDAS Morphological Editor plugin.
ArchitectureMIDASMorphEditorTab1.png
Figure 2. The initial tab, showin the 4 stages of the process as a QTabbedWidget, the image selector and tool selector.

The MIDAS Morphological Editor is provided as an MITK plugin called MIDASMorphologicalSegmentorView derived from QAbstractView. The niftkBaseSegmentationView contains niftkMIDASImageAndSegmentationSelectorWidget providing the image selector and new segmentation button at the top of the plugin. niftkBaseSegmentationView also contains an MITK QmitkToolGUIArea and QmitkToolSelectionBox, and QmitkToolSelectionBox creates an mitk::ToolManager. These MITK classes are part of the MITK Segmentation Framework. To understand this plugin, you must read that paper.

The main GUI control is assembed in niftk::MorphologicalSegmentorView and comprises:

in that order. The GUI classes created in niftk::BaseSegmentatorView are also used in the niftk::GeneralSegmentorView, providing common functionality, look and feel for both plugins.

The GUI components use Qt signals and slots to call methods on niftk::MorphologicalSegmentorView. niftk::MorphologicalSegmentorView contains a niftk::MorphologicalSegmentorPipelineManager which itself contains a MorphologicalSegmentorPipelineInterface which is implemented by MorphologicalSegmentorPipeline using ITK. The whole plugin is essentially a Qt GUI, calling methods in niftk::MorphologicalSegmentorView which sets parameters on the ITK pipeline, which updates, and produces an output, which can be visualised using MITK and hence VTK as a binary image.

Pipeline Operation

The MIDAS Morphological Editor consists of 4 distinct phases: Thresholding, Erosions, Dilations and Rethresholding. This workflow can be seen in Figure 3, as 4 separate tabs that operate in sequence.

ArchitectureMIDASMorphEditorTabs.png
Figure 3. The MIDAS Morphological Editor consistes of 4 stages: Thresholding, Erosions, Dilations and Rethresholding, controlled by 4 tabs.

This workflow is directly mirrored by the ITK pipeline. Figure 4 shows the the ITK classes.

ArchitectureMIDASMorphEditorPipeline.png
Figure 4. The 4 stages of Thresholding, Erosions, Dilations and Rethresholding are directly mirrored in the ITK pipeline.

When the GUI is displaying the Thresholding tab, the pipeline is only updating itk::BinaryThresholdImageFilter and itk::MIDASMaskByRegionImageFilter. When the GUI is displaying the next 3 tabs, additional filters are added to the pipeline:

Pipeline Editing (Connection Breaker)

When the Erosions and Dilations tab are active, the user can edit the segmentation.

The editing is implemented using the MITK Segmentation Framework. The mitk::ToolManager can manage a number of tools that can be used to edit segmentations. In the case of the MIDAS Morphological Editor, the mitk::ToolManager registers 4 working data images, these are the Additions image and the Edits image for both Erosions and Dilations. This is slightly different to how the framework normally operates. The framework normally operates with a single working data, and the output image that the user is interested in is that single working data. In our case, the working data are 4 intermediate image that are used to influence the output of the ITK pipeline.

Furthermore, the MITK undo/redo framework is used so that the niftk::PaintbrushTool can undo and redo the edits.

Conclusion

The MIDAS Morphological Editor is re-implemented as a Qt GUI calling an ITK pipeline, delivered within an MITK plugin. Future researchers can easily add filters to the pipeline, easily add unit tests for these filters, and easily provide additional editing tools to provide more complex editing functionality as desired. The plugin is not designed to be infinitely extensible as by design it is for a very specific task.