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

Predicate that evaluates if the given DataNode's data object has a geometry that is a sub geometry of the reference geometry. More...

#include <mitkNodePredicateSubGeometry.h>

Inheritance diagram for mitk::NodePredicateSubGeometry:
Collaboration diagram for mitk::NodePredicateSubGeometry:

Public Member Functions

 mitkClassMacro (NodePredicateSubGeometry, NodePredicateBase)
 
 mitkNewMacro1Param (NodePredicateSubGeometry, const BaseGeometry *)
 
 mitkNewMacro2Param (NodePredicateSubGeometry, const BaseGeometry *, TimePointType)
 
void SetCheckPrecision (mitk::ScalarType precision)
 Sets both CheckCoordinatePrecision and CheckDirectionPrecision to the passed value. More...
 
virtual void SetCheckCoordinatePrecision (mitk::ScalarType _arg)
 
virtual mitk::ScalarType GetCheckCoordinatePrecision ()
 
virtual void SetCheckDirectionPrecision (mitk::ScalarType _arg)
 
virtual mitk::ScalarType GetCheckDirectionPrecision ()
 
 ~NodePredicateSubGeometry () override
 Standard Destructor. More...
 
bool CheckNode (const mitk::DataNode *node) const override
 Checks if the node's data geometry is a sub geometry of the reference. More...
 
- Public Member Functions inherited from mitk::NodePredicateBase
 mitkClassMacroItkParent (NodePredicateBase, itk::Object)
 
 ~NodePredicateBase () override
 Virtual destructor. More...
 

Protected Member Functions

 NodePredicateSubGeometry (const BaseGeometry *refGeometry)
 Constructor that checks the reference geometry against the first data timepoint. More...
 
 NodePredicateSubGeometry (const BaseGeometry *refGeometry, TimePointType relevantTimePoint)
 Constructor that checks the reference geometry against a specific timepoint. More...
 

Protected Attributes

BaseGeometry::ConstPointer m_RefGeometry
 
TimePointType m_TimePoint
 
bool m_UseTimePoint
 Indicates if m_TimePoint should be regarded or always the first timestep should be used. More...
 
mitk::ScalarType m_CheckCoordinatePrecision
 Precision that should be used for the equal coordinate checks. More...
 
mitk::ScalarType m_CheckDirectionPrecision
 Precision that should be used for the equal direction checks. More...
 

Detailed Description

Predicate that evaluates if the given DataNode's data object has a geometry that is a sub geometry of the reference geometry.

Sub geometry means that both geometries have the same voxel grid (same spacing, same axes, origin is on voxel grid), but the bounding box of the checked geometry is contained or equal to the bounding box of the reference geometry.

One can either check the whole time geometry of the data node by defining a reference time geometry or check against one given reference base geometry. If the predicate should check against a base geometry, you can specify the timepoint of the data's time geometry that should be checked. If no timepoint is defined the predicate will evaluate the data geometry in the first timestep. Evaluates to "false" for unsupported or undefined data objects/geometries.

One can specify the tolerance/precision of the check via SetCheckPrecision(), SetCheckCoordinatePrecision() or SetCheckDirectionPrecision().

Remarks
The default tolerance for coordinate checks is defined by NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_COORDINATE_PRECISION. The default tolerance for direction checks is defined by NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_DIRECTION_PRECISION. Both are not as strict as mitk::eps. The reason is that, for the typical use of the node predicate, mitk::eps would be too pedantic, as we encounter often rounding differences/errors in real world data sets. For more details, see the documentation of the aforementioned constants. We have introduced two different precision values because differences are less impactful for coordinates than for direction values. Therefore we can relax coordinate checks more than direction checks.

Definition at line 55 of file mitkNodePredicateSubGeometry.h.

Constructor & Destructor Documentation

◆ ~NodePredicateSubGeometry()

mitk::NodePredicateSubGeometry::~NodePredicateSubGeometry ( )
override

Standard Destructor.

