Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkNodePredicateDataType.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkNodePredicateDataType_h
14 #define mitkNodePredicateDataType_h
15 
16 #include <mitkDataNode.h>
17 #include <mitkNodePredicateBase.h>
18 #include <string>
19 
20 namespace mitk
21 {
32  {
33  public:
36 
39 
48  bool CheckNode(const mitk::DataNode *node) const override;
49 
50  protected:
55  NodePredicateDataType(const char *datatype);
56 
57  std::string m_ValidDataType;
58  };
59 
68  template <class T>
70  {
71  public:
73  itkFactorylessNewMacro(TNodePredicateDataType);
74 
76 
84  bool CheckNode(const mitk::DataNode *node) const override
85  {
86  return node && node->GetData() && dynamic_cast<T *>(node->GetData());
87  }
88 
89  protected:
92  };
93 
94 } // namespace mitk
95 
96 #endif
#define MITKCORE_EXPORT
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
Abstract base class for predicates used to filter DataNode objects in DataStorage queries.
Predicate that evaluates if the given DataNode's data object is of a specific data type.
bool CheckNode(const mitk::DataNode *node) const override
Checks if the node's data object is of the specified data type.
NodePredicateDataType(const char *datatype)
Protected constructor, use static instantiation functions instead.
mitkNewMacro1Param(NodePredicateDataType, const char *)
mitkClassMacro(NodePredicateDataType, NodePredicateBase)
~NodePredicateDataType() override
Standard Destructor.
Tests for type compatibility (dynamic_cast).
TNodePredicateDataType()
Protected constructor, use static instantiation functions instead.
mitkClassMacro(TNodePredicateDataType, NodePredicateBase)
bool CheckNode(const mitk::DataNode *node) const override
Checks if the node's data object is of the specified type (using dynamic_cast).
Find image slices visible on a given plane.