Medical Imaging Interaction Toolkit  2022.04.99-01b95b17 Medical Imaging Interaction Toolkit
mitk::SemanticRelationsIntegration Class Reference

The API provides functions to manipulate image relations and instances that are helpful during follow-up examination, like control-points (time period), types of the images or lesions that may be visible on multiple images. More...

#include <mitkSemanticRelationsIntegration.h>

Inheritance diagram for mitk::SemanticRelationsIntegration:
Collaboration diagram for mitk::SemanticRelationsIntegration:

## Public Member Functions

Adds the given concrete observer to the vector that holds all currently registered observer. If the observer is already registered, it will not be added to the observer vector. More...

void RemoveObserver (ISemanticRelationsObserver *observer) override
Removes the given concrete observer from the vector that holds all currently registered observer. More...

virtual ~SemanticRelationsIntegration ()

Add the given image to the set of already existing images. The date is extracted from the DICOM data of the image node and is compared to already existing control points in the semantic relations model. The function tries to find a fitting control point or to extend an already existing control point, if the extracted control point is close to any other, already existing control point. Finally, the image is linked to the correct control point. More...

void RemoveImage (const DataNode *imageNode)
Remove the given image from the set of already existing images. More...

void AddLesion (const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion)
Add a newly created lesion to the set of already existing lesions - with no connection to a specific image / segmentation of the case data. More...

void OverwriteLesion (const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion)
Overwrite an already existing lesion instance (this may be useful to overwrite the lesion with a different lesion class). More...

Add a newly created lesion to the set of already existing lesions. The lesion is added and a reference to the lesion is added to the segmentation. If the segmentation is already linked to a lesion, the old linkage is overwritten (this can be checked via 'IsRepresentingALesion'). More...

void RemoveLesion (const SemanticTypes::CaseID &caseID, const SemanticTypes::Lesion &lesion)
Remove the given lesion from the set of already existing lesions. More...

void AddSegmentation (const DataNode *segmentationNode, const DataNode *parentNode)
Add a segmentation instance to the set of already existing segmentations - with no connection to a specific lesion. More...

void LinkSegmentationToLesion (const DataNode *segmentationNode, const SemanticTypes::Lesion &lesion)
Link the given segmentation instance to an an already existing lesion instance. If the segmentation is already linked to a lesion instance, the old linkage is overwritten (this can be checked via 'IsRepresentingALesion'). More...

Unlink the given segmentation instance from the linked lesion instance. The lesion may stay unlinked to any segmentation. More...

void RemoveSegmentation (const DataNode *segmentationNode)
Remove the given segmentation from the set of already existing segmentations. More...

void SetControlPointOfImage (const DataNode *imageNode, const SemanticTypes::ControlPoint &controlPoint)
Set the control point for the given image. More...

Add a newly created control point to the set of already existing control points. A reference to the control point is added to the given image. This function combines adding a control point and linking it, since a control point with no associated data is not allowed. More...

void LinkImageToControlPoint (const DataNode *imageNode, const SemanticTypes::ControlPoint &controlPoint, bool checkConsistence=true)

Unlink the given image from the linked control point. If an image is unlinked from a control point, the function needs to check whether the control point is still linked to any other image: More...

void AddExaminationPeriod (const SemanticTypes::CaseID &caseID, const SemanticTypes::ExaminationPeriod &examinationPeriod)
Add an examination period instance to the set of already existing examination periods - with no connection to a specific control point. More...

void RenameExaminationPeriod (const SemanticTypes::CaseID &caseID, const SemanticTypes::ExaminationPeriod &examinationPeriod)
Rename an already existing examination period instance. More...

void AddControlPointToExaminationPeriod (const SemanticTypes::CaseID &caseID, const SemanticTypes::ControlPoint &controlPoint, const SemanticTypes::ExaminationPeriod &examinationPeriod)
Add a control point to the vector of control point UIDs of an existing examination period. More...

void SetInformationType (const DataNode *imageNode, const SemanticTypes::InformationType &informationType)
Set (and possibly overwrite) the information type of the given image. An already associated information type might be removed if is not referenced by any other image: More...

void AddInformationTypeToImage (const DataNode *imageNode, const SemanticTypes::InformationType &informationType)
Set the information type of the given image. More...

void RemoveInformationTypeFromImage (const DataNode *imageNode)
Remove the information type of the given image. If the information type is removed, the function needs to check whether the information type is referenced by any other image: More...

## Detailed Description

