Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkPropertyRelationRuleBase.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 
15 #include <mitkDataNode.h>
16 #include <mitkExceptionMacro.h>
17 #include <mitkNodePredicateBase.h>
18 #include <mitkStringProperty.h>
19 #include <mitkUIDGenerator.h>
20 
21 #include <mutex>
22 #include <regex>
23 
25 {
26  return true;
27 };
28 
30 {
31  return owner != nullptr;
32 };
33 
35 {
36  return owner != nullptr;
37 };
38 
40 {
41  return PropertyKeyPath().AddElement("MITK").AddElement("Relations");
42 };
43 
45 {
46  return ruleID == this->GetRuleID();
47 };
48 
49 
50 std::string mitk::PropertyRelationRuleBase::GetRIIPropertyRegEx(const std::string propName, const InstanceIDType &instanceID) const
51 {
52  auto path = this->GetRootKeyPath();
53  if (instanceID.empty())
54  {
55  path.AddAnyElement();
56  }
57  else
58  {
59  path.AddElement(instanceID);
60  }
61 
62  if (!propName.empty())
63  {
64  path.AddElement(propName);
65  }
66 
67  return PropertyKeyPathToPropertyRegEx(path);
68 };
69 
70 //workaround until T24729 is done. Please remove if T24728 is done
71 //then could directly use owner->GetPropertyKeys() again.
73 {
74  std::vector<std::string> keys;
75  auto sourceCasted = dynamic_cast<const mitk::DataNode*>(owner);
76  if (sourceCasted) {
77  auto sourceData = sourceCasted->GetData();
78  if (sourceData) {
79  keys = sourceData->GetPropertyKeys();
80  }
81  else {
82  keys = sourceCasted->GetPropertyKeys();
83  }
84  }
85  else {
86  keys = owner->GetPropertyKeys();
87  }
88  return keys;
89 };
90 //end workaround for T24729
91 
92 
94 {
95  if (!owner)
96  {
97  mitkThrow() << "Error. Passed owner pointer is NULL";
98  }
99 
100  std::vector<std::string> keys;
101  //workaround until T24729 is done. Please remove if T24728 is done
102  keys = GetPropertyKeys(owner);
103  //end workaround for T24729
104 
105  auto sourceRegExStr = this->GetRIIPropertyRegEx("ruleID");
106  auto regEx = std::regex(sourceRegExStr);
107 
108  for (const auto &key : keys)
109  {
110  if (std::regex_match(key, regEx))
111  {
112  auto idProp = owner->GetConstProperty(key);
113  auto ruleID = idProp->GetValueAsString();
114  if (this->IsSupportedRuleID(ruleID))
115  {
116  return true;
117  }
118  }
119  }
120 
121  return false;
122 };
123 
125  const IPropertyProvider *source, const IPropertyProvider *destination) const
126 {
127  if (!source)
128  {
129  mitkThrow() << "Error. Passed source pointer is NULL";
130  }
131  if (!destination)
132  {
133  mitkThrow() << "Error. Passed owner pointer is NULL";
134  }
135 
137 
138  if (!this->GetInstanceID_IDLayer(source, destination).empty())
139  { // has relations of type Connected_ID;
141  }
142 
143  if (result == RelationType::None)
144  {
145  auto instanceIDs_data = this->GetInstanceID_datalayer(source, destination);
146 
147  if (instanceIDs_data.size() > 1)
148  {
149  MITK_WARN << "Property relation on data level is ambiguous. First relation is used. Instance ID: "
150  << instanceIDs_data.front();
151  }
152 
153  if (!instanceIDs_data.empty() && instanceIDs_data.front() != NULL_INSTANCE_ID())
154  { // has relations of type Connected_Data;
156  }
157  }
158 
159  if (result == RelationType::None)
160  {
161  if (this->HasImplicitDataRelation(source, destination))
162  { // has relations of type Connected_Data;
164  }
165  }
166 
167  return result;
168 };
169 
171  const IPropertyProvider *source) const
172 {
173  if (!source)
174  {
175  mitkThrow() << "Error. Passed source pointer is NULL";
176  }
177 
178  auto ruleIDRegExStr = this->GetRIIPropertyRegEx("ruleID");
179  auto regEx = std::regex(ruleIDRegExStr);
180 
181  //workaround until T24729 is done. You can use directly source->GetPropertyKeys again, when fixed.
182  const auto keys = GetPropertyKeys(source);
183  //end workaround for T24729
184 
185  RelationUIDVectorType relationUIDs;
186 
187  for (const auto &key : keys)
188  {
189  if (std::regex_match(key, regEx))
190  {
191  auto idProp = source->GetConstProperty(key);
192  auto ruleID = idProp->GetValueAsString();
193  if (this->IsSupportedRuleID(ruleID))
194  {
195  auto instanceID = this->GetInstanceIDByPropertyName(key);
196  relationUIDs.push_back(this->GetRelationUIDByInstanceID(source, instanceID));
197  }
198  }
199  }
200 
201  return relationUIDs;
202 };
203 
205  const IPropertyProvider *source, const IPropertyProvider *destination) const
206 {
207  if (!source)
208  {
209  mitkThrow() << "Error. Passed source pointer is NULL";
210  }
211  if (!destination)
212  {
213  mitkThrow() << "Error. Passed destination pointer is NULL";
214  }
215 
216  RelationUIDVectorType result;
217 
218  auto instanceIDs = this->GetInstanceID_IDLayer(source, destination);
219  for (const auto instanceID : instanceIDs)
220  {
221  result.push_back(this->GetRelationUIDByInstanceID(source, instanceID));
222  }
223 
224  if (result.empty() || this->IsAbstract())
225  {
226  auto instanceIDs_data = this->GetInstanceID_datalayer(source, destination);
227 
228  for (const auto instanceID : instanceIDs_data)
229  {
230  if (std::find(std::begin(instanceIDs), std::end(instanceIDs), instanceID) == std::end(instanceIDs))
231  {
232  result.push_back(this->GetRelationUIDByInstanceID(source, instanceID));
233  }
234  }
235  }
236 
237  return result;
238 };
239 
242 {
243  auto result = this->GetRelationUIDs(source, destination);
244 
245  if (result.empty())
246  {
248  }
249  else if(result.size()>1)
250  {
251  mitkThrow() << "Cannot return one(!) relation UID. Multiple relations exists for given rule, source and destination.";
252  }
253 
254  return result[0];
255 };
256 
258 {
259  return std::string();
260 };
261 
263  const IPropertyProvider *source, const InstanceIDType &instanceID) const
264 {
265  RelationUIDType result;
266 
267  if (instanceID != NULL_INSTANCE_ID())
268  {
269  auto idProp = source->GetConstProperty(
270  PropertyKeyPathToPropertyName(this->GetRootKeyPath().AddElement(instanceID).AddElement("relationUID")));
271 
272  if (idProp.IsNotNull())
273  {
274  result = idProp->GetValueAsString();
275  }
276  }
277 
278  if (result.empty())
279  {
281  }
282 
283  return result;
284 };
285 
287  const IPropertyProvider *source, const RelationUIDType &relationUID) const
288 {
289  if (!source)
290  {
291  mitkThrow() << "Error. Passed source pointer is NULL";
292  }
293 
294  InstanceIDType result = NULL_INSTANCE_ID();
295 
296  auto destRegExStr =
297  PropertyKeyPathToPropertyRegEx(GetRootKeyPath().AddAnyElement().AddElement("relationUID"));
298  auto regEx = std::regex(destRegExStr);
299  std::smatch instance_matches;
300 
301  //workaround until T24729 is done. You can use directly source->GetPropertyKeys again, when fixed.
302  const auto keys = GetPropertyKeys(source);
303  //end workaround for T24729
304 
305  for (const auto &key : keys)
306  {
307  if (std::regex_search(key, instance_matches, regEx))
308  {
309  auto idProp = source->GetConstProperty(key);
310  if (idProp->GetValueAsString() == relationUID)
311  {
312  if (instance_matches.size()>1)
313  {
314  result = instance_matches[1];
315  break;
316  }
317  }
318  }
319  }
320 
321  return result;
322 };
323 
325  const IPropertyProvider *source, const IPropertyProvider *destination) const
326 {
327  if (!source)
328  {
329  mitkThrow() << "Error. Passed source pointer is NULL";
330  }
331  if (!destination)
332  {
333  mitkThrow() << "Error. Passed destination pointer is NULL";
334  }
335 
336  auto identifiable = dynamic_cast<const Identifiable *>(destination);
337 
338  if (!identifiable)
339  { //This check and pass through to data is needed due to solve T25711. See Task for more information.
340  //This could be removed at the point we can get rid of DataNodes or they get realy transparent.
341  auto node = dynamic_cast<const DataNode*>(destination);
342  if (node && node->GetData())
343  {
344  identifiable = dynamic_cast<const Identifiable *>(node->GetData());
345  }
346  }
347 
348  InstanceIDVectorType result;
349 
350  if (identifiable)
351  { // check for relations of type Connected_ID;
352 
353  auto destRegExStr = this->GetRIIPropertyRegEx("destinationUID");
354  auto regEx = std::regex(destRegExStr);
355  std::smatch instance_matches;
356 
357  auto destUID = identifiable->GetUID();
358 
359  //workaround until T24729 is done. You can use directly source->GetPropertyKeys again, when fixed.
360  const auto keys = GetPropertyKeys(source);
361  //end workaround for T24729
362 
363  for (const auto &key : keys)
364  {
365  if (std::regex_search(key, instance_matches, regEx))
366  {
367  auto idProp = source->GetConstProperty(key);
368  if (idProp->GetValueAsString() == destUID)
369  {
370  if (instance_matches.size()>1)
371  {
372  auto instanceID = instance_matches[1];
373  if (this->IsSupportedRuleID(GetRuleIDByInstanceID(source, instanceID)))
374  {
375  result.push_back(instanceID);
376  }
377  }
378  }
379  }
380  }
381  }
382 
383  return result;
384 };
385 
387 {
388  if (!source)
389  {
390  mitkThrow() << "Error. Passed source pointer is NULL";
391  }
392  if (!destination)
393  {
394  mitkThrow() << "Error. Passed destination pointer is NULL";
395  }
396  if (this->IsAbstract())
397  {
398  mitkThrow() << "Error. This is an abstract property relation rule. Abstract rule must not make a connection. Please use a concrete rule.";
399  }
400 
401  auto instanceIDs = this->GetInstanceID_IDLayer(source, destination);
402  bool hasIDlayer = !instanceIDs.empty();
403 
404  auto instanceIDs_data = this->GetInstanceID_datalayer(source, destination);
405  if (instanceIDs_data.size() > 1)
406  {
407  MITK_WARN << "Property relation on data level is ambiguous. First relation is used. Instance ID: "
408  << instanceIDs_data.front();
409  }
410  bool hasDatalayer = !instanceIDs_data.empty();
411 
412  if (hasIDlayer && hasDatalayer && instanceIDs.front() != instanceIDs_data.front())
413  {
414  mitkThrow() << "Property relation information is in an invalid state. ID and data layer point to different "
415  "relation instances. Rule: "
416  << this->GetRuleID() << "; ID based instance: " << instanceIDs.front()
417  << "; Data base instance: " << instanceIDs_data.front();
418  }
419 
420  RelationUIDType relationUID = this->CreateRelationUID();
421 
422  InstanceIDType instanceID = "";
423 
424  if (hasIDlayer)
425  {
426  instanceID = instanceIDs.front();
427  }
428  else if (hasDatalayer)
429  {
430  instanceID = instanceIDs_data.front();
431  }
432  else
433  {
434  instanceID = this->CreateNewRelationInstance(source, relationUID);
435  }
436 
437  auto relUIDKey =
438  PropertyKeyPathToPropertyName(GetRootKeyPath().AddElement(instanceID).AddElement("relationUID"));
439  source->SetProperty(relUIDKey, mitk::StringProperty::New(relationUID));
440 
441  auto ruleIDKey =
442  PropertyKeyPathToPropertyName(GetRootKeyPath().AddElement(instanceID).AddElement("ruleID"));
443  source->SetProperty(ruleIDKey, mitk::StringProperty::New(this->GetRuleID()));
444 
445  if (!hasIDlayer)
446  {
447  auto identifiable = dynamic_cast<const Identifiable *>(destination);
448 
449  if (!identifiable)
450  { //This check and pass through to data is needed due to solve T25711. See Task for more information.
451  //This could be removed at the point we can get rid of DataNodes or they get realy transparent.
452  auto node = dynamic_cast<const DataNode*>(destination);
453  if (node && node->GetData())
454  {
455  identifiable = dynamic_cast<const Identifiable *>(node->GetData());
456  }
457  }
458 
459  if (identifiable)
460  {
461  auto destUIDKey =
462  PropertyKeyPathToPropertyName(GetRootKeyPath().AddElement(instanceID).AddElement("destinationUID"));
463  source->SetProperty(destUIDKey, mitk::StringProperty::New(identifiable->GetUID()));
464  }
465  }
466 
467  if (!hasDatalayer)
468  {
469  this->Connect_datalayer(source, destination, instanceID);
470  }
471 
472  return relationUID;
473 };
474 
476 {
477  try
478  {
479  const auto relationUIDs = this->GetRelationUIDs(source, destination);
480  for (const auto relUID: relationUIDs)
481  {
482  this->Disconnect(source, relUID);
483  }
484  }
485  catch (const NoPropertyRelationException &)
486  {
487  // nothing to do and no real error in context of disconnect.
488  }
489 };
490 
492 {
493  auto instanceID = this->GetInstanceIDByRelationUID(source, relationUID);
494 
495  if (instanceID != NULL_INSTANCE_ID())
496  {
497  this->Disconnect_datalayer(source, instanceID);
498 
499  auto instancePrefix = PropertyKeyPathToPropertyName(GetRootKeyPath().AddElement(instanceID));
500 
501  //workaround until T24729 is done. You can use directly source->GetPropertyKeys again, when fixed.
502  const auto keys = GetPropertyKeys(source);
503  //end workaround for T24729
504 
505 
506  for (const auto &key : keys)
507  {
508  if (key.find(instancePrefix) == 0)
509  {
510  source->RemoveProperty(key);
511  }
512  }
513  }
514 };
515 
516 mitk::PropertyRelationRuleBase::RelationUIDType mitk::PropertyRelationRuleBase::CreateRelationUID()
517 {
518  UIDGenerator generator;
519  return generator.GetUID();
520 };
521 
526 std::mutex relationCreationLock;
527 
528 mitk::PropertyRelationRuleBase::InstanceIDType mitk::PropertyRelationRuleBase::CreateNewRelationInstance(
529  IPropertyOwner *source, const RelationUIDType &relationUID) const
530 {
531  std::lock_guard<std::mutex> guard(relationCreationLock);
532 
534  // Get all existing instanc IDs
535 
536  std::vector<int> instanceIDs;
537  InstanceIDType newID = "1";
538 
539  auto destRegExStr =
540  PropertyKeyPathToPropertyRegEx(this->GetRootKeyPath().AddAnyElement().AddElement("relationUID"));
541  auto regEx = std::regex(destRegExStr);
542  std::smatch instance_matches;
543 
544  //workaround until T24729 is done. You can use directly source->GetPropertyKeys again, when fixed.
545  const auto keys = GetPropertyKeys(source);
546  //end workaround for T24729
547 
548 
549  for (const auto &key : keys)
550  {
551  if (std::regex_search(key, instance_matches, regEx))
552  {
553  if (instance_matches.size()>1)
554  {
555  instanceIDs.push_back(std::stoi(instance_matches[1]));
556  }
557  }
558  }
559 
561  // Get new ID
562 
563  std::sort(instanceIDs.begin(), instanceIDs.end());
564  if (!instanceIDs.empty())
565  {
566  newID = std::to_string(instanceIDs.back() + 1);
567  }
568 
570  // reserve new ID
571  auto relUIDKey =
572  PropertyKeyPathToPropertyName(this->GetRootKeyPath().AddElement(newID).AddElement("relationUID"));
573  source->SetProperty(relUIDKey, mitk::StringProperty::New(relationUID));
574 
575  return newID;
576 };
577 
578 itk::LightObject::Pointer mitk::PropertyRelationRuleBase::InternalClone() const
579 {
580  return Superclass::InternalClone();
581 };
582 
583 
585 {
586  auto proppath = PropertyNameToPropertyKeyPath(propName);
587  auto ref = GetRootKeyPath();
588 
589  if (proppath.GetSize() < 3 || !(proppath.GetFirstNode() == ref.GetFirstNode()) || !(proppath.GetNode(1) == ref.GetNode(1)))
590  {
591  mitkThrow() << "Property name is not for a RII property or containes no instance ID. Wrong name: " << propName;
592  }
593 
594  return proppath.GetNode(2).name;
595 };
596 
598  const InstanceIDType &instanceID) const
599 {
600  if (!source)
601  {
602  mitkThrow() << "Error. Source is invalid. Cannot deduce rule ID";
603  }
604 
605  auto path = GetRootKeyPath().AddElement(instanceID).AddElement("ruleID");
606  auto name = PropertyKeyPathToPropertyName(path);
607 
608  const auto prop = source->GetConstProperty(name);
609 
610  std::string result;
611 
612  if (prop.IsNotNull())
613  {
614  result = prop->GetValueAsString();
615  }
616 
617  if (result.empty())
618  {
619  mitkThrowException(NoPropertyRelationException) << "Error. Source has no property relation with the passed instance ID. Instance ID: " << instanceID;
620  }
621 
622  return result;
623 };
624 
625 namespace mitk
626 {
632  class NodePredicateRuleFunction : public NodePredicateBase
633  {
634  public:
635  using FunctionType = std::function<bool(const mitk::IPropertyProvider *, const mitk::PropertyRelationRuleBase *)>;
636 
637  mitkClassMacro(NodePredicateRuleFunction, NodePredicateBase)
638  mitkNewMacro2Param(NodePredicateRuleFunction, const FunctionType &, PropertyRelationRuleBase::ConstPointer)
639 
640  ~NodePredicateRuleFunction() override = default;
641 
642  bool CheckNode(const mitk::DataNode *node) const override
643  {
644  if (!node)
645  {
646  return false;
647  }
648 
649  return m_Function(node, m_Rule);
650  };
651 
652  protected:
653  explicit NodePredicateRuleFunction(const FunctionType &function, PropertyRelationRuleBase::ConstPointer rule) : m_Function(function), m_Rule(rule)
654  {
655  };
656 
657  FunctionType m_Function;
659  };
660 
661 } // namespace mitk
662 
664 {
665  auto check = [](const mitk::IPropertyProvider *node, const mitk::PropertyRelationRuleBase *rule) {
666  return rule->IsSourceCandidate(node);
667  };
668 
669  return NodePredicateRuleFunction::New(check, this).GetPointer();
670 };
671 
673 {
674  auto check = [](const mitk::IPropertyProvider *node, const mitk::PropertyRelationRuleBase *rule) {
675  return rule->IsDestinationCandidate(node);
676  };
677 
678  return NodePredicateRuleFunction::New(check, this).GetPointer();
679 };
680 
682 {
683  auto check = [](const mitk::IPropertyProvider *node, const mitk::PropertyRelationRuleBase *rule)
684  {
685  return rule->IsSource(node);
686  };
687 
688  return NodePredicateRuleFunction::New(check, this).GetPointer();
689 };
690 
692  const IPropertyProvider *destination, RelationType minimalRelation) const
693 {
694  if (!destination)
695  {
696  mitkThrow() << "Error. Passed destination pointer is NULL";
697  }
698 
699  auto check = [destination, minimalRelation](const mitk::IPropertyProvider *node,
700  const mitk::PropertyRelationRuleBase *rule) {
701  return rule->HasRelation(node, destination) >= minimalRelation;
702  };
703 
704  return NodePredicateRuleFunction::New(check, this).GetPointer();
705 };
706 
708  const IPropertyProvider *source, RelationType minimalRelation) const
709 {
710  if (!source)
711  {
712  mitkThrow() << "Error. Passed source pointer is NULL";
713  }
714 
715  auto check = [source, minimalRelation](const mitk::IPropertyProvider *node,
716  const mitk::PropertyRelationRuleBase *rule) {
717  return rule->HasRelation(source, node) >= minimalRelation;
718  };
719 
720  return NodePredicateRuleFunction::New(check, this).GetPointer();
721 };
722 
724  const IPropertyProvider *source, RelationUIDType relationUID) const
725 {
726  if (!source)
727  {
728  mitkThrow() << "Error. Passed source pointer is NULL";
729  }
730 
731  auto relUIDs = this->GetExistingRelations(source);
732  if (std::find(relUIDs.begin(), relUIDs.end(), relationUID) == relUIDs.end())
733  {
734  mitkThrow()
735  << "Error. Passed relationUID does not identify a relation instance of the passed source for this rule instance.";
736  };
737 
738  auto check = [source, relationUID](const mitk::IPropertyProvider *node, const mitk::PropertyRelationRuleBase *rule) {
739  try
740  {
741  auto relevantUIDs = rule->GetRelationUIDs(source, node);
742  for (const auto& aUID : relevantUIDs)
743  {
744  if (aUID == relationUID)
745  {
746  return true;
747  }
748  }
749  }
750  catch(const NoPropertyRelationException &)
751  {
752  return false;
753  }
754  return false;
755  };
756 
757  return NodePredicateRuleFunction::New(check, this).GetPointer();
758 };
virtual RuleIDType GetRuleID() const =0
NodePredicateBase::ConstPointer GetSourceCandidateIndicator() const
std::mutex relationCreationLock
MITKCORE_EXPORT std::string PropertyKeyPathToPropertyName(const PropertyKeyPath &tagPath)
Generated unique IDs.
NodePredicateBase::ConstPointer GetConnectedSourcesDetector() const
virtual void Disconnect_datalayer(IPropertyOwner *source, const InstanceIDType &instanceID) const =0
NodePredicateBase::ConstPointer GetDestinationCandidateIndicator() const
RelationUIDType GetRelationUID(const IPropertyProvider *source, const IPropertyProvider *destination) const
virtual bool IsSupportedRuleID(const RuleIDType &ruleID) const
virtual InstanceIDVectorType GetInstanceID_datalayer(const IPropertyProvider *source, const IPropertyProvider *destination) const =0
DataCollection - Class to facilitate loading/accessing structured data.
PropertyKeyPath & AddElement(const ElementNameType &name)
InstanceIDVectorType GetInstanceID_IDLayer(const IPropertyProvider *source, const IPropertyProvider *destination) const
NodePredicateBase::ConstPointer GetDestinationDetector(const IPropertyProvider *source, RelationUIDType relationUID) const
virtual BaseProperty::ConstPointer GetConstProperty(const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=true) const =0
Get property by its key.
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:85
RelationUIDType Connect(IPropertyOwner *source, const IPropertyProvider *destination) const
std::string GetRIIPropertyRegEx(const std::string propName="", const InstanceIDType &instanceID="") const
virtual void Connect_datalayer(IPropertyOwner *source, const IPropertyProvider *destination, const InstanceIDType &instanceID) const =0
RelationUIDType GetRelationUIDByInstanceID(const IPropertyProvider *source, const InstanceIDType &instanceID) const
InstanceIDType GetInstanceIDByRelationUID(const IPropertyProvider *source, const RelationUIDType &relationUID) const
RelationUIDVectorType GetExistingRelations(const IPropertyProvider *source) const
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
#define MITK_WARN
Definition: mitkLogMacros.h:19
virtual void RemoveProperty(const std::string &propertyKey, const std::string &contextName="", bool fallBackOnDefaultContext=false)=0
Removes a property. If the property does not exist, nothing will be done.
virtual std::vector< std::string > GetPropertyKeys(const std::string &contextName="", bool includeDefaultContext=false) const =0
Query keys of existing properties.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
#define mitkThrow()
MITKCORE_EXPORT PropertyKeyPath PropertyNameToPropertyKeyPath(const std::string &propertyName)
void Disconnect(IPropertyOwner *source, const IPropertyProvider *destination) const
static std::vector< std::string > GetPropertyKeys(const mitk::IPropertyProvider *owner)
NodePredicateBase::ConstPointer GetDestinationsDetector(const IPropertyProvider *source, RelationType minimalRelation=RelationType::Implicit_Data) const
std::vector< RelationUIDType > RelationUIDVectorType
#define mitkThrowException(classname)
virtual bool HasImplicitDataRelation(const IPropertyProvider *source, const IPropertyProvider *destination) const =0
itk::LightObject::Pointer InternalClone() const override
virtual bool IsSourceCandidate(const IPropertyProvider *owner) const
static InstanceIDType GetInstanceIDByPropertyName(const std::string propName)
RuleIDType GetRuleIDByInstanceID(const IPropertyProvider *source, const InstanceIDType &instanceID) const
Interface for evaluation conditions used in the DataStorage class GetSubset() method.
std::vector< InstanceIDType > InstanceIDVectorType
RelationType HasRelation(const IPropertyProvider *source, const IPropertyProvider *destination) const
NodePredicateBase::ConstPointer GetSourcesDetector(const IPropertyProvider *destination, RelationType minimalRelation=RelationType::Implicit_Data) const
Class that can be used to specify nested or wild carded property keys. E.g. for the use in context of...
Base class of identifiable objects.
static Pointer New()
MITKCORE_EXPORT std::string PropertyKeyPathToPropertyRegEx(const PropertyKeyPath &tagPath)
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57
bool IsSource(const IPropertyProvider *owner) const
virtual void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false)=0
Add new or change existent property.
RelationUIDVectorType GetRelationUIDs(const IPropertyProvider *source, const IPropertyProvider *destination) const
virtual bool IsDestinationCandidate(const IPropertyProvider *owner) const