Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit

Vtk-based 2D mapper for PointSet. More...

#include <mitkPointSetVtkMapper2D.h>

Inheritance diagram for mitk::PointSetVtkMapper2D:
Collaboration diagram for mitk::PointSetVtkMapper2D:

Classes

class  LocalStorage
 Internal class holding the mapper, actor, etc. for each of the 3 2D render windows. More...
 

Public Member Functions

 mitkClassMacro (PointSetVtkMapper2D, VtkMapper)
 
Pointer Clone () const
 
virtual const mitk::PointSet * GetInput () const
 Returns the PointSet input data object of this mapper. More...
 
vtkProp * GetVtkProp (mitk::BaseRenderer *renderer) override
 Returns the vtkPropAssembly containing all VTK actors for the given renderer. More...
 
- Public Member Functions inherited from mitk::VtkMapper
 mitkClassMacro (VtkMapper, Mapper)
 
void MitkRender (mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override
 Determine the render pass type and call the appropriate render method. More...
 
virtual void MitkRenderOverlay (BaseRenderer *renderer)
 Check visibility and render the overlay pass. More...
 
virtual void MitkRenderOpaqueGeometry (BaseRenderer *renderer)
 Check visibility and render opaque (untransparent) geometry. More...
 
virtual void MitkRenderTranslucentGeometry (BaseRenderer *renderer)
 Check visibility and render translucent (transparent) geometry. More...
 
virtual void MitkRenderVolumetricGeometry (BaseRenderer *renderer)
 Check visibility and render volumetric geometry. More...
 
virtual bool HasVtkProp (const vtkProp *prop, BaseRenderer *renderer)
 Check whether this mapper owns the specified vtkProp for the given renderer. More...
 
virtual void UpdateVtkTransform (mitk::BaseRenderer *renderer)
 Set the vtkTransform of the m_Prop3D for the current time step of renderer. More...
 
void ApplyColorAndOpacityProperties (mitk::BaseRenderer *renderer, vtkActor *actor) override
 Apply color and opacity properties read from the PropertyList to the given vtkActor. More...
 
virtual void ReleaseGraphicsResources (mitk::BaseRenderer *)
 Release VTK-based graphics resources consumed by this mapper. More...
 
- Public Member Functions inherited from mitk::Mapper
 mitkClassMacroItkParent (Mapper, itk::Object)
 
virtual void SetDataNode (DataNode *_arg)
 Set the DataNode containing the data to map. More...
 
virtual DataNode * GetDataNode () const
 Get the DataNode containing the data to map. More...
 
virtual void Update (BaseRenderer *renderer)
 Calculate the time step for the current renderer and generate rendering data. More...
 
TimeStepType GetTimestep () const
 Return the current time step as calculated from the renderer. More...
 
virtual bool IsLODEnabled (BaseRenderer *) const
 Return whether this Mapper currently allows for Level-of-Detail rendering. More...
 

Static Public Member Functions

static Pointer New ()
 
static void SetDefaultProperties (mitk::DataNode *node, mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
 Sets default properties for point set visualization in 2D. More...
 
- Static Public Member Functions inherited from mitk::Mapper
static void SetDefaultProperties (DataNode *node, BaseRenderer *renderer=nullptr, bool overwrite=false)
 Set default values of properties used by this mapper on the given node. More...
 

Public Attributes

mitk::LocalStorageHandler< LocalStorage > m_LSH
 The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. More...
 

Protected Member Functions

 PointSetVtkMapper2D ()
 Constructor. More...
 
 ~PointSetVtkMapper2D () override
 Destructor. More...
 
void GenerateDataForRenderer (mitk::BaseRenderer *renderer) override
 Applies the color and opacity properties and calls CreateVTKRenderObjects. More...
 
void ResetMapper (BaseRenderer *renderer) override
 Called in mitk::Mapper::Update to reset the mapper. More...
 
virtual void CreateVTKRenderObjects (mitk::BaseRenderer *renderer)
 Fills the VTK objects; only called when the point set has been changed. More...
 
- Protected Member Functions inherited from mitk::VtkMapper
 VtkMapper ()
 
 ~VtkMapper () override
 
- Protected Member Functions inherited from mitk::Mapper
 Mapper ()
 explicit constructor which disallows implicit conversions More...
 
 ~Mapper () override
 virtual destructor in order to derive from this class More...
 
virtual void CalculateTimeStep (BaseRenderer *renderer)
 Updates the time step, which is sometimes needed in subclasses. More...
 

Protected Attributes

bool m_ShowContour
 
bool m_CloseContour
 
bool m_ShowPoints
 
bool m_ShowDistances
 
int m_DistancesDecimalDigits
 
bool m_ShowAngles
 
bool m_ShowDistantLines
 
int m_LineWidth
 
int m_PointLineWidth
 
float m_Point2DSize
 
int m_IDShapeProperty
 
bool m_FillShape
 
float m_DistanceToPlane
 
bool m_FixedSizeOnScreen
 
int m_Resolution
 
bool m_KeepShapeWhenSelected
 
bool m_ShowSelectedContour
 
- Protected Attributes inherited from mitk::Mapper
mitk::DataNode * m_DataNode
 

Detailed Description

Vtk-based 2D mapper for PointSet.

Due to the need of different colors for selected and unselected points and the facts, that we also have a contour and labels for the points, the vtk structure is build up the following way:

We have three PolyData, one selected, and one unselected and one for a contour between the points. Each one is connected to an own PolyDataMapper and an Actor. The different color for the unselected and selected state and for the contour is read from properties.

This mapper has several additional functionalities, such as rendering a contour between points, calculating and displaying distances or angles between points.

Point Representation

The points are displayed as small glyphs of configurable shape (see property "PointSet.2D.shape"). The size of these glyphs is given in world units. That means, the size or shape of those glyphs is independent of the BaseGeometry object that you assign to the PointSet. As for all other objects, positions of points will be transformed into the world via the Geometry's index-to-world transform.

Then the three Actors are combined inside a vtkPropAssembly and this object is returned in GetProp() and so hooked up into the rendering pipeline.

Applicable Properties

Properties that can be set for point sets and influence the PointSetVTKMapper2D are:

  • "line width": (IntProperty 2) // line width of the line from one point to another
  • "point line width": (IntProperty 1) // line width of the cross marking a point
  • "point 2D size": (FloatProperty 6) // size of the glyph marking a point (diameter, in world units!)
  • "show contour": (BoolProperty false) // enable contour rendering between points (lines)
  • "close contour": (BoolProperty false) // if enabled, the open strip is closed (first point connected with last point)
  • "show points": (BoolProperty true) // show or hide points
  • "show distances": (BoolProperty false) // show or hide distance measure
  • "distance decimal digits": (IntProperty 2) // set the number of decimal digits to be shown when rendering the distance information
  • "show angles": (BoolProperty false) // show or hide angle measurement
  • "show distant lines": (BoolProperty false) // show the line between to points from a distant view (equals "always on top" option)
  • "layer": (IntProperty 1) // default is drawing pointset above images (they have a default layer of 0)
  • "PointSet.2D.shape" (EnumerationProperty Cross) // provides different shapes marking a point 0 = "None", 1 = "Vertex", 2 = "Dash", 3 = "Cross", 4 = "ThickCross", 5 = "Triangle", 6 = "Square", 7 = "Circle", 8 = "Diamond", 9 = "Arrow", 10 = "ThickArrow", 11 = "HookedArrow", 12 = "Cross"
  • "PointSet.2D.fill shape": (BoolProperty false) // fill or do not fill the glyph shape
  • "Pointset.2D.distance to plane": (FloatProperty 4.0) //In the 2D render window, points are rendered which lie within a certain distance to the current plane. They are projected on the current plane and scaled according to their distance. Point markers appear smaller as the plane moves away from their true location. The distance threshold can be adjusted by this float property, which ables the user to delineate the points that lie exactly on the plane. (+/- rounding error)

Other Properties used here but not defined in this class:

  • "selectedcolor": (ColorProperty (1.0f, 0.0f, 0.0f)) // default color of the selected pointset e.g. the current point is red
  • "contourcolor" : (ColorProperty (1.0f, 0.0f, 0.0f)) // default color for the contour is red
  • "color": (ColorProperty (1.0f, 1.0f, 0.0f)) // default color of the (unselected) pointset is yellow
  • "opacity": (FloatProperty 1.0) // opacity of point set, contours
  • "label": (StringProperty nullptr) // a label can be defined for each point, which is rendered in proximity to the point
See also
PointSetVtkMapper3D
PointSet

Definition at line 120 of file mitkPointSetVtkMapper2D.h.

Constructor & Destructor Documentation

◆ PointSetVtkMapper2D()

mitk::PointSetVtkMapper2D::PointSetVtkMapper2D ( )
protected

Constructor.

◆ ~PointSetVtkMapper2D()

mitk::PointSetVtkMapper2D::~PointSetVtkMapper2D ( )
overrideprotected

Destructor.

Member Function Documentation

◆ Clone()

Pointer mitk::PointSetVtkMapper2D::Clone ( ) const

◆ CreateVTKRenderObjects()

virtual void mitk::PointSetVtkMapper2D::CreateVTKRenderObjects ( mitk::BaseRenderer *  renderer)
protectedvirtual

Fills the VTK objects; only called when the point set has been changed.

This function iterates over the input point set and determines the glyphs which lie in a specific range around the current slice. Those glyphs are rendered using a specific shape defined in vtk glyph source to mark each point. The shape can be changed in MITK using the property "PointSet.2D.shape".

There were issues when rendering vtk glyphs in the 2D-render windows. By default, the glyphs are rendered within the x-y plane in each 2D-render window, so you would only see them from the side in the sagittal and coronal 2D-render window. The solution to this is to rotate the glyphs in order to be orthogonal to the current view vector. To achieve this, the rotation (vtktransform) of the current PlaneGeometry is applied to the orientation of the glyphs.

Parameters
rendererthe renderer for which the VTK render objects are created.

◆ GenerateDataForRenderer()

void mitk::PointSetVtkMapper2D::GenerateDataForRenderer ( mitk::BaseRenderer *  renderer)
overrideprotectedvirtual

Applies the color and opacity properties and calls CreateVTKRenderObjects.

Parameters
rendererthe renderer for which data is generated.

Reimplemented from mitk::Mapper.

◆ GetInput()

virtual const mitk::PointSet* mitk::PointSetVtkMapper2D::GetInput ( ) const
virtual

Returns the PointSet input data object of this mapper.

Returns
The associated PointSet, or nullptr if no data is set.

◆ GetVtkProp()

vtkProp* mitk::PointSetVtkMapper2D::GetVtkProp ( mitk::BaseRenderer *  renderer)
overridevirtual

Returns the vtkPropAssembly containing all VTK actors for the given renderer.

Parameters
rendererthe renderer for which to retrieve the VTK prop.
Returns
The vtkPropAssembly that aggregates all rendering actors.

Implements mitk::VtkMapper.

◆ mitkClassMacro()

mitk::PointSetVtkMapper2D::mitkClassMacro ( PointSetVtkMapper2D  ,
VtkMapper   
)

◆ New()

static Pointer mitk::PointSetVtkMapper2D::New ( )
static

◆ ResetMapper()

void mitk::PointSetVtkMapper2D::ResetMapper ( BaseRenderer *  renderer)
overrideprotectedvirtual

Called in mitk::Mapper::Update to reset the mapper.

If TimeGeometry or time step is not valid for the point set, the mapper is reset so that nothing is displayed (e.g. toggles visibility of the prop assembly off).

Parameters
rendererthe renderer for which the mapper is reset.

Reimplemented from mitk::Mapper.

◆ SetDefaultProperties()

static void mitk::PointSetVtkMapper2D::SetDefaultProperties ( mitk::DataNode *  node,
mitk::BaseRenderer *  renderer = nullptr,
bool  overwrite = false 
)
static

Sets default properties for point set visualization in 2D.

Parameters
nodethe data node to configure.
rendererthe renderer for which properties should be set, or nullptr for global defaults.
overwriteif true, existing properties will be overwritten.

Member Data Documentation

◆ m_CloseContour

bool mitk::PointSetVtkMapper2D::m_CloseContour
protected

Definition at line 256 of file mitkPointSetVtkMapper2D.h.

◆ m_DistancesDecimalDigits

int mitk::PointSetVtkMapper2D::m_DistancesDecimalDigits
protected

Definition at line 259 of file mitkPointSetVtkMapper2D.h.

◆ m_DistanceToPlane

float mitk::PointSetVtkMapper2D::m_DistanceToPlane
protected

Definition at line 267 of file mitkPointSetVtkMapper2D.h.

◆ m_FillShape

bool mitk::PointSetVtkMapper2D::m_FillShape
protected

Definition at line 266 of file mitkPointSetVtkMapper2D.h.

◆ m_FixedSizeOnScreen

bool mitk::PointSetVtkMapper2D::m_FixedSizeOnScreen
protected

Definition at line 268 of file mitkPointSetVtkMapper2D.h.

◆ m_IDShapeProperty

int mitk::PointSetVtkMapper2D::m_IDShapeProperty
protected

Definition at line 265 of file mitkPointSetVtkMapper2D.h.

◆ m_KeepShapeWhenSelected

bool mitk::PointSetVtkMapper2D::m_KeepShapeWhenSelected
protected

Definition at line 270 of file mitkPointSetVtkMapper2D.h.

◆ m_LineWidth

int mitk::PointSetVtkMapper2D::m_LineWidth
protected

Definition at line 262 of file mitkPointSetVtkMapper2D.h.

◆ m_LSH

mitk::LocalStorageHandler<LocalStorage> mitk::PointSetVtkMapper2D::m_LSH

The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows.

Definition at line 214 of file mitkPointSetVtkMapper2D.h.

◆ m_Point2DSize

float mitk::PointSetVtkMapper2D::m_Point2DSize
protected

Definition at line 264 of file mitkPointSetVtkMapper2D.h.

◆ m_PointLineWidth

int mitk::PointSetVtkMapper2D::m_PointLineWidth
protected

Definition at line 263 of file mitkPointSetVtkMapper2D.h.

◆ m_Resolution

int mitk::PointSetVtkMapper2D::m_Resolution
protected

Definition at line 269 of file mitkPointSetVtkMapper2D.h.

◆ m_ShowAngles

bool mitk::PointSetVtkMapper2D::m_ShowAngles
protected

Definition at line 260 of file mitkPointSetVtkMapper2D.h.

◆ m_ShowContour

bool mitk::PointSetVtkMapper2D::m_ShowContour
protected

Definition at line 255 of file mitkPointSetVtkMapper2D.h.

◆ m_ShowDistances

bool mitk::PointSetVtkMapper2D::m_ShowDistances
protected

Definition at line 258 of file mitkPointSetVtkMapper2D.h.

◆ m_ShowDistantLines

bool mitk::PointSetVtkMapper2D::m_ShowDistantLines
protected

Definition at line 261 of file mitkPointSetVtkMapper2D.h.

◆ m_ShowPoints

bool mitk::PointSetVtkMapper2D::m_ShowPoints
protected

Definition at line 257 of file mitkPointSetVtkMapper2D.h.

◆ m_ShowSelectedContour

bool mitk::PointSetVtkMapper2D::m_ShowSelectedContour
protected

Definition at line 271 of file mitkPointSetVtkMapper2D.h.


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