The API provides functions to manipulate image relations and instances that are helpful during follow-up examination, like control-points (time period), types of the images or lesions that may be visible on multiple images.

The class is able to generate IDs from given data nodes using DICOM information. These IDs are used to identify the corresponding instances of a specific case. The case can also be directly identified by the given case ID.

In order for most functions to work the case ID has to be used as a parameter. If not, these functions do nothing.

The class implements the ISemanticRelationsObservable interface to allow observers to be informed about changes in the semantic relation storage.

Definition at line 43 of file mitkSemanticRelationsIntegration.h.

## ◆ ~SemanticRelationsIntegration()

 virtual mitk::SemanticRelationsIntegration::~SemanticRelationsIntegration ( )
inlinevirtual

## Member Function Documentation

 void mitk::SemanticRelationsIntegration::AddControlPointAndLinkImage ( const DataNode * imageNode, const SemanticTypes::ControlPoint & controlPoint, bool checkConsistence = true )

Add a newly created control point to the set of already existing control points. A reference to the control point is added to the given image. This function combines adding a control point and linking it, since a control point with no associated data is not allowed.

Precondition
The given image data node has to be valid (!nullptr).
Exceptions
 SemanticRelationException,if the given image data node is invalid (==nullptr).
Precondition
The UID of the control point must not already exist for a control point instance.
Exceptions
 SemanticRelationException,if the UID of the control point already exists for a control point instance (this can be checked via 'InstanceExists').
Precondition
The given control point must not already be contained in an existing control point interval.
Exceptions
 SemanticRelationException,if the given control point is already contained in an existing control point interval (this can be checked via 'CheckContainingControlPoint').
Precondition
The given control point must contain the date of the given image data node (if parameter 'checkConsistence = true').
Exceptions
 SemanticRelationException,if the given control point does not contain the date of the given image data node and 'checkConsistence = true' (this can be checked via 'ControlPointManager::InsideControlPoint').
Parameters
 imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node. controlPoint The control point instance to add. For a newly added control point always has "startDate = endDate". checkConsistence If true, the function checks, whether the date of the image data node actually lies inside the control point to link.

 void mitk::SemanticRelationsIntegration::AddControlPointToExaminationPeriod ( const SemanticTypes::CaseID & caseID, const SemanticTypes::ControlPoint & controlPoint, const SemanticTypes::ExaminationPeriod & examinationPeriod )

Add a control point to the vector of control point UIDs of an existing examination period.

Precondition
The UID of the control point has to exist for a control point instance.
Exceptions
 SemanticRelationException,if the UID of the control point does not exists for a control point instance (this can be checked via 'InstanceExists').
Precondition
The UID of the examination period must not already exist for an examination period instance.
Exceptions
 SemanticRelationException,if the UID of the examination period already exists for a examination period instance (this can be checked via 'InstanceExists').
Parameters
 caseID The current case identifier is defined by the given string. controlPoint The control point instance to add to the examination period. examinationPeriod The examination period to which the control point should be added.

 void mitk::SemanticRelationsIntegration::AddExaminationPeriod ( const SemanticTypes::CaseID & caseID, const SemanticTypes::ExaminationPeriod & examinationPeriod )

Add an examination period instance to the set of already existing examination periods - with no connection to a specific control point.

Precondition
The UID of the examination period must not already exist for an examination period instance.
Exceptions
 SemanticRelationException,if the UID of the examination period already exists for a examination period instance (this can be checked via 'InstanceExists').
Parameters
 caseID The current case identifier is defined by the given string. examinationPeriod The examination period to add.

 void mitk::SemanticRelationsIntegration::AddImage ( const DataNode * imageNode )

Add the given image to the set of already existing images. The date is extracted from the DICOM data of the image node and is compared to already existing control points in the semantic relations model. The function tries to find a fitting control point or to extend an already existing control point, if the extracted control point is close to any other, already existing control point. Finally, the image is linked to the correct control point.

Precondition
The given image data node has to be valid (!nullptr).
Exceptions
 SemanticRelationException,if the given image data node is invalid (==nullptr).
Parameters
 imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node.

 void mitk::SemanticRelationsIntegration::AddInformationTypeToImage ( const DataNode * imageNode, const SemanticTypes::InformationType & informationType )

Set the information type of the given image.

Precondition
The given image data node has to be valid (!nullptr).
Exceptions
 SemanticRelationException,if the given image data node is invalid (==nullptr).
