Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 mitkGenericIDRelationRule_h
14 #define mitkGenericIDRelationRule_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 
93  std::vector<std::string> GetReferenceSequenceIndices(const IPropertyProvider * source,
94  const IPropertyProvider * destination = nullptr) const;
95 
106  InstanceIDVectorType GetInstanceID_datalayer(const IPropertyProvider *source,
107  const IPropertyProvider *destination) const override;
108 
116  bool HasImplicitDataRelation(const IPropertyProvider *source,
117  const IPropertyProvider *destination) const override;
118 
128  void Connect_datalayer(IPropertyOwner *source,
129  const IPropertyProvider *destination,
130  const InstanceIDType &instanceID) const override;
131 
138  void Disconnect_datalayer(IPropertyOwner *source, const InstanceIDType &instanceID) const override;
139 
140  bool IsSupportedRuleID(const RuleIDType& ruleID) const override;
141 
142  itk::LightObject::Pointer InternalClone() const override;
143 
149  PropertyKeyPath::ItemSelectionIndex CreateNewSourceImageSequenceItem(IPropertyOwner *source) const;
150 
151  private:
152  RuleIDType m_PurposeTag;
153  std::string m_DisplayName;
154  std::string m_SourceRole;
155  std::string m_DestinationRole;
156  };
157 
158 } // namespace mitk
159 
160 #endif
#define MITKCORE_EXPORT
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:72
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:85
#define mitkNewMacro4Param(classname, typea, typeb, typec, typed)
Definition: mitkCommon.h:111
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Image class for storing images.
Definition: mitkImage.h:72
std::vcl_size_t ItemSelectionIndex
std::vector< RelationUIDType > RelationUIDVectorType
std::vector< InstanceIDType > InstanceIDVectorType