Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::NodePredicateBase Class Referenceabstract

Abstract base class for predicates used to filter DataNode objects in DataStorage queries. More...

#include <mitkNodePredicateBase.h>

Inheritance diagram for mitk::NodePredicateBase:
Collaboration diagram for mitk::NodePredicateBase:

Public Member Functions

 mitkClassMacroItkParent (NodePredicateBase, itk::Object)
 
 ~NodePredicateBase () override
 Virtual destructor. More...
 
virtual bool CheckNode (const mitk::DataNode *node) const =0
 Evaluate whether the given node satisfies this predicate's condition. More...
 

Detailed Description

Abstract base class for predicates used to filter DataNode objects in DataStorage queries.

Predicates are used with DataStorage::GetSubset() and related methods to select nodes that match specific criteria. By combining predicates with NodePredicateAnd, NodePredicateOr, and NodePredicateNot, complex queries can be formed, such as "give me all nodes that contain a surface object or a binary segmentation and that are tagged as OrganType == 'Liver'".

Predicates use the Composite Design Pattern and are derived from itk::Object, thus benefiting from smart pointer memory management.

Warning
Predicates should only store raw pointers to external objects (not smart pointers), because predicates are not owners of those objects and should not keep them alive.
See also
NodePredicateAnd, NodePredicateOr, NodePredicateNot, NodePredicateProperty, NodePredicateDataType, DataStorage::GetSubset

Definition at line 42 of file mitkNodePredicateBase.h.

Constructor & Destructor Documentation

◆ ~NodePredicateBase()

mitk::NodePredicateBase::~NodePredicateBase ( )
override

Virtual destructor.

Member Function Documentation

◆ CheckNode()

virtual bool mitk::NodePredicateBase::CheckNode ( const mitk::DataNode *  node) const
pure virtual

Evaluate whether the given node satisfies this predicate's condition.

Subclasses must implement this method to define their specific evaluation logic.

Parameters
[in]nodeThe DataNode to evaluate. Must not be nullptr.
Returns
true if the node satisfies the condition, false otherwise.

Implemented in mitk::NodePredicateSubGeometry, mitk::NodePredicateProperty, mitk::NodePredicateNot, mitk::NodePredicateGeometry, mitk::NodePredicateFunction, mitk::NodePredicateDimension, mitk::NodePredicateDataUID, mitk::TNodePredicateDataType< T >, mitk::NodePredicateDataType, mitk::NodePredicateDataProperty, mitk::NodePredicateData, mitk::NodePredicateOr, and mitk::NodePredicateAnd.

◆ mitkClassMacroItkParent()

mitk::NodePredicateBase::mitkClassMacroItkParent ( NodePredicateBase  ,
itk::Object   
)

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