Postcondition
If the information type instance did not exist before, it is now added.
Parameters
 imageNode The current case identifier is extracted from the given image data node, which contains DICOM information about the case. informationType An information type that identifies the corresponding information type instance.

 void mitk::SemanticRelationsIntegration::AddLesion ( const SemanticTypes::CaseID & caseID, const SemanticTypes::Lesion & lesion )

Add a newly created lesion to the set of already existing lesions - with no connection to a specific image / segmentation of the case data.

Precondition
The UID of the lesion must not already exist for a lesion instance.
Exceptions
 SemanticRelationException,it the UID of the lesion already exists for a lesion instance (this can be checked via 'InstanceExists').
Parameters
 caseID The current case identifier is defined by the given string. lesion The lesion instance to add.

 void mitk::SemanticRelationsIntegration::AddLesionAndLinkSegmentation ( const DataNode * segmentationNode, const SemanticTypes::Lesion & lesion )

Add a newly created lesion to the set of already existing lesions. The lesion is added and a reference to the lesion is added to the segmentation. If the segmentation is already linked to a lesion, the old linkage is overwritten (this can be checked via 'IsRepresentingALesion').

Precondition
The given segmentation data node has to be valid (!nullptr).
Exceptions
 SemanticRelationException,if the given segmentation data node is invalid (==nullptr).
Precondition
The UID of the lesion must not already exist for a lesion instance.
Exceptions
 SemanticRelationException,if the UID of the lesion already exists for a lesion instance (this can be checked via 'InstanceExists').
Parameters
 segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node. lesion The lesion instance to add and link.

 void mitk::SemanticRelationsIntegration::AddObserver ( ISemanticRelationsObserver * observer )
overridevirtual

Adds the given concrete observer to the vector that holds all currently registered observer. If the observer is already registered, it will not be added to the observer vector.

Parameters
 observer The concrete observer to register.

Implements mitk::ISemanticRelationsObservable.

 void mitk::SemanticRelationsIntegration::AddSegmentation ( const DataNode * segmentationNode, const DataNode * parentNode )

Add a segmentation instance to the set of already existing segmentations - with no connection to a specific lesion.

Parameters
 segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node. parentNode The node identifier of the parent node is extracted from the given parent data node.

 void mitk::SemanticRelationsIntegration::LinkImageToControlPoint ( const DataNode * imageNode, const SemanticTypes::ControlPoint & controlPoint, bool checkConsistence = true )

Precondition
The given image data node has to be valid (!nullptr).
Exceptions
 SemanticRelationException,if the given image data node is invalid (==nullptr).
Precondition
The UID of the control point has to exist for a control point instance.
Exceptions
 SemanticRelationException,if the UID of the control point does not exists for a control point instance (this can be checked via 'InstanceExists').
Precondition
The given control point must contain the date of the given image data node (if parameter 'checkConsistence = true').
Exceptions
 SemanticRelationException,if the given control point does not contain the date of the given image data node and 'checkConsistence = true' (this can be checked via 'ControlPointManager::InsideControlPoint').
Parameters
 imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node. controlPoint The control point instance to link. checkConsistence If true, the function checks, whether the date of the image data node actually lies inside the control point to link.

 void mitk::SemanticRelationsIntegration::LinkSegmentationToLesion ( const DataNode * segmentationNode, const SemanticTypes::Lesion & lesion )

Link the given segmentation instance to an an already existing lesion instance. If the segmentation is already linked to a lesion instance, the old linkage is overwritten (this can be checked via 'IsRepresentingALesion').

Precondition
The given segmentation data node has to be valid (!nullptr).
Exceptions
 SemanticRelationException,if the given segmentation data node is invalid (==nullptr).
Precondition
The UID of the lesion has to exist for a lesion instance.
Exceptions
 SemanticRelationException,if the UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists').
Parameters
 segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node. lesion The lesion instance to link.

## ◆ OverwriteLesion()

 void mitk::SemanticRelationsIntegration::OverwriteLesion ( const SemanticTypes::CaseID & caseID, const SemanticTypes::Lesion & lesion )

Overwrite an already existing lesion instance (this may be useful to overwrite the lesion with a different lesion class).

Precondition
The UID of the lesion has to exist for a lesion instance.
Exceptions
 SemanticRelationException,if the UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists').
Parameters
 caseID The current case identifier is defined by the given string. lesion The lesion instance that overwrites an existing lesion.

## ◆ RemoveImage()

 void mitk::SemanticRelationsIntegration::RemoveImage ( const DataNode * imageNode )

