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

3D mapper for mitk::MultiLabelSegmentation. More...

#include <mitkMultiLabelSegmentationVtkMapper3D.h>

Inheritance diagram for mitk::MultiLabelSegmentationVtkMapper3D:
Collaboration diagram for mitk::MultiLabelSegmentationVtkMapper3D:

Classes

class  LocalStorage
 Per-renderer cache of VTK actors and the surface-extraction state. More...
 

Public Member Functions

 mitkClassMacro (MultiLabelSegmentationVtkMapper3D, VtkMapper)
 
void Update (mitk::BaseRenderer *renderer) override
 Checks whether this mapper needs to update itself and generate data. More...
 
vtkProp * GetVtkProp (mitk::BaseRenderer *renderer) override
 Get the VTK prop for MITK-VTK rendering pipeline. More...
 
LocalStorage * GetLocalStorage (mitk::BaseRenderer *renderer)
 Get the LocalStorage corresponding to the current 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...
 
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)
 Set the default properties for multilabel segmentation rendering. More...
 
static bool ResolveSmoothed (const mitk::DataNode *node, mitk::BaseRenderer *renderer)
 Resolve the active surface-smoothing state for a node. 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...
 

Protected Types

using OutdatedGroupVectorType = std::vector< std::pair< mitk::MultiLabelSegmentation::GroupIndexType, const mitk::Image * > >
 Type for a vector of outdated group indices paired with their images. More...
 

Protected Member Functions

 MultiLabelSegmentationVtkMapper3D ()
 Default constructor. More...
 
 ~MultiLabelSegmentationVtkMapper3D () override
 Default destructor. More...
 
void GenerateDataForRenderer (mitk::BaseRenderer *renderer) override
 Drives surface re-extraction and lookup-table refresh for all outdated groups. More...
 
void UpdateLookupTable (LocalStorage *localStorage)
 Generates the look up table that should be used. More...
 
OutdatedGroupVectorType CheckForOutdatedGroups (mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage *ls, mitk::MultiLabelSegmentation *seg, bool fadedPipelineChanged)
 Check if groups are outdated or obsolete. More...
 
void UpdateSurfaceMapping (LocalStorage *localStorage, const OutdatedGroupVectorType &outdatedData)
 Update the surface mapping for the given outdated groups. 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...
 
virtual void ResetMapper (BaseRenderer *)
 Reset the mapper (i.e., make sure that nothing is displayed) if no valid data is present. In most cases the reimplemented function disables the according actors (toggling visibility off) More...
 

Protected Attributes

mitk::LocalStorageHandler< LocalStorage > m_LSH
 The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. More...
 
- Protected Attributes inherited from mitk::Mapper
mitk::DataNode * m_DataNode
 

Detailed Description

3D mapper for mitk::MultiLabelSegmentation.

Renders all label groups of a multi-label segmentation as smooth polygonal surfaces, using vtkSurfaceNets3D to extract a single shared mesh per group (one execution covers all labels in that group). The internal constrained smoothing filter preserves sharp inter-label boundaries while removing voxel staircasing.

Properties consumed:

  • "visible" (BoolProperty)
  • "opacity" (FloatProperty)
  • "org.mitk.multilabel.3D.hide" (BoolProperty)
  • "org.mitk.multilabel.3D.smoothed" (BoolProperty)
  • "/org.mitk.views.segmentation" -> "activate 3D rendering" preference
  • "/org.mitk.views.segmentation" -> "3D rendering smoothed" preference
  • "/org.mitk.views.segmentation" -> "opacity factor" preference
  • LabelHighlightGuard properties to fade non-highlighted labels

Definition at line 64 of file mitkMultiLabelSegmentationVtkMapper3D.h.

Member Typedef Documentation

◆ OutdatedGroupVectorType

Type for a vector of outdated group indices paired with their images.

Definition at line 194 of file mitkMultiLabelSegmentationVtkMapper3D.h.

Constructor & Destructor Documentation

◆ MultiLabelSegmentationVtkMapper3D()

mitk::MultiLabelSegmentationVtkMapper3D::MultiLabelSegmentationVtkMapper3D ( )
protected

