Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::AnnotationUtils Class Reference

Provides static utility functions for accessing registered AnnotationRenderers and Annotations. More...

#include <mitkAnnotationUtils.h>

Public Types

typedef std::vector< std::unique_ptr< AbstractAnnotationRenderer > > AnnotationRendererServices
 Container type for managed AnnotationRenderer instances. More...
 

Public Member Functions

 AnnotationUtils ()
 Constructor. More...
 
 ~AnnotationUtils ()
 Destructor. More...
 

Static Public Member Functions

static AbstractAnnotationRenderer * GetAnnotationRenderer (const std::string &arTypeID, const std::string &rendererID)
 Get a registered AnnotationRenderer of a specific type for a given BaseRenderer. More...
 
static void RegisterAnnotationRenderer (AbstractAnnotationRenderer *annotationRenderer)
 Register an AnnotationRenderer as a microservice. More...
 
static std::vector< AbstractAnnotationRenderer * > GetAnnotationRenderer (const std::string &rendererID)
 Get all registered AnnotationRenderers for a specified BaseRenderer. More...
 
static void UpdateAnnotationRenderer (const std::string &rendererID)
 Call AbstractAnnotationRenderer::Update for each registered AnnotationRenderer of the specified BaseRenderer. More...
 
static void BaseRendererChanged (BaseRenderer *renderer)
 Notify that the actual BaseRenderer object for a BaseRenderer ID has changed. More...
 
static mitk::Annotation * GetAnnotation (const std::string &AnnotationID)
 Get a registered Annotation by its unique ID. More...
 

Detailed Description

Provides static utility functions for accessing registered AnnotationRenderers and Annotations.

Definition at line 33 of file mitkAnnotationUtils.h.

Member Typedef Documentation

◆ AnnotationRendererServices

Container type for managed AnnotationRenderer instances.

Definition at line 37 of file mitkAnnotationUtils.h.

Constructor & Destructor Documentation

◆ AnnotationUtils()

mitk::AnnotationUtils::AnnotationUtils ( )

Constructor.

◆ ~AnnotationUtils()

mitk::AnnotationUtils::~AnnotationUtils ( )

Destructor.

Member Function Documentation

◆ BaseRendererChanged()

static void mitk::AnnotationUtils::BaseRendererChanged ( BaseRenderer *  renderer)
static

Notify that the actual BaseRenderer object for a BaseRenderer ID has changed.

This must be called when a RenderWindow is closed and reopened, so that AnnotationRenderers can update their reference.

Parameters
[in]rendererThe new BaseRenderer instance.

◆ GetAnnotation()

static mitk::Annotation* mitk::AnnotationUtils::GetAnnotation ( const std::string &  AnnotationID)
static

Get a registered Annotation by its unique ID.

Parameters
[in]AnnotationIDThe unique identifier of the Annotation.
Returns
The matching Annotation, or nullptr if not found.

◆ GetAnnotationRenderer() [1/2]

static AbstractAnnotationRenderer* mitk::AnnotationUtils::GetAnnotationRenderer ( const std::string &  arTypeID,
const std::string &  rendererID 
)
static

Get a registered AnnotationRenderer of a specific type for a given BaseRenderer.

Parameters
[in]arTypeIDName specifier of the AnnotationRenderer type.
[in]rendererIDName specifier of the BaseRenderer.
Returns
The matching AnnotationRenderer, or nullptr if not found.

◆ GetAnnotationRenderer() [2/2]

static std::vector<AbstractAnnotationRenderer *> mitk::AnnotationUtils::GetAnnotationRenderer ( const std::string &  rendererID)
static

Get all registered AnnotationRenderers for a specified BaseRenderer.

Parameters
[in]rendererIDName specifier of the BaseRenderer.
Returns
A vector of matching AnnotationRenderer pointers.

◆ RegisterAnnotationRenderer()

static void mitk::AnnotationUtils::RegisterAnnotationRenderer ( AbstractAnnotationRenderer *  annotationRenderer)
static

Register an AnnotationRenderer as a microservice.

Saves a reference to it in a local static list.

Parameters
[in]annotationRendererThe AnnotationRenderer to register.

◆ UpdateAnnotationRenderer()

static void mitk::AnnotationUtils::UpdateAnnotationRenderer ( const std::string &  rendererID)
static

Call AbstractAnnotationRenderer::Update for each registered AnnotationRenderer of the specified BaseRenderer.

Parameters
[in]rendererIDName specifier of the BaseRenderer.

The documentation for this class was generated from the following file: