Medical Imaging Interaction Toolkit  2022.04.99-194dd5d8
Medical Imaging Interaction Toolkit
mitkSourceImageRelationRule.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 MITK_SOURCE_IMAGE_RELATION_RULE_H
14 #define MITK_SOURCE_IMAGE_RELATION_RULE_H
15 
17 #include "mitkImage.h"
18 
19 namespace mitk
20 {
45  {
46  public:
48  itkNewMacro(Self);
50  mitkNewMacro2Param(Self, const RuleIDType &, const std::string &);
51  mitkNewMacro4Param(Self, const RuleIDType &, const std::string &, const std::string &, const std::string &);
52 
56 
58  RuleIDType GetRuleID() const override;
59 
60  bool IsAbstract() const override;
61 
63  std::string GetDisplayName() const override;
64 
67  std::string GetSourceRoleName() const override;
70  std::string GetDestinationRoleName() const override;
71 
72  bool IsDestinationCandidate(const IPropertyProvider *owner) const override;
73 
77  RelationUIDType Connect(Image *source, const Image *destination) const;
78 
79  protected:
81  SourceImageRelationRule(const RuleIDType &purposeTag);
82  SourceImageRelationRule(const RuleIDType &purposeTag, const std::string &displayName);
83  SourceImageRelationRule(const RuleIDType &purposeTag,
84  const std::string &displayName,
85  const std::string &sourceRole,
86  const std::string &destinationRole);
87  ~SourceImageRelationRule() override = default;
88 
91 
94  std::vector<std::pair<size_t, std::string> > GetReferenceSequenceIndices(const IPropertyProvider * source,
95  const IPropertyProvider* destination = nullptr, InstanceIDVectorType ignoreInstances = {}) const;
96 
98  virtual DataRelationUIDVectorType GetRelationUIDs_DataLayer(const IPropertyProvider* source,
99  const IPropertyProvider* destination, const InstanceIDVectorType& instances_IDLayer) const override;
100 
101  void Connect_datalayer(IPropertyOwner *source,
102  const IPropertyProvider *destination,
103  const InstanceIDType &instanceID) const override;
104 
105  void Disconnect_datalayer(IPropertyOwner *source, const RelationUIDType& relationUID) const override;
106 
107  bool IsSupportedRuleID(const RuleIDType& ruleID) const override;
108 
109  itk::LightObject::Pointer InternalClone() const override;
110 
116  PropertyKeyPath::ItemSelectionIndex CreateNewSourceImageSequenceItem(IPropertyOwner *source) const;
117 
118  std::string GenerateRuleID(const std::string& purpose) const;
119 
120  private:
121  RuleIDType m_PurposeTag;
122  std::string m_DisplayName;
123  std::string m_SourceRole;
124  std::string m_DestinationRole;
125  };
126 
127 } // namespace mitk
128 
129 #endif
#define MITKCORE_EXPORT
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:68
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:81
#define mitkNewMacro4Param(classname, typea, typeb, typec, typed)
Definition: mitkCommon.h:107
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
Image class for storing images.
Definition: mitkImage.h:69
std::vcl_size_t ItemSelectionIndex
std::vector< RelationUIDType > RelationUIDVectorType
std::vector< std::pair< RelationUIDType, RuleIDType > > DataRelationUIDVectorType
std::vector< InstanceIDType > InstanceIDVectorType