Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitk::PropertyRelationRuleBase Class Referenceabstract

#include <mitkPropertyRelationRuleBase.h>

Inheritance diagram for mitk::PropertyRelationRuleBase:
Collaboration diagram for mitk::PropertyRelationRuleBase:

Public Types

enum  RelationType { RelationType::None, RelationType::Implicit_Data, RelationType::Connected_Data, RelationType::Connected_ID }
 
typedef PropertyRelationRuleBase Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
using RuleIDType = std::string
 
using RelationUIDType = Identifiable::UIDType
 
using RelationUIDVectorType = std::vector< RelationUIDType >
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
 itkCreateAnotherMacro (Self)
 
virtual RuleIDType GetRuleID () const =0
 
virtual std::string GetDisplayName () const =0
 
virtual std::string GetSourceRoleName () const =0
 
virtual std::string GetDestinationRoleName () const =0
 
virtual bool IsAbstract () const
 
virtual bool IsSourceCandidate (const IPropertyProvider *owner) const
 
virtual bool IsDestinationCandidate (const IPropertyProvider *owner) const
 
bool IsSource (const IPropertyProvider *owner) const
 
RelationType HasRelation (const IPropertyProvider *source, const IPropertyProvider *destination) const
 
RelationUIDVectorType GetExistingRelations (const IPropertyProvider *source) const
 
RelationUIDVectorType GetRelationUIDs (const IPropertyProvider *source, const IPropertyProvider *destination) const
 
RelationUIDType GetRelationUID (const IPropertyProvider *source, const IPropertyProvider *destination) const
 
NodePredicateBase::ConstPointer GetSourceCandidateIndicator () const
 
NodePredicateBase::ConstPointer GetDestinationCandidateIndicator () const
 
NodePredicateBase::ConstPointer GetConnectedSourcesDetector () const
 
NodePredicateBase::ConstPointer GetSourcesDetector (const IPropertyProvider *destination, RelationType minimalRelation=RelationType::Implicit_Data) const
 
NodePredicateBase::ConstPointer GetDestinationsDetector (const IPropertyProvider *source, RelationType minimalRelation=RelationType::Implicit_Data) const
 
NodePredicateBase::ConstPointer GetDestinationDetector (const IPropertyProvider *source, RelationUIDType relationUID) const
 
void Disconnect (IPropertyOwner *source, const IPropertyProvider *destination) const
 
void Disconnect (IPropertyOwner *source, RelationUIDType relationUID) const
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
static PropertyKeyPath GetRootKeyPath ()
 

Protected Types

using InstanceIDType = std::string
 
using InstanceIDVectorType = std::vector< InstanceIDType >
 

Protected Member Functions

 PropertyRelationRuleBase ()=default
 
 ~PropertyRelationRuleBase () override=default
 
InstanceIDVectorType GetInstanceID_IDLayer (const IPropertyProvider *source, const IPropertyProvider *destination) const
 
virtual InstanceIDVectorType GetInstanceID_datalayer (const IPropertyProvider *source, const IPropertyProvider *destination) const =0
 
virtual bool HasImplicitDataRelation (const IPropertyProvider *source, const IPropertyProvider *destination) const =0
 
RelationUIDType GetRelationUIDByInstanceID (const IPropertyProvider *source, const InstanceIDType &instanceID) const
 
InstanceIDType GetInstanceIDByRelationUID (const IPropertyProvider *source, const RelationUIDType &relationUID) const
 
RelationUIDType Connect (IPropertyOwner *source, const IPropertyProvider *destination) const
 
virtual void Connect_datalayer (IPropertyOwner *source, const IPropertyProvider *destination, const InstanceIDType &instanceID) const =0
 
virtual void Disconnect_datalayer (IPropertyOwner *source, const InstanceIDType &instanceID) const =0
 
virtual bool IsSupportedRuleID (const RuleIDType &ruleID) const
 
std::string GetRIIPropertyRegEx (const std::string propName="", const InstanceIDType &instanceID="") const
 
