Medical Imaging Interaction Toolkit  2023.12.99-7a59bd54
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 mitkSourceImageRelationRule_h
14 #define mitkSourceImageRelationRule_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
mitk::PropertyRelationRuleBase::DataRelationUIDVectorType
std::vector< std::pair< RelationUIDType, RuleIDType > > DataRelationUIDVectorType
Definition: mitkPropertyRelationRuleBase.h:286
mitkNewMacro2Param
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:81
mitkImage.h
mitk::PropertyRelationRuleBase::RuleIDType
std::string RuleIDType
Definition: mitkPropertyRelationRuleBase.h:81
mitk::PropertyRelationRuleBase
Definition: mitkPropertyRelationRuleBase.h:74
mitkNewMacro1Param
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:68
mitk::PropertyKeyPath::ItemSelectionIndex
std::size_t ItemSelectionIndex
Definition: mitkPropertyKeyPath.h:54
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
mitk::PropertyRelationRuleBase::InstanceIDType
std::string InstanceIDType
Definition: mitkPropertyRelationRuleBase.h:100
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::PropertyRelationRuleBase::InstanceIDVectorType
std::vector< InstanceIDType > InstanceIDVectorType
Definition: mitkPropertyRelationRuleBase.h:270
mitk::PropertyRelationRuleBase::RelationUIDType
Identifiable::UIDType RelationUIDType
Definition: mitkPropertyRelationRuleBase.h:82
mitk::SourceImageRelationRule
Definition: mitkSourceImageRelationRule.h:44
mitk::PropertyRelationRuleBase::RelationUIDVectorType
std::vector< RelationUIDType > RelationUIDVectorType
Definition: mitkPropertyRelationRuleBase.h:83
mitkPropertyRelationRuleBase.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::IPropertyProvider
Definition: mitkIPropertyProvider.h:24
mitkNewMacro4Param
#define mitkNewMacro4Param(classname, typea, typeb, typec, typed)
Definition: mitkCommon.h:107
mitk::IPropertyOwner
Definition: mitkIPropertyOwner.h:22
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15