|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Helper functions shared by ROIMapper2D and ROIMapper3D. More...
Functions | |
| void | ApplyIndividualProperties (const ROI::Element &roi, TimeStepType t, vtkActor *actor) |
| Apply individual ROI properties at a certain time step to the given actor. More... | |
| vtkSmartPointer< vtkCaptionActor2D > | CreateCaptionActor (const std::string &caption, const Point3D &attachmentPoint, vtkProperty *property, const DataNode *dataNode, const BaseRenderer *renderer) |
| Create a VTK caption actor for an ROI label. More... | |
| std::string | ParseCaption (const std::string &captionTemplate, const ROI::Element &roi, TimeStepType t=0) |
| Substitute all placeholders in a caption template with corresponding property values. More... | |
| void | SetDefaultProperties (DataNode *node, BaseRenderer *renderer, bool override) |
| Set common default properties for both 2D and 3D ROI mappers. More... | |
| template<class T > | |
| const T * | GetConstProperty (const std::string &propertyKey, const ROI::Element &roi, TimeStepType t) |
| Retrieve a typed const property from an ROI element. More... | |
Helper functions shared by ROIMapper2D and ROIMapper3D.
Provides utilities for applying ROI-specific visual properties to VTK actors, creating caption actors for ROI labels, parsing caption template strings, setting default properties, and retrieving typed ROI properties.
| void mitk::ROIMapperHelper::ApplyIndividualProperties | ( | const ROI::Element & | roi, |
| TimeStepType | t, | ||
| vtkActor * | actor | ||
| ) |
Apply individual ROI properties at a certain time step to the given actor.
Sets wireframe representation, disables lighting, and applies color, opacity, and line width from the ROI element's properties at the specified time step.
| roi | The ROI element whose properties are applied. |
| t | The time step from which to read properties. |
| actor | The VTK actor to configure. |
| vtkSmartPointer<vtkCaptionActor2D> mitk::ROIMapperHelper::CreateCaptionActor | ( | const std::string & | caption, |
| const Point3D & | attachmentPoint, | ||
| vtkProperty * | property, | ||
| const DataNode * | dataNode, | ||
| const BaseRenderer * | renderer | ||
| ) |
Create a VTK caption actor for an ROI label.
The caption is positioned at the given attachment point and styled according to the color and opacity of the provided VTK property, as well as font properties (size, bold, italic) read from the data node.
| caption | The text string to display. |
| attachmentPoint | The 3D point where the caption is anchored. |
| property | The VTK property from which to read color and opacity. |
| dataNode | The data node from which to read font properties. |
| renderer | The renderer for renderer-specific property lookup. |
| const T* mitk::ROIMapperHelper::GetConstProperty | ( | const std::string & | propertyKey, |
| const ROI::Element & | roi, | ||
| TimeStepType | t | ||
| ) |
Retrieve a typed const property from an ROI element.
Convenience template that retrieves a property by key from the ROI element at the given time step and performs a dynamic_cast to the requested type.
| T | The property type to cast to (e.g., ColorProperty, FloatProperty). |
| propertyKey | The key of the property to look up. |
| roi | The ROI element to query. |
| t | The time step for property lookup. |
Definition at line 106 of file mitkROIMapperHelper.h.
References mitk::ROI::Element::GetConstProperty().
| std::string mitk::ROIMapperHelper::ParseCaption | ( | const std::string & | captionTemplate, |
| const ROI::Element & | roi, | ||
| TimeStepType | t = 0 |
||
| ) |
Substitute all placeholders in a caption template with corresponding property values.
Placeholders are delimited by curly braces (e.g., {ID}, {name}). The special placeholder {ID} is replaced by the ROI element's numeric ID. All other placeholders are looked up as properties of the ROI element at the given time step. If no placeholders are found, the template string is returned as-is.
| captionTemplate | The template string containing placeholders. |
| roi | The ROI element from which to read property values. |
| t | The time step for property lookup (default is 0). |
| void mitk::ROIMapperHelper::SetDefaultProperties | ( | DataNode * | node, |
| BaseRenderer * | renderer, | ||
| bool | override | ||
| ) |
Set common default properties for both 2D and 3D ROI mappers.
Configures default values for opacity, font style (bold, italic, size), and caption template ("{ID}\\n{name}").
| node | The data node to decorate with default properties. |
| renderer | The renderer for renderer-specific properties, or nullptr for global defaults. |
| override | Whether to overwrite existing properties. |