Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
The overlays in MITK are a simple way to display additional information on the render windows. A class, deriving from mitk::Overlay represents an arbitrary 2D or 3D object that can be rendered as an overlay. This can for example be used for the annotation of 3D points or to overlay despriptions in the window corners. The mitk::OverlayManager is used to add the overlays to the renderwindows, updating them and manage the respective layout managers. The following features are implemented in this framework.
This exemplary overlay can render UTF-8 encoded text as a 2D Overlay. The Overlay2DLayouter can be used to automatically place a group of overlays to a specific corner.
This overlay displays labels in 3D coordinates. The labels always face the camera.
In order to integrate an Overlay into an mitk::Mapper, it is advised not to use the OverlayManager but to manually manage the Overlay. To do so, the update methods of the overlays have to be called manually before the start of each rendering procedure. It must only be called if the Properties have changed or if your custom overlay implements its own rendering mechanism.
A new custom Overlay should derive from mitkOverlay or one of the later mentioned subclasses VtkOverlay2D oder VtkOverlay3D. There should always be an implementation for the methods AddOverlay, RemoveOverlay and Update Overlay. UpdateOverlay is the procedure that is called in each rendering step. If the Overlay is rendered by VTK, this method only applies the properties to the representation. If the custom Overlay requires additional properties, they should be made accessible by getters and setters for a better usability:
VTK based overlays which are meant to be displayed in 2D over the render window should derive from the mitk::VtkOverlay2D. The mitk::VtkOverlay2D is a subclass of Vtk::Overlay, that uses VTK to render the overlay. This class creates the Overlay representation as a vtkActor2D, and is very easy to implement because only UpdateVtkOverlay2D and GetVtkActor2D have to be implemented. The add, update and remove methods are implemented in the superclasses. UpdateVtkOverlay2D only needs to apply the specific properties and GetVtkActor2D simply returns the created vtkActor.
The mitkVtkOverlay3D works just like mitkVtkOverlay2D, but it is designed for arbitrary 3D objects which derive from vtkProp,
A Layouter is used for an automatic positioning of a group of Overlays and is derived from mitkBaseLayouter. Every Layouter that manages a group of Layouts should have a unique identifier which is used to register the Layouter in the OverlayManager. A Layouter is always uniquely defined by the identifier and one BaseRenderer. Before a Layouter can be used by the OverlayManager it has to be added, using the AddLayouter Method. An Overlay can then be added to a Layout as follows:
A new Layouter has to implement PrepareLayout which should parse the internal Overlay list and set their position as required.