RuleIDType GetRuleIDByInstanceID (const IPropertyProvider *source, const InstanceIDType &instanceID) const
 
itk::LightObject::Pointer InternalClone () const override
 

Static Protected Member Functions

static InstanceIDType NULL_INSTANCE_ID ()
 
static InstanceIDType GetInstanceIDByPropertyName (const std::string propName)
 
static std::vector< std::string > GetPropertyKeys (const mitk::IPropertyProvider *owner)
 

Detailed Description

Base class to standardize/abstract/encapsulate rules and business logic to detect and define (property/data based) relations in MITK. Following important definitions must be regarded when using/implementing/specifing rule classes:

  • Releations represented by rules are directed relations that point from a source IPropertyOwner (Source) to a destination IPropertyOwner (Destination).
  • Rule can be abstract (indicated by IsAbstract()) or concrete. Abstract rules cannot be used to connect relations. Abstract rules can only be used to detect/indicate or disconnect relations. Therefore, in contrast to concrete rules, abstract rules can be used to indicate several relations that are established be "derived" rules. See e.g. GenericIDRelationRule: in its abstract state it cannot connect but be used to detect any type of generic ID relation.
  • A concrete rule ID (rule ID of a concrete rule) always "implements" a concrete relation type. E.g. In DICOM the way to express the source image relation to an input image and to a mask would be nearly the same and only differs by the encoded purpose. One may implement an interim or joined class that manages the mutual stuff, but the registered instances must be one concrete rule for "DICOM source input image" and one concrete rule for "DICOM source mask" and both rules must have distinct rule IDs.
  • Source may have several relations of a rule to different Destinations. Destination may have several relations of a rule from different Sources. But a specific source destination pair may have only one relation of a specific rule id (concrete rule). A specific source destination pair may however have multiple relations for an abstract rule.
  • The deletion of a Destination in the storage does not remove the relation implicitly. It becomes a "zombie" relation but it should still be documented, even if the destination is unknown. One has to explicitly disconnect a zombie relation to get rid of it.
  • Each relation has its own UID (relationUID) that can be used to address it.

The basic concept of the rule design is that we have two layers of relation identification: Layer 1 is the ID-layer which uses the IIdentifiable interface and UIDs if available to encode "hard" relations. Layer 2 is the Data-layer which uses the properties of Source and Destination to deduce if there is a relation of the rule type. The ID-layer is completely implemented by this base class. The base class only falls back to the Data-layer (implemented by the concrete rule class) if the ID-layer is not sufficient or it is explicitly stated. Reasons for the introduction of the ID-layer are: 1st, data-defined relations may be weak (several Destinations are possible; e.g. DICOM source images may point to several loaded mitk images). But if explicitly a relation was connected it should be deduceable. 2nd, checks on a UID are faster then unnecessary data deduction.

Rules use relation instance identifing (RII) properties in order to manage their relations that are stored in the Source. The RII-properties follow the following naming schema: "MITK.Relations.<InstanceID>.<RuleID>.[relationUID|destinationUID|ruleID|<data-layer-specific>]"

  • <InstanceID>: The unique index of the relation for the Source. Used to assign/group the properties to their relation. In the default implementation of this class the instance id is an positive integer (i>0).
  • relationUID: The UID of the relation. Set by the ID-layer (so by this class)
  • destinationUID: The UID of the Destination. Set by the ID-layer (so by this class) if Destination implements IIdentifiable.
  • ruleID: The identifier of the concrete rule that sets the property. Is specified by the derived class and set automaticaly be this base class.
  • <data-layer-specific>: Information needed by the Data-layer (so derived classes) to find the relationUID

Definition at line 73 of file mitkPropertyRelationRuleBase.h.

Member Typedef Documentation

◆ ConstPointer

◆ InstanceIDType

using mitk::PropertyRelationRuleBase::InstanceIDType = std::string
protected

Definition at line 211 of file mitkPropertyRelationRuleBase.h.

◆ InstanceIDVectorType

◆ Pointer

◆ RelationUIDType

◆ RelationUIDVectorType

◆ RuleIDType