◆ NodePredicateSubGeometry() [1/2]

mitk::NodePredicateSubGeometry::NodePredicateSubGeometry ( const BaseGeometry *  refGeometry)
protected

Constructor that checks the reference geometry against the first data timepoint.

Parameters
refGeometryThe reference base geometry to compare against.

◆ NodePredicateSubGeometry() [2/2]

mitk::NodePredicateSubGeometry::NodePredicateSubGeometry ( const BaseGeometry *  refGeometry,
TimePointType  relevantTimePoint 
)
protected

Constructor that checks the reference geometry against a specific timepoint.

Parameters
refGeometryThe reference base geometry to compare against.
relevantTimePointThe timepoint of the data's time geometry to evaluate.

Member Function Documentation

◆ CheckNode()

bool mitk::NodePredicateSubGeometry::CheckNode ( const mitk::DataNode *  node) const
overridevirtual

Checks if the node's data geometry is a sub geometry of the reference.

Parameters
nodeThe DataNode to check.
Returns
True if the data geometry is a sub geometry of the reference within the configured precision.

Implements mitk::NodePredicateBase.

◆ GetCheckCoordinatePrecision()

virtual mitk::ScalarType mitk::NodePredicateSubGeometry::GetCheckCoordinatePrecision ( )
virtual

◆ GetCheckDirectionPrecision()

virtual mitk::ScalarType mitk::NodePredicateSubGeometry::GetCheckDirectionPrecision ( )
virtual

◆ mitkClassMacro()

mitk::NodePredicateSubGeometry::mitkClassMacro ( NodePredicateSubGeometry  ,
NodePredicateBase   
)

◆ mitkNewMacro1Param()

mitk::NodePredicateSubGeometry::mitkNewMacro1Param ( NodePredicateSubGeometry  ,
const BaseGeometry *   
)

◆ mitkNewMacro2Param()

mitk::NodePredicateSubGeometry::mitkNewMacro2Param ( NodePredicateSubGeometry  ,
const BaseGeometry *  ,
TimePointType   
)

◆ SetCheckCoordinatePrecision()

virtual void mitk::NodePredicateSubGeometry::SetCheckCoordinatePrecision ( mitk::ScalarType  _arg)
virtual

◆ SetCheckDirectionPrecision()

virtual void mitk::NodePredicateSubGeometry::SetCheckDirectionPrecision ( mitk::ScalarType  _arg)
virtual

◆ SetCheckPrecision()

void mitk::NodePredicateSubGeometry::SetCheckPrecision ( mitk::ScalarType  precision)

Sets both CheckCoordinatePrecision and CheckDirectionPrecision to the passed value.

Parameters
precisionThe precision value to use for both coordinate and direction checks.

Member Data Documentation

◆ m_CheckCoordinatePrecision

mitk::ScalarType mitk::NodePredicateSubGeometry::m_CheckCoordinatePrecision
protected

Precision that should be used for the equal coordinate checks.

Definition at line 105 of file mitkNodePredicateSubGeometry.h.

◆ m_CheckDirectionPrecision

mitk::ScalarType mitk::NodePredicateSubGeometry::m_CheckDirectionPrecision
protected

Precision that should be used for the equal direction checks.

Definition at line 107 of file mitkNodePredicateSubGeometry.h.

◆ m_RefGeometry

BaseGeometry::ConstPointer mitk::NodePredicateSubGeometry::m_RefGeometry
protected

Definition at line 100 of file mitkNodePredicateSubGeometry.h.

◆ m_TimePoint

TimePointType mitk::NodePredicateSubGeometry::m_TimePoint
protected

Definition at line 101 of file mitkNodePredicateSubGeometry.h.

◆ m_UseTimePoint

bool mitk::NodePredicateSubGeometry::m_UseTimePoint
protected

Indicates if m_TimePoint should be regarded or always the first timestep should be used.

Definition at line 103 of file mitkNodePredicateSubGeometry.h.


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