Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkDICOMTag.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 mitkDICOMTag_h
14 #define mitkDICOMTag_h
15 
16 #include <mitkPoint.h>
17 #include <mitkVector.h>
18 
19 #include <MitkDICOMExports.h>
20 
21 namespace mitk
22 {
23 
33 {
34  public:
35 
41  DICOMTag(unsigned int group, unsigned int element);
42 
44  DICOMTag(const DICOMTag& other);
45 
47  DICOMTag& operator=(const DICOMTag& other);
48 
54  bool operator==(const DICOMTag& other) const;
55 
61  bool operator<(const DICOMTag& other) const;
62 
67  unsigned int GetGroup() const;
68 
73  unsigned int GetElement() const;
74 
79  std::string GetName() const;
80 
85  void Print(std::ostream& os) const;
86 
87  private:
88 
89  std::string toHexString(unsigned int i) const;
90 
91  unsigned int m_Group;
92  unsigned int m_Element;
93 };
94 
96 typedef std::vector<DICOMTag> DICOMTagList;
97 
113 void DICOMStringToOrientationVectors(const std::string& s, Vector3D& right, Vector3D& up, bool& successful);
114 
122 bool DICOMStringToSpacing(const std::string& s, ScalarType& spacingX, ScalarType& spacingY);
123 
124 
133 Point3D DICOMStringToPoint3D(const std::string& s, bool& successful);
134 
135 }
136 
137 #endif
#define MITKDICOM_EXPORT
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:33
std::string GetName() const
Return the name of this tag (e.g. "SeriesDescription" instead of "(0008,103e)").
unsigned int GetElement() const
Get the DICOM element number.
void Print(std::ostream &os) const
Print "(group-id,element-id) name" to the given stream.
DICOMTag(const DICOMTag &other)
Copy constructor.
DICOMTag(unsigned int group, unsigned int element)
Construct a DICOMTag from group and element numbers.
unsigned int GetGroup() const
Get the DICOM group number.
bool operator<(const DICOMTag &other) const
Less-than comparison operator (for sorting/containers).
DICOMTag & operator=(const DICOMTag &other)
Assignment operator.
bool operator==(const DICOMTag &other) const
Equality comparison operator.
Find image slices visible on a given plane.
bool DICOMStringToSpacing(const std::string &s, ScalarType &spacingX, ScalarType &spacingY)
Parse a DICOM spacing string into X and Y spacing values.
std::vector< DICOMTag > DICOMTagList
A list of DICOMTag instances.
Definition: mitkDICOMTag.h:96
void DICOMStringToOrientationVectors(const std::string &s, Vector3D &right, Vector3D &up, bool &successful)
Convert DICOM string describing a point to two Vector3D instances.
Point3D DICOMStringToPoint3D(const std::string &s, bool &successful)
Convert DICOM string describing a point to Point3D.
double ScalarType
Scalar type used throughout MITK for geometric computations.