|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Relation rule for referencing an image as the source of a destination entity. More...
#include <mitkSourceImageRelationRule.h>


Public Types | |
| using | RuleIDType = PropertyRelationRuleBase::RuleIDType |
| using | RelationUIDType = PropertyRelationRuleBase::RelationUIDType |
| using | RelationUIDVectorType = PropertyRelationRuleBase::RelationUIDVectorType |
Public Types inherited from mitk::PropertyRelationRuleBase | |
| enum class | RelationType { None , Data , ID , Complete } |
| using | RuleIDType = std::string |
| using | RelationUIDType = Identifiable::UIDType |
| using | RelationUIDVectorType = std::vector< RelationUIDType > |
| using | RelationVectorType = std::vector< RelationType > |
| using | InstanceIDType = std::string |
Public Member Functions | |
| mitkClassMacro (SourceImageRelationRule, PropertyRelationRuleBase) | |
| mitkNewMacro1Param (Self, const RuleIDType &) | |
| mitkNewMacro2Param (Self, const RuleIDType &, const std::string &) | |
| mitkNewMacro4Param (Self, const RuleIDType &, const std::string &, const std::string &, const std::string &) | |
| RuleIDType | GetRuleID () const override |
| Return an ID string that identifies the rule class. More... | |
| bool | IsAbstract () const override |
| Return whether this rule is abstract (i.e. has no purpose tag). More... | |
| std::string | GetDisplayName () const override |
| Return a human-readable string describing the rule. Does not need to be unique. More... | |
| std::string | GetSourceRoleName () const override |
| Return a human-readable string describing the role of a source in the context of this rule. More... | |
| std::string | GetDestinationRoleName () const override |
| Return a human-readable string describing the role of a destination in the context of this rule. More... | |
| bool | IsDestinationCandidate (const IPropertyProvider *owner) const override |
| Check whether the given property provider qualifies as a destination for this rule. More... | |
| RelationUIDType | Connect (Image *source, const Image *destination) const |
| Connect two images using this relation rule. More... | |
Public Member Functions inherited from mitk::PropertyRelationRuleBase | |
| mitkClassMacroItkParent (PropertyRelationRuleBase, itk::Object) | |
| Pointer | Clone () const |
| itkCreateAnotherMacro (Self) | |
| virtual bool | IsSourceCandidate (const IPropertyProvider *owner) const |
| bool | IsSource (const IPropertyProvider *owner) const |
| RelationVectorType | GetRelationTypes (const IPropertyProvider *source, const IPropertyProvider *destination) const |
| bool | HasRelation (const IPropertyProvider *source, const IPropertyProvider *destination, RelationType requiredRelation=RelationType::None) const |
| RelationUIDVectorType | GetExistingRelations (const IPropertyProvider *source, RelationType layer=RelationType::None) 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 exclusiveRelation=RelationType::None) const |
| NodePredicateBase::ConstPointer | GetDestinationsDetector (const IPropertyProvider *source, RelationType exclusiveRelation=RelationType::None) const |
| NodePredicateBase::ConstPointer | GetDestinationDetector (const IPropertyProvider *source, RelationUIDType relationUID) const |
| void | Disconnect (IPropertyOwner *source, const IPropertyProvider *destination, RelationType layer=RelationType::Complete) const |
| void | Disconnect (IPropertyOwner *source, RelationUIDType relationUID, RelationType layer=RelationType::Complete) const |
| std::vector< PropertyKeyPath > | GetRelationPropertyPaths (const IPropertyProvider *source, RelationUIDType relationUID, RelationType layer=RelationType::Data) const |
| Get all property key paths relevant for a given relation. More... | |
Static Public Member Functions | |
| static Pointer | New () |
Static Public Member Functions inherited from mitk::PropertyRelationRuleBase | |
| static PropertyKeyPath | GetRootKeyPath () |
| static PropertyKeyPath | GetRIIPropertyKeyPath (const std::string propName, const InstanceIDType &instanceID) |
| static PropertyKeyPath | GetRIIRelationUIDPropertyKeyPath (const InstanceIDType &instanceID="") |
| static PropertyKeyPath | GetRIIRuleIDPropertyKeyPath (const InstanceIDType &instanceID="") |
| static PropertyKeyPath | GetRIIDestinationUIDPropertyKeyPath (const InstanceIDType &instanceID="") |
Protected Types | |
| using | InstanceIDType = PropertyRelationRuleBase::InstanceIDType |
| using | InstanceIDVectorType = PropertyRelationRuleBase::InstanceIDVectorType |
| using | DataRelationUIDVectorType = PropertyRelationRuleBase::DataRelationUIDVectorType |
Protected Types inherited from mitk::PropertyRelationRuleBase | |
| using | InstanceIDVectorType = std::vector< InstanceIDType > |
| using | DataRelationUIDVectorType = std::vector< std::pair< RelationUIDType, RuleIDType > > |
Protected Member Functions | |
| SourceImageRelationRule () | |
| Default constructor. Creates an abstract rule with no purpose tag. More... | |
| SourceImageRelationRule (const RuleIDType &purposeTag) | |
| Construct a rule with a specific purpose tag. More... | |
| SourceImageRelationRule (const RuleIDType &purposeTag, const std::string &displayName) | |
| Construct a rule with a purpose tag and display name. More... | |
| SourceImageRelationRule (const RuleIDType &purposeTag, const std::string &displayName, const std::string &sourceRole, const std::string &destinationRole) | |
| Construct a rule with all customizable parameters. More... | |
| ~SourceImageRelationRule () override=default | |
| std::vector< std::pair< size_t, std::string > > | GetReferenceSequenceIndices (const IPropertyProvider *source, const IPropertyProvider *destination=nullptr, InstanceIDVectorType ignoreInstances={}) const |
| Get reference sequence indices from the DICOM Source Image Sequence (0008,2112). More... | |
| virtual DataRelationUIDVectorType | GetRelationUIDs_DataLayer (const IPropertyProvider *source, const IPropertyProvider *destination, const InstanceIDVectorType &instances_IDLayer) const override |
| void | Connect_datalayer (IPropertyOwner *source, const IPropertyProvider *destination, const InstanceIDType &instanceID) const override |
| void | Disconnect_datalayer (IPropertyOwner *source, const RelationUIDType &relationUID) const override |
| bool | IsSupportedRuleID (const RuleIDType &ruleID) const override |
| SourceImageRelationRule (const SourceImageRelationRule &other) | |
| mitkCloneMacro (Self) | |
| PropertyKeyPath::ItemSelectionIndex | CreateNewSourceImageSequenceItem (IPropertyOwner *source) const |
| Prepare a new reference to an image on the data layer. More... | |
| std::string | GenerateRuleID (const std::string &purpose) const |
| Generate a rule ID string from the given purpose tag. More... | |
Protected Member Functions inherited from mitk::PropertyRelationRuleBase | |
| PropertyRelationRuleBase ()=default | |
| PropertyRelationRuleBase (const PropertyRelationRuleBase &) | |
| ~PropertyRelationRuleBase () override=default | |
| InstanceIDVectorType | GetInstanceID_IDLayer (const IPropertyProvider *source, const IPropertyProvider *destination) const |
| 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 |
| std::string | GetRIIPropertyRegEx (const std::string propName="", const InstanceIDType &instanceID="") const |
| RuleIDType | GetRuleIDByInstanceID (const IPropertyProvider *source, const InstanceIDType &instanceID) const |
| std::string | GetDestinationUIDByInstanceID (const IPropertyProvider *source, const InstanceIDType &instanceID) const |
| const Identifiable * | CastProviderAsIdentifiable (const mitk::IPropertyProvider *provider) const |
Additional Inherited Members | |
Static Protected Member Functions inherited from mitk::PropertyRelationRuleBase | |
| static InstanceIDType | NULL_INSTANCE_ID () |
| static InstanceIDType | GetInstanceIDByPropertyName (const std::string propName) |
| static std::vector< std::string > | GetPropertyKeys (const IPropertyProvider *owner) |
Relation rule for referencing an image as the source of a destination entity.
This rule class can be used for relations that reference an image as source for a destination entity (e.g. an image that is used to generate the relation source).
The ID-layer is supported like for GenericIDRelations, so it can be used for all ID-based relations between PropertyProviders that also implement the Identifiable interface.
In addition, the rule uses the data-layer to deduce/define relations. For this layer it uses properties compliant to DICOM. Thus (1) the information is stored in a DICOM Source Image Sequence item (0x0008,0x2112) and (2) the destination must have properties DICOM SOP Instance UID (0x0008,0x0018) and DICOM SOP Class UID (0x0008,0x0016). If the destination does not have these properties, no connection can be made on the data-layer.
In order to use this class for different relation types (DICOM would call them purposes), the purposeTag is used. It must be specified when creating a rule instance. The purposeTag will be used as suffix for the rule ID and therefore allows creating specific and distinguishable rule instances based on this class.
One may also specify the display name and the role names of the instance. If not specified, the default values are used (display name: "<purposeTag> relation", source role name: "derived data", destination role name: "source image").
Definition at line 53 of file mitkSourceImageRelationRule.h.
|
protected |
Definition at line 134 of file mitkSourceImageRelationRule.h.
|
protected |
Definition at line 122 of file mitkSourceImageRelationRule.h.
|
protected |
Definition at line 123 of file mitkSourceImageRelationRule.h.
Definition at line 63 of file mitkSourceImageRelationRule.h.
| using mitk::SourceImageRelationRule::RelationUIDVectorType = PropertyRelationRuleBase::RelationUIDVectorType |
Definition at line 64 of file mitkSourceImageRelationRule.h.
Definition at line 62 of file mitkSourceImageRelationRule.h.
|
protected |
Default constructor. Creates an abstract rule with no purpose tag.
|
protected |
Construct a rule with a specific purpose tag.
| [in] | purposeTag | The purpose tag used as suffix for the rule ID. |
|
protected |
Construct a rule with a purpose tag and display name.
| [in] | purposeTag | The purpose tag used as suffix for the rule ID. |
| [in] | displayName | Human-readable name for the rule. |
|
protected |
Construct a rule with all customizable parameters.
| [in] | purposeTag | The purpose tag used as suffix for the rule ID. |
| [in] | displayName | Human-readable name for the rule. |
| [in] | sourceRole | Human-readable name for the source role. |
| [in] | destinationRole | Human-readable name for the destination role. |
|
overrideprotecteddefault |
|
protected |
| RelationUIDType mitk::SourceImageRelationRule::Connect | ( | Image * | source, |
| const Image * | destination | ||
| ) | const |
Connect two images using this relation rule.
| [in] | source | The derived image (relation source). |
| [in] | destination | The original image (relation destination / DICOM source image). |
|
overrideprotectedvirtual |
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.
| source | |
| destination | |
| instanceID | is the ID for the relation instance that should be connected. Existence of the relation instance is ensured. |
Implements mitk::PropertyRelationRuleBase.
Reimplemented in mitk::SegSourceImageRelationRule.
|
protected |
Prepare a new reference to an image on the data layer.
Generates an unused and valid sequence item index for the passed source and sets a relationUID property to block the instance ID. The instance ID is returned.
|
overrideprotectedvirtual |
This method is called by Disconnect() to remove all properties of the relation from the source that are set by Connect_datalayer().
Implements mitk::PropertyRelationRuleBase.
Reimplemented in mitk::SegSourceImageRelationRule, and mitk::ModelFitResultRelationRule.
|
protected |
Generate a rule ID string from the given purpose tag.
|
overridevirtual |
Return a human-readable string describing the role of a destination in the context of this rule.
Implements mitk::PropertyRelationRuleBase.
|
overridevirtual |
Return a human-readable string describing the rule. Does not need to be unique.
Implements mitk::PropertyRelationRuleBase.
|
protected |
Get reference sequence indices from the DICOM Source Image Sequence (0008,2112).
Returns a vector of (sequence index, ruleID) pairs that refer to the given destination (or all if no destination is passed), have a supported RuleID, and are not already covered by ignoreInstances.
|
overrideprotectedvirtual |
Returns the RelationUIDs of all relations that are defined by the data layer of source for this rule instance and, if defined, destination. If the passed source (and destination) instance has no relation on the data layer, an empty vector will be returned.
| source | |
| destination | Destination the find relations should point to. If destination is NULL any relation on the data layer for this rule and source are wanted. |
| instances_IDLayer | List of relation instances that are already defined by the ID layer. The implementation of this function should only cover relations that are not already resembled in the passed relarions_IDLayer. |
Implements mitk::PropertyRelationRuleBase.
Reimplemented in mitk::ModelFitResultRelationRule.
|
overridevirtual |
Return an ID string that identifies the rule class.
Implements mitk::PropertyRelationRuleBase.
|
overridevirtual |
Return a human-readable string describing the role of a source in the context of this rule.
Implements mitk::PropertyRelationRuleBase.
|
overridevirtual |
Return whether this rule is abstract (i.e. has no purpose tag).
Reimplemented from mitk::PropertyRelationRuleBase.
|
overridevirtual |
Check whether the given property provider qualifies as a destination for this rule.
Reimplemented from mitk::PropertyRelationRuleBase.
Reimplemented in mitk::ModelFitResultRelationRule.
|
overrideprotectedvirtual |
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.
Reimplemented from mitk::PropertyRelationRuleBase.
| mitk::SourceImageRelationRule::mitkClassMacro | ( | SourceImageRelationRule | , |
| PropertyRelationRuleBase | |||
| ) |
|
protected |
| mitk::SourceImageRelationRule::mitkNewMacro1Param | ( | Self | , |
| const RuleIDType & | |||
| ) |
| mitk::SourceImageRelationRule::mitkNewMacro2Param | ( | Self | , |
| const RuleIDType & | , | ||
| const std::string & | |||
| ) |
| mitk::SourceImageRelationRule::mitkNewMacro4Param | ( | Self | , |
| const RuleIDType & | , | ||
| const std::string & | , | ||
| const std::string & | , | ||
| const std::string & | |||
| ) |
|
static |