Definition at line 80 of file mitkPropertyRelationRuleBase.h.

◆ Self

◆ Superclass

Definition at line 76 of file mitkPropertyRelationRuleBase.h.

Member Enumeration Documentation

◆ RelationType

Enum class for different types of relations.

Enumerator
None 

Two IPropertyOwner have no relation under the rule.

Implicit_Data 

Two IPropertyOwner have a relation, but it is only deduced from the Data-layer and they were never explicitly connected.

Connected_Data 

Two IPropertyOwner have a relation and there where connected on the Data-layer (so a bit "weaker" as ID). Reasons for the missing ID connection could be that Destintination has not IIdentifiable implemented.

Connected_ID 

Two IPropertyOwner have a relation and are fully explictly connected.

Definition at line 85 of file mitkPropertyRelationRuleBase.h.

Constructor & Destructor Documentation

◆ PropertyRelationRuleBase()

mitk::PropertyRelationRuleBase::PropertyRelationRuleBase ( )
protecteddefault

◆ ~PropertyRelationRuleBase()

mitk::PropertyRelationRuleBase::~PropertyRelationRuleBase ( )
overrideprotecteddefault

Member Function Documentation

◆ Clone()

Pointer mitk::PropertyRelationRuleBase::Clone ( ) const

◆ Connect()

mitk::PropertyRelationRuleBase::RelationUIDType mitk::PropertyRelationRuleBase::Connect ( IPropertyOwner source,
const IPropertyProvider destination 
) const
protected

Explicitly connects the passed instances. Afterwards they have a relation of Connected_Data or Connected_ID (if a destination implements IIdentifiable). If the passed instance are already connected the old connection will be overwritten (and raised to the highest possible connection level).

Remarks
This method has protected visibility in the base implementation, because it is a design decision of derived rule classes which interface they want to offer for connecting. It may just be made public (e.g. GenericIDRelationRule) or used by own implementations.
Precondition
source must be a valid instance.
destination must be a valid instance.
the rule instance must not be abstract.
Returns
Return the relation uid of the relation connected by this method call

Definition at line 386 of file mitkPropertyRelationRuleBase.cpp.

References Connect_datalayer(), GetInstanceID_datalayer(), GetInstanceID_IDLayer(), GetRootKeyPath(), GetRuleID(), IsAbstract(), MITK_WARN, mitkThrow, mitk::StringProperty::New(), mitk::PropertyKeyPathToPropertyName(), and mitk::IPropertyOwner::SetProperty().

Referenced by mitk::GenericIDRelationRule::Connect(), and mitk::SourceImageRelationRule::Connect().

◆ Connect_datalayer()

virtual void mitk::PropertyRelationRuleBase::Connect_datalayer ( IPropertyOwner source,
const IPropertyProvider destination,
const InstanceIDType instanceID 
) const
protectedpure virtual

Is called by Connect() to ensure that source has correctly set properties to resemble the relation on the data layer. This means that the method should set the properties that describe and encode the relation on the data layer (data-layer-specific relation properties). If the passed instance are already connected, the old settings should be overwritten. Connect() will ensure that source and destination are valid pointers.

Parameters
instanceIDis the ID for the relation instance that should be connected. Existance of the relation instance is ensured.
Precondition
source must be a valid instance.
destination must be a valid instance.

Implemented in mitk::SourceImageRelationRule, and mitk::GenericIDRelationRule.

Referenced by Connect().

◆ Disconnect() [1/2]

void mitk::PropertyRelationRuleBase::Disconnect ( IPropertyOwner source,
const IPropertyProvider destination 
) const

Disconnect the passed instances. Afterwards they have a relation of None or Implicit_Data. All RII-properties in the source for the passed destination will be removed.

Precondition
source must be a valid instance.
destination must be a valid instance.

Definition at line 475 of file mitkPropertyRelationRuleBase.cpp.

References GetRelationUIDs().

◆ Disconnect() [2/2]

void mitk::PropertyRelationRuleBase::Disconnect ( IPropertyOwner source,
RelationUIDType  relationUID 
) const

