diff --git a/Documentation/Doxygen/3-DeveloperManual/Concepts/Annotation.dox b/Documentation/Doxygen/3-DeveloperManual/Concepts/Annotation.dox index 0c7c4537b7..b75fbd7a25 100644 --- a/Documentation/Doxygen/3-DeveloperManual/Concepts/Annotation.dox +++ b/Documentation/Doxygen/3-DeveloperManual/Concepts/Annotation.dox @@ -1,123 +1,51 @@ /** -\page AnnotationPage Overlays and Annotations Concepts +\page AnnotationPage Annotation Concept \tableofcontents -\section AnnotationPage_Introduction Overlays and Annotations +\section AnnotationPage_Introduction Annotations -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. +The annotations in MITK are a simple way to display additional information on the render windows. A class, deriving from mitk::Annotation represents an arbitrary +2D or 3D object that can be rendered as an Annotation. This can for example be used for the annotation of 3D points or to Annotation despriptions in the window corners. +Instances of the MicroService mitk::AbstractAnnotationRenderer are used to add the annotations to the renderwindows, updating them and depending on their implementation, organize them in a layout. +This module contains implementations for mitk::AbstractAnnotationRenderer as well as mitk::Annotation. Currently, the following features are realized within the Annotation module.
    -
  1. Definition of graphical elements that can be displayed in the render windows. -
  2. It is possible to manage multiple elements in each window. -
  3. A single Overlay can be rendered on any number of available render windows. -
  4. 2D and 3D textelements are already defined in the Overlay module and are using VTK to create custom annotations. -
  5. The mitk::BaseLayouter interface enables the implementation of layout managers, to handle the placement of the overlays. +
  6. 2D and 3D textelements are already defined in the Annotation module and are using VTK to create custom annotations. +
  7. 2D and 3D annotations can be placed freely by providing a display position +
  8. 2D annotations can be placed in a layout, which organizes the annotations in the display corners.
- \section AnnotationPage_ArchitectureSection General Architecture -\dot -digraph linker_deps { - node [shape=record, fontname=Helvetica, fontsize=10]; - BR [ label="BaseRenderer" ]; - BL [ label="{BaseLayouter|+ArrangeOverlays()}" ]; - O [ label="{Overlay|-PropertyList|+RemoveOverlay(BaseRenderer*)\n+UpdateOverlay(BaseRenderer*)\n+RemoveOverlay(BaseRenderer*)}" ]; - OM [ label="{OverlayManager|+AddOverlay(Overlay*)\n+RemoveOverlay(Overlay*)}" ]; - TO [ label="TextOverlay" ]; - VTKO [ label="{vtkOverlay|#GetVtkActor()}" ]; - TO -> VTKO; - VTKO -> O; - OM -> O [style="dashed",label="manages"]; - OM -> BL [style="dashed"]; - OM -> BR [style="dashed"]; - BR -> OM [style="dashed"]; -} -\enddot - -The mitk::Overlay can be implemented using a custom rendering framework like VTK. In this diagram, the vtkOverlay is shown as the superclass for all Overlays which use the vtk framework for rendering. -The OverlayManager can be registered to several BaseRenderer instances in order to call the update method of each Overlay during the rendering phase of the renderer. -It also manages the respective Layouters which are used to manage the placement of a group of Overlays. - -\subsection AnnotationPage_OverlaySubsection Overlay - -The mitk::Overlay is an abstract class that can manage property lists like the mitk::DataNode and provides the interfaces to thr three methods -mitk::Overlay::AddOverlay, mitk::Overlay::UpdateOverlay and mitk::Overlay::RemoveOverlay. The subclasses of the mitk::Overlay have to implement these methods -in order to provide the functionallity of an overlay. There are already a few implementations of mitk::Overlay which are using VTK as a rendering -framework to display the Overlays. However the mitk::Overlay can also be implemented using OpenGL to draw the Overlay on the renderwindows. - -\subsection AnnotationPage_OverlayManagerSubsection OverlayManager - -The mitk::OverlayManager is the manager for a set of Overlays and the respective Layouters. -Before the manager can be used, all mitk::BaseRenderer have to be registered to the mitk::OverlayManager instance like this: - -\snippet OverlayExample.cpp CreateOverlayManager - -The mitk::OverlayManager can then be used anywhere in the program by fetching it as follows: - -\snippet OverlayExample.cpp GetOverlayManagerInstance - -All mitk::Overlay instances can now be added to the OverlayManager by calling mitk::OverlayManager::AddOverlay. - -\subsection AnnotationPage_LayouterSubsection Layouter - -In order to use Layouters for the positioning -of the Overlays, each Layouter object that has been created has to be added to an internal list in the OverlayManager: - -\snippet OverlayExample.cpp AddLayouter - -The mitk::OverlayManager::SetLayouter method can then be used to configure an Overlay to be positioned by a certain Layouter: - -\snippet OverlayExample.cpp SetLayouterToOverlay - -\subsection AnnotationPage_NotManagedSubsection Manually Managed Overlays -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. +The mitk::Annotation can be implemented using a custom rendering framework like VTK. In this diagram, the vtkAnnotation is shown as the superclass for all Annotations which use the vtk framework for rendering. +The AnnotationManager can be registered to several BaseRenderer instances in order to call the update method of each Annotation during the rendering phase of the renderer. +It also manages the respective Layouters which are used to manage the placement of a group of Annotations. -\section AnnotationPage_CustomOverlaySection Implement a Custom Overlay +\subsection AnnotationPage_AnnotationSubsection Annotation -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: -\code -void mitk::VtkOverlay3D::SetPosition3D(Point3D position3D, mitk::BaseRenderer *renderer) -{ - mitk::Point3dProperty::Pointer position3dProperty = mitk::Point3dProperty::New(position3D); - SetProperty("Position3D", position3dProperty,renderer); -} +The mitk::Annotation is an abstract class that can manage property lists like the mitk::DataNode and provides the interfaces to the methods +AddToBaseRenderer, AddToRenderer, RemoveFromBaseRenderer RemoveFromRenderer and Update. The subclasses of the mitk::Annotation have to implement these methods +in order to provide the functionallity of an Annotation. There are already a few implementations of mitk::Annotation which are using VTK as a rendering +framework to display the Annotations. In order to show an Annotation, it has to be registered as a MicroService. -mitk::Point3D mitk::VtkOverlay3D::GetPosition3D(mitk::BaseRenderer *renderer) -{ - mitk::Point3D position3D; - GetPropertyValue("Position3D", position3D, renderer); - return position3D; -} -\endcode +\subsection AnnotationPage_AnnotationRendererSubsection AbstractAnnotationRenderer -\subsection AnnotationPage_CustomVTK2DOverlaySubsection VTK 2D Overlay +The AbstractAnnotationRenderer is the base class for all types of AnnotationRenderers, which are used for the management of multiple annotations in a specific BaseRenderer. +For each BaseRenderer, an AnnotationRenderer is registerered as a MicroService, using the type and the renderer name as a unique identifier. This way it is possible to keep the Annotations for a specific BaseRenderer +even if this renderer is temporarilly not existent (e.g. when a RenderWindow was closed). -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. +Implementations of the AbstractAnnotationRenderer are using the us::ServiceTracker in order to manage all registered Annotations and to listen to the events which are thrown if a new Annotation is registered, +if an Annotation was unregistered or if it was modified. -\subsection AnnotationPage_CustomVTK3DOverlaySubsection VTK 3D Overlay +\subsubsection AnnotationPage_ManualPlacementAnnotationRendererSubsection ManualPlacementAnnotationRenderer -The mitkVtkOverlay3D works just like mitkVtkOverlay2D, but it is designed for arbitrary 3D objects which derive from vtkProp, +Using the ManualPlacementAnnotationRenderer, allows for a simple placement of Annotations. The Annotation manages its placement internally or using the Position2D / Position3D properties. -\section AnnotationPage_CustomLayouterSection Implement a Custom Layouter +\subsubsection AnnotationPage_LayoutAnnotationRendererSubsection LayoutAnnotationRenderer -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: +The LayoutAnnotationRenderer allows automatic placement in the RenderWindow corners and sorts the Annotations by a specified priority. -\code -overlayManager->SetLayouter(textOverlay.GetPointer(),mitk::Overlay2DLayouter::STANDARD_2D_TOPLEFT,axialRenderer); -\endcode +\subsection AnnotationPage_AnnotationUtilsSubsection AnnotationUtils -A new Layouter has to implement PrepareLayout which should parse the internal Overlay list and set their position as required. +mitk::AnnotationUtils is a collection of static convenience functions, for the registration of AnnotationRenderers and to request certain registered Annotations. */ diff --git a/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/MITKModuleManualsList.dox b/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/MITKModuleManualsList.dox index 97f0df66d1..9e69f81b3e 100644 --- a/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/MITKModuleManualsList.dox +++ b/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/MITKModuleManualsList.dox @@ -1,28 +1,29 @@ /** \page MITKModuleManualsListPage MITK Module Manuals \section MITKModuleManualsListPageOverview Overview The modules are shared libraries that provide functionality that can be used by developers. \section MITKModuleManualsListPageModuleManualList List of Module Manuals \li \subpage NavigationGeneralModulePage \li \subpage MitkOpenCL_Overview \li \subpage LegacyGLModule \li \subpage GeneratingDeviceModulesPage \li \subpage mitkPython_Overview \li \subpage USModulePage \li \subpage AnnotationModulePage \section MITKModuleManualsListPageAdditionalInformation Additional Information on Certain Modules \li \ref PlanarPropertiesPage \li \subpage DiffusionImagingPropertiesPage \li \subpage ConnectomicsRenderingPropertiesPage \section MITKMigrationGuides Migration Guides \li \subpage InteractionMigration \li \subpage GeometryMigration + \li \subpage OverlayMigration */ diff --git a/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/OverlayMigration.dox b/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/OverlayMigration.dox new file mode 100644 index 0000000000..2f3abc81bd --- /dev/null +++ b/Documentation/Doxygen/3-DeveloperManual/Toolkit/ModuleManuals/OverlayMigration.dox @@ -0,0 +1,37 @@ +/** + +\page OverlayMigration Migration Guide from Overlays to the new Annotation concept + +\tableofcontents + +\section Howto How to adapt your code +All classes have been renamed from "Overlay" to "Annotation", e.g. the mitk::TextOverlay2D is now mitk::TextAnnotation2D. Most of the interface of mitk::Overlay remains unchanged in +mitk::Annotation, but it is no longer registered at the mitk::OverlayManager. Instead, mitk::ManualPlacementAnnotationRenderer and mitk::LayoutAnnotationRenderer are used the register an annotation. + +\code + // Old Overlay registration: + overlayManager->AddOverlay(textOverlay3D.GetPointer(), renderer); +\endcode +\code + // New Annotation registration: + mitk::ManualPlacementAnnotationRenderer::AddAnnotation(textAnnotation3D, renderer); +\endcode + +A single mitk::Annotation is no longer automatically registered in all available RenderWindows. Each mitk::Annotation is shown only once. The user is also responsible for the memory management. +When a created mitk::Annotation has no more SmartPointer references, it disappears. + +The Layouter concept was implemented in the mitk::LayoutAnnotationRenderer: +\code + // Old way to layout an mitk::Overlay: + verlayManager->AddOverlay(textOverlay.GetPointer()); + overlayManager->AddLayouter( + mitk::Overlay2DLayouter::CreateLayouter(mitk::Overlay2DLayouter::STANDARD_2D_TOPLEFT(), renderer2D).GetPointer()); + overlayManager->SetLayouter(textOverlay.GetPointer(), mitk::Overlay2DLayouter::STANDARD_2D_TOPLEFT(), renderer2D); +\endcode +\code + // New way to layout an mitk::Annotation: + mitk::LayoutAnnotationRenderer::AddAnnotation(textAnnotation, rendererID, mitk::LayoutAnnotationRenderer::TopLeft, 5, 5, 1); + // The layouter gets parameters for margins and the priority for the placement in the RenderWindow corners. +\endcode + +*/ diff --git a/Examples/Annotation/AnnotationExample.cpp b/Examples/Annotation/AnnotationExample.cpp index 3afda5b89d..a419c4bef3 100644 --- a/Examples/Annotation/AnnotationExample.cpp +++ b/Examples/Annotation/AnnotationExample.cpp @@ -1,145 +1,147 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkRegisterClasses.h" #include "QmitkRenderWindow.h" #include #include #include #include #include #include #include #include #include //##Documentation //## @brief Load image (nrrd format) and display it in a 2D view int main(int argc, char *argv[]) { QApplication qtapplication(argc, argv); if (argc < 2) { fprintf(stderr, "Usage: %s [filename] \n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str()); return 1; } // Register Qmitk-dependent global instances QmitkRegisterClasses(); mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New(); // Load datanode (eg. many image formats, surface formats, etc.) mitk::IOUtil::Load(argv[1], *ds); // Create a RenderWindow QmitkRenderWindow renderWindow; // Tell the RenderWindow which (part of) the datastorage to render renderWindow.GetRenderer()->SetDataStorage(ds); // Initialize the RenderWindow mitk::TimeGeometry::Pointer geo = ds->ComputeBoundingGeometry3D(ds->GetAll()); mitk::RenderingManager::GetInstance()->InitializeViews(geo); // mitk::RenderingManager::GetInstance()->InitializeViews(); // Add Overlays //![TextAnnotation2D] // Create a textAnnotation2D mitk::TextAnnotation2D::Pointer textAnnotation = mitk::TextAnnotation2D::New(); textAnnotation->SetText("Test!"); // set UTF-8 encoded text to render textAnnotation->SetFontSize(40); textAnnotation->SetColor(1, 0, 0); // Set text color to red textAnnotation->SetOpacity(1); // The position of the Annotation can be set to a fixed coordinate on the display. mitk::Point2D pos; pos[0] = 10; pos[1] = 20; textAnnotation->SetPosition2D(pos); std::string rendererID = renderWindow.GetRenderer()->GetName(); + // The LayoutAnnotationRenderer can place the TextAnnotation2D at some defined corner positions mitk::LayoutAnnotationRenderer::AddAnnotation( textAnnotation, rendererID, mitk::LayoutAnnotationRenderer::TopLeft, 5, 5, 1); + //![TextAnnotation2D] - //! [TextAnnotation3D] + //![TextAnnotation3D] mitk::PointSet::Pointer pointset = mitk::PointSet::New(); // This vector is used to define an offset for the annotations, in order to show them with a margin to the actual // coordinate. mitk::Point3D offset; offset[0] = .5; offset[1] = .5; offset[2] = .5; // save references to Annotations so that they do not get deregistered std::vector annotationReferences; // Just a loop to create some points for (unsigned long i = 0; i < 10; i++) { // To each point, a TextAnnotation3D is created mitk::TextAnnotation3D::Pointer textAnnotation3D = mitk::TextAnnotation3D::New(); mitk::Point3D point; point[0] = i * 20; point[1] = i * 30; point[2] = -i * 50; pointset->InsertPoint(i, point); textAnnotation3D->SetText("A Point"); // The Position is set to the point coordinate to create an annotation to the point in the PointSet. textAnnotation3D->SetPosition3D(point); // move the annotation away from the actual point textAnnotation3D->SetOffsetVector(offset); annotationReferences.push_back(textAnnotation3D); mitk::ManualPlacementAnnotationRenderer::AddAnnotation(textAnnotation3D, rendererID); } // Get the MicroserviceID of the registered textAnnotation std::string serviceID = textAnnotation->GetMicroserviceID(); // The AnnotationUtils can retrieve any registered annotations by their microservice ID mitk::Annotation *annotation = mitk::AnnotationUtils::GetAnnotation(serviceID); // This way, it is possible to change the properties of Annotations without knowing their implementation annotation->SetText("changed text!"); // also show the created pointset mitk::DataNode::Pointer datanode = mitk::DataNode::New(); datanode->SetData(pointset); datanode->SetName("pointSet"); ds->Add(datanode); //! [TextAnnotation3D] renderWindow.show(); renderWindow.resize(256, 256); renderWindow.show(); renderWindow.resize(256, 256); // cleanup: Remove References to DataStorage. This will delete the object ds = NULL; } /** \example Step1.cpp */ diff --git a/Modules/Annotation/doc/doxygen/AnnotationModule.dox b/Modules/Annotation/doc/doxygen/AnnotationModule.dox index a64d4ad74a..962d3a73b0 100644 --- a/Modules/Annotation/doc/doxygen/AnnotationModule.dox +++ b/Modules/Annotation/doc/doxygen/AnnotationModule.dox @@ -1,79 +1,61 @@ /** \page AnnotationModulePage Annotation Module \tableofcontents \section AnnotationModulePage_Introduction Annotations The annotations in MITK are a simple way to display additional information on the render windows. A class, deriving from mitk::Annotation 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. +2D or 3D object that can be rendered as an Annotation. This can for example be used for the annotation of 3D points or to Annotation despriptions in the window corners. Instances of the MicroService mitk::AbstractAnnotationRenderer are used to add the annotations to the renderwindows, updating them and depending on their implementation, organize them in a layout. This module contains implementations for mitk::AbstractAnnotationRenderer as well as mitk::Annotation. Currently, the following features are realized within the Annotation module.
  1. 2D and 3D textelements are already defined in the Annotation module and are using VTK to create custom annotations.
  2. 2D and 3D annotations can be placed freely by providing a display position
  3. 2D annotations can be placed in a layout, which organizes the annotations in the display corners.
