Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkNodePredicateDataUID.cpp
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 
14 #include <mitkBaseData.h>
15 #include <mitkDataNode.h>
16 
18  : m_UID(uid)
19 {
20 }
21 
23 {
24 }
25 
27 {
28  if (nullptr != node)
29  {
30  auto data = node->GetData();
31 
32  if (nullptr != data)
33  {
34  return data->GetUID() == m_UID;
35  }
36  }
37 
38  return false;
39 }
NodePredicateDataUID(const Identifiable::UIDType &uid)
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
UIDType GetUID() const
Get unique ID of an object.
bool CheckNode(const mitk::DataNode *node) const override
This method will be used to evaluate the node. Has to be overwritten in subclasses.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57