Default constructor.

◆ ~MultiLabelSegmentationVtkMapper3D()

mitk::MultiLabelSegmentationVtkMapper3D::~MultiLabelSegmentationVtkMapper3D ( )
overrideprotected

Default destructor.

Member Function Documentation

◆ CheckForOutdatedGroups()

OutdatedGroupVectorType mitk::MultiLabelSegmentationVtkMapper3D::CheckForOutdatedGroups ( mitk::MultiLabelSegmentationVtkMapper3D::LocalStorage *  ls,
mitk::MultiLabelSegmentation *  seg,
bool  fadedPipelineChanged 
)
protected

Check if groups are outdated or obsolete.

Obsolete groups will be removed. Outdated groups will be indicated in the output as such. New groups will be added to the local storage and also marked as outdated.

Parameters
lsThe local storage to check.
segThe multi-label segmentation to check against.
fadedPipelineChangedWhether the faded pipeline state has changed.
Returns
A vector of outdated group index / image pairs.

◆ GenerateDataForRenderer()

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

Drives surface re-extraction and lookup-table refresh for all outdated groups.

Reimplemented from mitk::Mapper.

◆ GetLocalStorage()

LocalStorage* mitk::MultiLabelSegmentationVtkMapper3D::GetLocalStorage ( mitk::BaseRenderer *  renderer)

Get the LocalStorage corresponding to the current renderer.

◆ GetVtkProp()

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

Get the VTK prop for MITK-VTK rendering pipeline.

Parameters
rendererThe renderer to get the prop for.
Returns
The vtkProp for rendering.

Implements mitk::VtkMapper.

◆ mitkClassMacro()

mitk::MultiLabelSegmentationVtkMapper3D::mitkClassMacro ( MultiLabelSegmentationVtkMapper3D  ,
VtkMapper   
)

Standard class typedefs.

◆ New()

static Pointer mitk::MultiLabelSegmentationVtkMapper3D::New ( )
static

Method for creation through the object factory.

◆ ResolveSmoothed()

static bool mitk::MultiLabelSegmentationVtkMapper3D::ResolveSmoothed ( const mitk::DataNode *  node,
mitk::BaseRenderer *  renderer 
)
static

Resolve the active surface-smoothing state for a node.

Reads the per-node "org.mitk.multilabel.3D.smoothed" property if set, otherwise falls back to the "/org.mitk.views.segmentation -> 3D rendering smoothed" preference (default true).

Remarks
The 3D-visualization context-menu action (Qmitk3DMultiSegVisStyleAction) mirrors this resolution rule. It is duplicated rather than reused because org.mitk.gui.qt.application must not depend on MitkMultilabel. Keep both implementations in sync if defaults or preference keys change.

◆ SetDefaultProperties()

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

Set the default properties for multilabel segmentation rendering.

Parameters
nodeThe data node to set the properties on.
rendererThe renderer for renderer-specific properties, or nullptr for global properties.
overwriteIf true, existing properties will be overwritten.

◆ Update()

void mitk::MultiLabelSegmentationVtkMapper3D::Update ( mitk::BaseRenderer *  renderer)
overridevirtual

Checks whether this mapper needs to update itself and generate data.

Reimplemented from mitk::Mapper.

◆ UpdateLookupTable()

void mitk::MultiLabelSegmentationVtkMapper3D::UpdateLookupTable ( LocalStorage *  localStorage)
protected

Generates the look up table that should be used.

◆ UpdateSurfaceMapping()

void mitk::MultiLabelSegmentationVtkMapper3D::UpdateSurfaceMapping ( LocalStorage *  localStorage,
const OutdatedGroupVectorType &  outdatedData 
)
protected

Update the surface mapping for the given outdated groups.

Parameters
localStorageThe local storage to update.
outdatedDataThe outdated group data to process.

Member Data Documentation

◆ m_LSH

mitk::LocalStorageHandler<LocalStorage> mitk::MultiLabelSegmentationVtkMapper3D::m_LSH
protected

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

Definition at line 216 of file mitkMultiLabelSegmentationVtkMapper3D.h.


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