Remove the given image from the set of already existing images.

Precondition
The given image data node has to be valid (!nullptr).
Exceptions
 SemanticRelationException,if the given image data node is invalid (==nullptr).
Parameters
 imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node.

## ◆ RemoveInformationTypeFromImage()

 void mitk::SemanticRelationsIntegration::RemoveInformationTypeFromImage ( const DataNode * imageNode )

Remove the information type of the given image. If the information type is removed, the function needs to check whether the information type is referenced by any other image:

• if not, the information type instance can be removed (has to be removed since an information type with no associated image is not allowed).
• if so, the information type is just removed from the given image.
Precondition
The given image data node has to be valid (!nullptr).
Exceptions
 SemanticRelationException,if the given image data node is invalid (==nullptr).
Parameters
 imageNode The current case identifier is extracted from the given image data node, which contains DICOM information about the case.

## ◆ RemoveLesion()

 void mitk::SemanticRelationsIntegration::RemoveLesion ( const SemanticTypes::CaseID & caseID, const SemanticTypes::Lesion & lesion )

Remove the given lesion from the set of already existing lesions.

Precondition
The UID of the lesion has to exist for a lesion instance.
Exceptions
 SemanticRelationException,if the UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists').
Precondition
The function needs to assure that no segmentation is still representing (linked to) this lesion.
Exceptions
 SemanticRelationException,if the lesion instance to remove is still linked to by any segmentation (this can be checked via 'GetAllSegmentationsOfLesion').
Parameters
 caseID The current case identifier is defined by the given string. lesion The lesion instance to remove.

## ◆ RemoveObserver()

 void mitk::SemanticRelationsIntegration::RemoveObserver ( ISemanticRelationsObserver * observer )
overridevirtual

Removes the given concrete observer from the vector that holds all currently registered observer.

Parameters
 observer The concrete observer to unregister.

Implements mitk::ISemanticRelationsObservable.

## ◆ RemoveSegmentation()

 void mitk::SemanticRelationsIntegration::RemoveSegmentation ( const DataNode * segmentationNode )

Remove the given segmentation from the set of already existing segmentations.

Precondition
The given segmentation data node has to be valid (!nullptr).
Exceptions
 SemanticRelationException,if the given segmentation data node is invalid (==nullptr).
Parameters
 segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node.

## ◆ RenameExaminationPeriod()

 void mitk::SemanticRelationsIntegration::RenameExaminationPeriod ( const SemanticTypes::CaseID & caseID, const SemanticTypes::ExaminationPeriod & examinationPeriod )

Rename an already existing examination period instance.

Precondition
The UID of the examination period has to exist for an examination period instance.
Exceptions
 SemanticRelationException,if the UID of the examination period does not exist for an examination period instance (this can be checked via 'InstanceExists').
Parameters
 caseID The current case identifier is defined by the given string. examinationPeriod The examination period instance that renames an existing examination period.

## ◆ SetControlPointOfImage()

 void mitk::SemanticRelationsIntegration::SetControlPointOfImage ( const DataNode * imageNode, const SemanticTypes::ControlPoint & controlPoint )

Set the control point for the given image.

Precondition
The given image data node has to be valid (!nullptr).
Exceptions
 SemanticRelationException,if the given image data node is invalid (==nullptr).
Parameters
 imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node. controlPoint The control point instance which is used for the given image.

## ◆ SetInformationType()

 void mitk::SemanticRelationsIntegration::SetInformationType ( const DataNode * imageNode, const SemanticTypes::InformationType & informationType )

Set (and possibly overwrite) the information type of the given image. An already associated information type might be removed if is not referenced by any other image:

Precondition
The given image data node has to be valid (!nullptr).
Exceptions
 SemanticRelationException,if the given image data node is invalid (==nullptr).
Postcondition
If the information type instance did not exist before, it is now added.
Parameters
 imageNode The current case identifier is extracted from the given image data node, which contains DICOM information about the case. informationType An information type that identifies the corresponding information type instance.

 void mitk::SemanticRelationsIntegration::UnlinkImageFromControlPoint ( const DataNode * imageNode )

Unlink the given image from the linked control point. If an image is unlinked from a control point, the function needs to check whether the control point is still linked to any other image:

• if not, the control point instance will be removed (has to be removed since a control point with no associated image is not allowed).
• if so, the function has to make sure that the control point instance is shortened to its minimum time period (e.g. moving the end point to an earlier date).
Parameters
 imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node.