Disconnect the source from the passed relationUID (usefull for "zombie relations"). All RII-properties in the source for the passed relationUID will be removed. If the relationUID is not part of the source. Nothing will be changed.

Precondition
source must be a valid instance.

Definition at line 491 of file mitkPropertyRelationRuleBase.cpp.

References Disconnect_datalayer(), GetInstanceIDByRelationUID(), GetPropertyKeys(), GetRootKeyPath(), mitk::UIDGenerator::GetUID(), NULL_INSTANCE_ID(), mitk::PropertyKeyPathToPropertyName(), and mitk::IPropertyOwner::RemoveProperty().

◆ Disconnect_datalayer()

virtual void mitk::PropertyRelationRuleBase::Disconnect_datalayer ( IPropertyOwner source,
const InstanceIDType instanceID 
) const
protectedpure virtual

This method is called by Disconnect() to remove all properties of the relation from the source that are set by Connect_datalayer().

Remarks
All RII-properties of this relation will removed by Disconnect() after this method call. If the relationUID is not part of the source. Nothing will be changed. Disconnect() ensures that source is a valid pointer if called.
Disconnect() ensures that sourece is valid and only invokes if instance exists.

Implemented in mitk::SourceImageRelationRule, and mitk::GenericIDRelationRule.

Referenced by Disconnect().

◆ GetClassHierarchy()

virtual std::vector<std::string> mitk::PropertyRelationRuleBase::GetClassHierarchy ( ) const
inlinevirtual

◆ GetClassName()

virtual const char* mitk::PropertyRelationRuleBase::GetClassName ( ) const
virtual

◆ GetConnectedSourcesDetector()

mitk::NodePredicateBase::ConstPointer mitk::PropertyRelationRuleBase::GetConnectedSourcesDetector ( ) const

Predicate that can be used to find nodes that are Sources of that rule and explicitly connected. Thus all nodes where IsSource() returns true.

Definition at line 681 of file mitkPropertyRelationRuleBase.cpp.

◆ GetDestinationCandidateIndicator()

mitk::NodePredicateBase::ConstPointer mitk::PropertyRelationRuleBase::GetDestinationCandidateIndicator ( ) const

Predicate that can be used to find nodes that qualify as destination for that rule (but must not be a destination yet). Thus all nodes where IsDestinationCandidate() returns true.

Definition at line 672 of file mitkPropertyRelationRuleBase.cpp.

◆ GetDestinationDetector()

mitk::NodePredicateBase::ConstPointer mitk::PropertyRelationRuleBase::GetDestinationDetector ( const IPropertyProvider source,
RelationUIDType  relationUID 
) const

Returns a predicate that can be used to find the Destination of the passed Source for a given relationUID.