-\section AnnotationModulePage_UsageSection Usage of Predefined Overlays +\section AnnotationModulePage_UsageSection Usage of Predefined Annotations \subsection AnnotationModulePage_TextWidget2DUsageSubsection mitkTextAnnotation2D -This exemplary overlay can render text as a 2D Overlay. The Overlay2DLayouter can be used to automatically place a group of overlays to a -specific corner. -\snippet OverlayExample.cpp TextOverlay2D -\snippet OverlayExample.cpp SetLayouterToOverlay +This exemplary Annotation can render text as a 2D Annotation which can be placed with the LayoutAnnotationRenderer +\snippet AnnotationExample.cpp TextAnnotation2D -\subsection AnnotationModulePage_TextWidget3DUsageSubsection mitkTextOverlay3D -This overlay displays labels in 3D coordinates. The labels always face the camera. +\subsection AnnotationModulePage_TextWidget3DUsageSubsection mitkTextAnnotation3D +This Annotation displays labels in 3D coordinates. The labels always face the camera. -\snippet OverlayExample.cpp TextOverlay3D +\snippet AnnotationExample.cpp TextAnnotation3D -\subsection AnnotationModulePage_NotManagedSubsection Manually Managed Overlays -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. +\section AnnotationModulePage_CustomAnnotationSection Implement a Custom Annotation -\section AnnotationModulePage_CustomOverlaySection Implement a Custom Overlay - -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: +A new custom Annotation should derive from mitkAnnotation or one of the later mentioned subclasses VtkAnnotation2D oder VtkAnnotation3D. There should always be an implementation for the methods +AddToBaseRenderer, AddToRenderer, RemoveFromBaseRenderer RemoveFromRenderer and Update. +UpdateAnnotation is the procedure that is called when the Annotation properties have changed. If the Annotation is rendered by VTK, this method only applies the properties to the representation. +If the custom Annotation requires additional properties, they should be made accessible by getters and setters for a better usability: \code -void mitk::VtkOverlay3D::SetPosition3D(Point3D position3D, mitk::BaseRenderer *renderer) +void mitk::VtkAnnotation3D::SetPosition3D(Point3D position3D, mitk::BaseRenderer *renderer) { mitk::Point3dProperty::Pointer position3dProperty = mitk::Point3dProperty::New(position3D); SetProperty("Position3D", position3dProperty,renderer); } -mitk::Point3D mitk::VtkOverlay3D::GetPosition3D(mitk::BaseRenderer *renderer) +mitk::Point3D mitk::VtkAnnotation3D::GetPosition3D(mitk::BaseRenderer *renderer) { mitk::Point3D position3D; GetPropertyValue("Position3D", position3D, renderer); return position3D; } \endcode -\subsection AnnotationModulePage_CustomVTK2DOverlaySubsection VTK 2D Overlay - -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. - -\subsection AnnotationModulePage_CustomVTK3DOverlaySubsection VTK 3D Overlay - -The mitkVtkOverlay3D works just like mitkVtkOverlay2D, but it is designed for arbitrary 3D objects which derive from vtkProp, +\subsection AnnotationModulePage_CustomVTK2DAnnotationSubsection VTK 2D Annotation -\section AnnotationModulePage_CustomLayouterSection Implement a Custom Layouter +VTK based Annotations which are meant to be displayed in 2D over the render window should derive from the mitk::VtkAnnotation2D. +The mitk::VtkAnnotation2D is a subclass of Vtk::Annotation, that uses VTK to render the Annotation. This class creates the Annotation representation as a vtkActor2D, and is very easy to implement +because only UpdateVtkAnnotation2D and GetVtkActor2D have to be implemented. The add, update and remove methods are implemented in the superclasses. +UpdateVtkAnnotation2D only needs to apply the specific properties and GetVtkActor2D simply returns the created vtkActor. -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: - -\code -overlayManager->SetLayouter(textOverlay.GetPointer(),mitk::Overlay2DLayouter::STANDARD_2D_TOPLEFT,axialRenderer); -\endcode +\subsection AnnotationModulePage_CustomVTK3DAnnotationSubsection VTK 3D Annotation -A new Layouter has to implement PrepareLayout which should parse the internal Overlay list and set their position as required. +The mitkVtkAnnotation3D works just like mitkVtkAnnotation2D, but it is designed for arbitrary 3D objects which derive from vtkProp, */