Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkDICOMHelper.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 mitkDICOMHelper_h
14 #define mitkDICOMHelper_h
15 
17 
18 // semantic relations module
19 #include "mitkSemanticTypes.h"
20 
21 // mitk core
22 #include <mitkDataNode.h>
23 #include <mitkDICOMTagPath.h>
24 
25 // c++
26 #include <string>
27 
28 /*
29 * @brief Provides helper functions to convert DICOM Tag information.
30 *
31 * In order to identify the patient of an image or segmentation or to set the control point of DICOM data,
32 * these functions are used to retrieve the DICOM tags from the given data nodes and convert them into semantic types
33 * that can be used by the SemanticRelations class.
34 */
35 namespace mitk
36 {
57  /*
58  * @brief Extracts a specific DICOM tag from the node's base data
59  * and returns the tag as a string. This tag string is used as an identifier for the patient (case).
60  *
61  * @pre The given data node or the node's base data has to be valid (!nullptr).
62  * @pre The node's base data has to have the specific DICOM Tag property set.
63  * @throw mitk::Exception if the given data node, the node's base data or the extracted DICOM tag are invalid (==nullptr).
64  *
65  * @par dataNode The data node, of which the DICOM tag should be extracted.
66  *
67  * @return The extracted DICOM tag as string.
68  * An empty string, if the DICOM tag can not be extracted (i.e. the data node or
69  * the underlying base data is invalid or the DICOM tag does not exist for the given data node).
70  */
72  /*
73  * @brief Extracts a specific DICOM tag (currently "0x0020, 0x000e": SeriesInstanceUID) from the node's base data
74  * and returns the tag as a string. This tag string is used as an identifier for the image instance.
75  *
76  * @pre The given data node or the node's base data has to be valid (!nullptr).
77  * @pre The node's base data has to have the "0x0020, 0x000e" DICOM Tag property set.
78  * @throw mitk::Exception if the given data node, the node's base data or the extracted DICOM tag are invalid (==nullptr).
79  *
80  * @par dataNode The data node, of which the DICOM tag should be extracted.
81  *
82  * @return The extracted DICOM tag as string.
83  * An empty string, if the DICOM tag can not be extracted (i.e. the data node or
84  * the underlying base data is invalid or the DICOM tag does not exist for the given data node).
85  */
87  /*
88  * @brief Extracts a specific DICOM tag (currently "0x0008, 0x0022": AcquisitionDate) from the node's base data
89  * and returns the tag as a control point.
90  *
91  * @pre The given data node or the node's base data has to be valid (!nullptr).
92  * @pre The node's base data has to have the "0x0008, 0x0022" DICOM Tag property set.
93  * @throw mitk::Exception if the given data node, the node's base data or the extracted DICOM tag are invalid (==nullptr).
94  *
95  * @par dataNode The data node, of which the DICOM tag should be extracted.
96  *
97  * @return The extracted DICOM tag as control point.
98  * An empty control point, if the DICOM tag can not be extracted (i.e. the data node or
99  * the underlying base data is invalid or the DICOM tag does not exist for the given data node).
100  */
101  MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPoint GetDICOMDateFromDataNode(const mitk::DataNode* dataNode);
116  /*
117  * @brief Removes leading and trailing whitespace from the given string.
118  *
119  * @par identifier The value of a DICOM tag.
120  *
121  * @return The trimmed DICOM tag
122  */
123  MITKSEMANTICRELATIONS_EXPORT std::string TrimDICOM(const std::string& identifier);
124 } // namespace mitk
125 
126 #endif
mitk::TrimDICOM
MITKSEMANTICRELATIONS_EXPORT std::string TrimDICOM(const std::string &identifier)
MitkSemanticRelationsExports.h
mitk::GetDateDICOMProperty
MITKSEMANTICRELATIONS_EXPORT std::string GetDateDICOMProperty()
Creates a property name for a DICOM tag. The tag is "0x0008, 0x0022" (AcquisitionDate)
mitkSemanticTypes.h
MITKSEMANTICRELATIONS_EXPORT
#define MITKSEMANTICRELATIONS_EXPORT
Definition: MitkSemanticRelationsExports.h:15
mitk::GetDICOMDateFromDataNode
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPoint GetDICOMDateFromDataNode(const mitk::DataNode *dataNode)
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::GetNodeIDDICOMProperty
MITKSEMANTICRELATIONS_EXPORT std::string GetNodeIDDICOMProperty()
Creates a property name for a DICOM tag. The tag is "0x0020, 0x000e" (SeriesInstanceUID)
mitk::GetIDFromDataNode
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ID GetIDFromDataNode(const mitk::DataNode *dataNode)
mitk::SemanticTypes::ID
std::string ID
Definition: mitkSemanticTypes.h:33
mitk::GetModalityDICOMProperty
MITKSEMANTICRELATIONS_EXPORT std::string GetModalityDICOMProperty()
Creates a property name for a DICOM tag. The tag is "0x0008, 0x0060" (Modality)
mitk::GetCaseIDDICOMProperty
MITKSEMANTICRELATIONS_EXPORT std::string GetCaseIDDICOMProperty()
Creates a property name for a DICOM tag. The tag is "0x0010, 0x0010" (PatientName)
mitk::SemanticTypes::CaseID
std::string CaseID
Definition: mitkSemanticTypes.h:34
mitkDataNode.h
mitk::GetDICOMModalityFromDataNode
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::InformationType GetDICOMModalityFromDataNode(const mitk::DataNode *dataNode)
Extracts a specific DICOM tag from the node's base data and returns the tag as a information type (a ...
mitkDICOMTagPath.h
mitk::DataNode
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63
mitk::GetCaseIDFromDataNode
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::CaseID GetCaseIDFromDataNode(const mitk::DataNode *dataNode)
mitk::SemanticTypes::InformationType
std::string InformationType
Definition: mitkSemanticTypes.h:35