Parameters
sourcePointer to the Source instance that should be used for detection.
minimalRelationDefines the minimal strength of the relation type that should be detected.
Precondition
source must be a valid instance.
relationUID must identify a relation of the passed source and rule. (This must be in the return of this->GetExistingRelations(source).

Definition at line 723 of file mitkPropertyRelationRuleBase.cpp.

References GetExistingRelations(), and mitkThrow.

◆ GetDestinationRoleName()

virtual std::string mitk::PropertyRelationRuleBase::GetDestinationRoleName ( ) const
pure virtual

Returns a human readable string that can be used to describe the role of a destionation in context of the rule instance.

Implemented in mitk::SourceImageRelationRule, and mitk::GenericIDRelationRule.

◆ GetDestinationsDetector()

mitk::NodePredicateBase::ConstPointer mitk::PropertyRelationRuleBase::GetDestinationsDetector ( const IPropertyProvider source,
RelationType  minimalRelation = RelationType::Implicit_Data 
) const

Predicate that can be used to find nodes that are as Destination related to the passed Source under the rule

Parameters
sourcePointer to the Source instance that should be used for detection.
minimalRelationDefines the minimal strength of the relation type that should be detected.
Precondition
Destination must be a valid instance.

Definition at line 707 of file mitkPropertyRelationRuleBase.cpp.

References mitkThrow.

◆ GetDisplayName()

virtual std::string mitk::PropertyRelationRuleBase::GetDisplayName ( ) const
pure virtual

Returns a human readable string that can be used to describe the rule. Does not need to be unique.

Implemented in mitk::SourceImageRelationRule, and mitk::GenericIDRelationRule.

◆ GetExistingRelations()

mitk::PropertyRelationRuleBase::RelationUIDVectorType mitk::PropertyRelationRuleBase::GetExistingRelations ( const IPropertyProvider source) const

Returns a vector of relation UIDs for all relations of this rule instance that are defined for the passed source (so relations of type Connected_Data and Connected_ID).

Precondition
source must be a pointer to a valid IPropertyOwner instance.

Definition at line 170 of file mitkPropertyRelationRuleBase.cpp.

References mitk::IPropertyProvider::GetConstProperty(), GetInstanceIDByPropertyName(), GetPropertyKeys(), GetRelationUIDByInstanceID(), GetRIIPropertyRegEx(), IsSupportedRuleID(), and mitkThrow.

Referenced by GetDestinationDetector().

◆ GetInstanceID_datalayer()

virtual InstanceIDVectorType mitk::PropertyRelationRuleBase::GetInstanceID_datalayer ( const IPropertyProvider source,
const IPropertyProvider destination 
) const
protectedpure virtual

Is called if an instance ID cannot be deduced on the ID-layer. Implement this method to check which existing relation(s) as Connected_Data exists between both passed instances. If the passed instances have no explicit relation of type Connected_Data, an empty vector will be returned.

Remarks
Per definition of property relation rules only 0 or 1 instance should be found for one provider pair and concrete rule. But for 2 reasons there might be more then one instanceID: 1) the rule is abstract and supports multiple rule IDs. 2) the data layer may be ambiguous and therefore multiple relation instances of the rule instance could match. The implementation of this function should report all relation instances. The calling function will take care.
Precondition
source must be a pointer to a valid IPropertyProvider instance.
destination must be a pointer to a valid IPropertyProvider instance.

Implemented in mitk::SourceImageRelationRule, and mitk::GenericIDRelationRule.

Referenced by Connect(), GetRelationUIDs(), and HasRelation().

◆ GetInstanceID_IDLayer()

mitk::PropertyRelationRuleBase::InstanceIDVectorType mitk::PropertyRelationRuleBase::GetInstanceID_IDLayer ( const IPropertyProvider source,
const IPropertyProvider destination 
) const
protected

Returns the instance IDs for the passed source and destination for this rule instance. If the passed source and destination instances has no explicit relation on the ID layer (Connected_ID), an empty vector will be returned.

Remarks
Per definition of property relation rules only 0 or 1 instance should be found for one provider pair and concrete rule. But for there might be more then one instanceID, because the rule is abstract and supports multiple rule IDs. 2) the data layer may be ambiguous and therefore multiple relation instances of the rule instance could match. The implementation of this function should report all relation instances. The calling function will take care.
Precondition
source must be a pointer to a valid IPropertyProvider instance.
destination must be a pointer to a valid IPropertyProvider instance.

Definition at line 324 of file mitkPropertyRelationRuleBase.cpp.

References mitk::IPropertyProvider::GetConstProperty(), GetPropertyKeys(), GetRIIPropertyRegEx(), GetRuleIDByInstanceID(), IsSupportedRuleID(), and mitkThrow.

Referenced by Connect(), GetRelationUIDs(), and HasRelation().

◆ GetInstanceIDByPropertyName()

mitk::PropertyRelationRuleBase::InstanceIDType mitk::PropertyRelationRuleBase::GetInstanceIDByPropertyName ( const std::string  propName)
staticprotected

Helper function that deduces the instance ID out of a property name. If it cannot be deduced an MITK exception is thrown.

Definition at line 584 of file mitkPropertyRelationRuleBase.cpp.

References GetRootKeyPath(), mitkThrow, and mitk::PropertyNameToPropertyKeyPath().

