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

Introduction

The MIDAS Irregular Volume editor has been implemented within NiftyView using

At first glance the MIDAS Irregular Volume Editor may appear to be little more than an intensity based region growing algorithm with various drawing/erasing tools to edit the "current" segmented image. This is not the case. The editing is largely contour based, and only when a contour is "accepted" is it converted to voxel data, and stored within the segmented image. The contour based design makes it substantially different to other voxel based tools.

Class Overview

ArchitectureMIDASGeneralEditor.png
Figure 1. An overview of the main classes involved in the construction of the MIDAS Irregular Volume Editor plugin.

It can be seen from Figure 1, that the overall architecture or design of this plugin is similar in class structure to the MIDAS Morphological Editor. The class overview for MIDAS Morphological Editor and MIDAS Irregular Volume Editor are almost identical, and apart from the main class names such as MIDASMorphologicalSegmentorView and MIDASGeneralSegmentorView the structure is the same. In Figure 1, the ITK part refers to the region growing pipeline used when the intensity thresholding box is checked. In addition to this there are a large number of ITK functions that are called via the MITK ITK access macros. These represent a more procedural style of programming, and should be inspected on a case by case basis.

Seed, Draw and Poly Tools

The mitk::ToolManager has access to the following data sets, registered as "Working Data", as described in the MITK Segmentation Framework:

These datasets are operated upon by niftk::SeedTool, niftk::PolyTool and niftk::DrawTool.

ArchitectureMIDASGeneralEditorTools.png
Figure 2. Hierarchy of editing tools

It can be seen in Figure 2 that these derive from niftk::Tool. The Seed tool based functionality is:

However, the Right mouse click works regardless of which tool is selected. For this reason, the niftk::Tool has an mitk::PointSetInterfactor subclass that registers with mitk::GlobalInteraction when the tool is activated, and de-registers when de-actived. Thus each of niftk::DrawTool, niftk::PolyTool and niftk::SeedTool can add seeds. But it is only the niftk::SeedTool that can erase / move seeds. Also note that the seeds are defined at voxel locations, and editing works on a slice by slice basis. There may be many seeds on slices that are not visible, but these do not affect the current slice.

The niftk::MIDASDrawTool performs

These contours are added directly to WorkingData 2. niftk::ContourTool can signal when a contour has been updated, and the MIDASGeneralSegmentorView can register with that signal (implemented without Qt), to know when to update any region growing.

The niftk::PolyTool performs

The niftk::PolyTool maintains its own internal contour, which is rendered in yellow. When the user de-activates the tool, or activates another tool, the PolyLine is copied to the WorkingData 2 to join all other contours. For each left or middle click operation, the PolyTool signals to GeneralSegmentorView that it has performed an edit.

Intensity Thresholding (Region Growing)

The intensity based thresholding is performed using a simple region growing pipeline implemented in mitk::GeneralSegmentorPipeline.

This mitk::GeneralSegmentorPipeline is also used in 3D for Propagate Up/Down functionality, and also used to work out whether there are un-enclosed seeds. This can be performed by region growing without intensity limits, and checking if the edge of the image was hit.

Bulk Updates

The class MIDASGeneralSegmentorView contains a large number of additional updated. These are generally called via Qt signals and slots from the GUI widgets. For example when the "Propagate Up" button is pressed, a Qt signal calls back to MIDASGeneralSegmentorView, to perform the operation. The general scheme repeated throughout the class is

The image processing can be typically performed by a subclass of itk::ImageUpdateProcessor.

ArchitectureMIDASGeneralEditorProcessors.png
Figure 3. Hierarchy of Update Processors

.

These classes are purely ITK classes. The idea is that the base class itk::ImageUpdateProcessor provides methods so that you specify a destination image, and a region of interest. The class uses TemplateMethod to implement an ITK based Undo/Redo method. The region of interest is specified, and the itk::ImageUpdateProcessor takes a backup of the region of interest before it is edited. Derived classes then provide some way of editing it. For example, dervied classes may simply erase (itk::ImageUpdateClearRegionProcessor), or copy from another image (itk::ImageUpdateCopyRegionProcessor). The base class itk::ImageUpdateProcessor can then apply the change to Redo it, or copy back the back image to effect an Undo operation.

Conclusion

The MIDAS Irregular Volume Editor is more complex than the MIDAS Morphological Editor. This functionality can be seen as a combination of tools provided via the MITK Segmentation Framework and extra Qt widgets calling various update functions to affect the segmented image. The niftk::Tool subclasses are used to edit the contours, and the contours are then applied to update the image volume. This plugin can therefore be easily extended by providing different mitk::Tool subclasses. The additional Qt widgets call back to MIDASGeneralSegmentorView to provide bulk functionality such as Wipe, Wipe+, Wipe-, PropUp, PropDown, Prop3D etc. The GUI can be extended with more of this type of functionality, typically provided via ITK filters or ITK methods.