Referenced by GetExistingRelations(), and mitk::SourceImageRelationRule::GetInstanceID_datalayer().

◆ GetInstanceIDByRelationUID()

mitk::PropertyRelationRuleBase::InstanceIDType mitk::PropertyRelationRuleBase::GetInstanceIDByRelationUID ( const IPropertyProvider source,
const RelationUIDType relationUID 
) const
protected

Helper function that deduces the relation instance ID given the relation UID. If it cannot be deduced an NoPropertyRelationException is thrown.

Definition at line 286 of file mitkPropertyRelationRuleBase.cpp.

References mitk::IPropertyProvider::GetConstProperty(), GetPropertyKeys(), GetRootKeyPath(), mitkThrow, NULL_INSTANCE_ID(), and mitk::PropertyKeyPathToPropertyRegEx().

Referenced by Disconnect().

◆ GetPropertyKeys()

◆ GetRelationUID()

mitk::PropertyRelationRuleBase::RelationUIDType mitk::PropertyRelationRuleBase::GetRelationUID ( const IPropertyProvider source,
const IPropertyProvider destination 
) const

Returns the relation UID for the passed source and destination of this rule instance. If the passed instances have no explicit relation (so of type Connected_Data or Connected_ID), no ID can be deduced and an exception will be thrown. If more then one relation is found, also an exception will be thrown. Thus only use this convinience method, if you are sure that one(!) relation UID can exist.

Precondition
source must be a pointer to a valid IPropertyOwner instance.
destination must be a pointer to a valid IPropertyOwner instance.
Source and destination have one relation of type Connected_Data or Connected_ID; otherwise if no relation exists a NoPropertyRelationException is thrown; if more than one relation exists a default MITK expception is thrown.

Definition at line 241 of file mitkPropertyRelationRuleBase.cpp.

References GetRelationUIDs(), mitkThrow, and mitkThrowException.

◆ GetRelationUIDByInstanceID()

mitk::PropertyRelationRuleBase::RelationUIDType mitk::PropertyRelationRuleBase::GetRelationUIDByInstanceID ( const IPropertyProvider source,
const InstanceIDType instanceID 
) const
protected

Helper function that deduces the relation UID of the given relation instance. If it cannot be deduced an NoPropertyRelationException is thrown.

Definition at line 262 of file mitkPropertyRelationRuleBase.cpp.

References mitk::IPropertyProvider::GetConstProperty(), GetRootKeyPath(), mitkThrowException, NULL_INSTANCE_ID(), and mitk::PropertyKeyPathToPropertyName().

Referenced by GetExistingRelations(), and GetRelationUIDs().

◆ GetRelationUIDs()

mitk::PropertyRelationRuleBase::RelationUIDVectorType mitk::PropertyRelationRuleBase::GetRelationUIDs ( const IPropertyProvider source,
const IPropertyProvider destination 
) const

Returns the relation UID(s) for the passed source and destination of this rule instance. If the rule is abstract multiple relation UIDs might be returned. In case of concrete rule only one relation UID. If the passed instances have no explicit relation (so of type Connected_Data or Connected_ID), no ID can be deduced and an empty relation UID vector is returned.

Precondition
source must be a pointer to a valid IPropertyOwner instance.
destination must be a pointer to a valid IPropertyOwner instance.

Definition at line 204 of file mitkPropertyRelationRuleBase.cpp.

References GetInstanceID_datalayer(), GetInstanceID_IDLayer(), GetRelationUIDByInstanceID(), IsAbstract(), and mitkThrow.

Referenced by Disconnect(), and GetRelationUID().

◆ GetRIIPropertyRegEx()

std::string mitk::PropertyRelationRuleBase::GetRIIPropertyRegEx ( const std::string  propName = "",
const InstanceIDType instanceID = "" 
) const
protected

Helper function that generates a reg ex that can be used to find a specific RII property for the rule instance.

Parameters
propNameIf not empty a PropertyPath element will added (with the passed value) after the <RuleID> element.
instanceIDIf not empty only for the reg ex will only valid for the passed instanceID. Otherwise for all.

Definition at line 50 of file mitkPropertyRelationRuleBase.cpp.

References GetRootKeyPath(), and mitk::PropertyKeyPathToPropertyRegEx().

Referenced by GetExistingRelations(), mitk::SourceImageRelationRule::GetInstanceID_datalayer(), GetInstanceID_IDLayer(), and IsSource().

◆ GetRootKeyPath()

◆ GetRuleID()

virtual RuleIDType mitk::PropertyRelationRuleBase::GetRuleID ( ) const
pure virtual

Returns an ID string that identifies the rule class.

Postcondition
The returned rule ID must met the preconditions of a PropertyKeyPath element name (see mitk::PropertyKeyPath

Implemented in mitk::SourceImageRelationRule, and mitk::GenericIDRelationRule.

Referenced by mitk::PropertyRelations::AddRule(), Connect(), and IsSupportedRuleID().

◆ GetRuleIDByInstanceID()

mitk::PropertyRelationRuleBase::RuleIDType mitk::PropertyRelationRuleBase::GetRuleIDByInstanceID ( const IPropertyProvider source,
const InstanceIDType instanceID 
) const
protected

Helper function that retrives the rule ID of a relation instance of a passed source.

Precondition
source must be valid.
source must have a relation instance with this ID

Definition at line 597 of file mitkPropertyRelationRuleBase.cpp.

References mitk::PropertyKeyPath::AddElement(), mitk::IPropertyProvider::GetConstProperty(), GetRootKeyPath(), mitkClassMacro, mitkNewMacro2Param, mitkThrow, mitkThrowException, and mitk::PropertyKeyPathToPropertyName().

Referenced by mitk::SourceImageRelationRule::GetInstanceID_datalayer(), and GetInstanceID_IDLayer().

◆ GetSourceCandidateIndicator()

mitk::NodePredicateBase::ConstPointer mitk::PropertyRelationRuleBase::GetSourceCandidateIndicator ( ) const

Predicate that can be used to find nodes that qualify as source for that rule (but must not be a source yet). Thus all nodes where IsSourceCandidate() returns true.

Definition at line 663 of file mitkPropertyRelationRuleBase.cpp.

◆ GetSourceRoleName()

virtual std::string mitk::PropertyRelationRuleBase::GetSourceRoleName ( ) const
pure virtual

Returns a human readable string that can be used to describe the role of a source in context of the rule instance.

Implemented in mitk::SourceImageRelationRule, and mitk::GenericIDRelationRule.

◆ GetSourcesDetector()

mitk::NodePredicateBase::ConstPointer mitk::PropertyRelationRuleBase::GetSourcesDetector ( const IPropertyProvider destination,
RelationType  minimalRelation = RelationType::Implicit_Data 
) const

Predicate that can be used to find nodes that are as source related to the passed Destination under the rule

Parameters
destinationPointer to the Destination instance that should be used for detection.
minimalRelationDefines the minimal strength of the relation type that should be detected.
Precondition
Destination must be a valid instance.

Definition at line 691 of file mitkPropertyRelationRuleBase.cpp.

References mitkThrow.

◆ GetStaticNameOfClass()

static const char* mitk::PropertyRelationRuleBase::GetStaticNameOfClass ( )
inlinestatic

Definition at line 76 of file mitkPropertyRelationRuleBase.h.

◆ HasImplicitDataRelation()

virtual bool mitk::PropertyRelationRuleBase::HasImplicitDataRelation ( const IPropertyProvider source,
const IPropertyProvider destination 
) const
protectedpure virtual

Is called by HasRelation() if no relation of type Connected_ID (GetInstanceID_IDLayer()) or Connected_Data (GetInstanceID_datalayer()) is evident. Implement this method to deduce if the passed instances have a relation of type Implicit_Data.

Precondition
source must be a pointer to a valid IPropertyProvider instance.
destination must be a pointer to a valid IPropertyProvider instance.

Implemented in mitk::SourceImageRelationRule, and mitk::GenericIDRelationRule.

Referenced by HasRelation().

◆ HasRelation()

mitk::PropertyRelationRuleBase::RelationType mitk::PropertyRelationRuleBase::HasRelation ( const IPropertyProvider source,
const IPropertyProvider destination 
) const

Returns the relation type of the passed IPropertyOwner instances.

Precondition
source must be a pointer to a valid IPropertyProvider instance.
destination must be a pointer to a valid IPropertyProvider instance.

Definition at line 124 of file mitkPropertyRelationRuleBase.cpp.

References Connected_Data, Connected_ID, GetInstanceID_datalayer(), GetInstanceID_IDLayer(), HasImplicitDataRelation(), Implicit_Data, MITK_WARN, mitkThrow, None, and NULL_INSTANCE_ID().

◆ InternalClone()

itk::LightObject::Pointer mitk::PropertyRelationRuleBase::InternalClone ( ) const
overrideprotected

Definition at line 578 of file mitkPropertyRelationRuleBase.cpp.

◆ IsAbstract()

bool mitk::PropertyRelationRuleBase::IsAbstract ( ) const
virtual

Returns if the instance is a abstract rule (true). Default implementation is true. Overwrite and reimplement if another behavior is needed.

Reimplemented in mitk::SourceImageRelationRule, and mitk::GenericIDRelationRule.

Definition at line 24 of file mitkPropertyRelationRuleBase.cpp.

Referenced by Connect(), and GetRelationUIDs().

◆ IsDestinationCandidate()

bool mitk::PropertyRelationRuleBase::IsDestinationCandidate ( const IPropertyProvider owner) const
virtual

This method checks if owner is eligible to be a Destination for the rule. The default implementation returns a True for every valid IPropertyProvider (so only a null_ptr results into false). May be reimplement by derived rules if they have requirements on potential Sources).

Reimplemented in mitk::SourceImageRelationRule.

Definition at line 34 of file mitkPropertyRelationRuleBase.cpp.

◆ IsSource()

bool mitk::PropertyRelationRuleBase::IsSource ( const IPropertyProvider owner) const

Returns true if the passed owner is a Source of a relation defined by the rule so has at least one relation of type Connected_Data or Connected_ID.

Precondition
owner must be a pointer to a valid IPropertyProvider instance.

Definition at line 93 of file mitkPropertyRelationRuleBase.cpp.

References mitk::IPropertyProvider::GetConstProperty(), GetPropertyKeys(), GetRIIPropertyRegEx(), IsSupportedRuleID(), and mitkThrow.

◆ IsSourceCandidate()

bool mitk::PropertyRelationRuleBase::IsSourceCandidate ( const IPropertyProvider owner) const
virtual

This method checks if owner is eligible to be a Source for the rule. The default implementation returns a True for every valid IPropertyProvider (so only a null_ptr results into false). May be reimplement by derived rules if they have requirements on potential Sources).

Definition at line 29 of file mitkPropertyRelationRuleBase.cpp.

◆ IsSupportedRuleID()

bool mitk::PropertyRelationRuleBase::IsSupportedRuleID ( const RuleIDType ruleID) const
protectedvirtual

Returns if the passed rule ID is supported/relevant for the rule. Either because it is the very ID of the rule (default implementation) or because it is an abstract rule which also supports the rule ID.

Returns
true: If the rule ID can handle the rule ID. false: the rule does not support the rule ID.

Reimplemented in mitk::SourceImageRelationRule, and mitk::GenericIDRelationRule.

Definition at line 44 of file mitkPropertyRelationRuleBase.cpp.

References GetRuleID().

Referenced by GetExistingRelations(), GetInstanceID_IDLayer(), and IsSource().

◆ itkCreateAnotherMacro()

mitk::PropertyRelationRuleBase::itkCreateAnotherMacro ( Self  )

◆ NULL_INSTANCE_ID()

mitk::PropertyRelationRuleBase::InstanceIDType mitk::PropertyRelationRuleBase::NULL_INSTANCE_ID ( )
staticprotected

The documentation for this class was generated from the following files: