1 /*=========================================================================
4 Module: $RCSfile: gdcmDictEntry.h,v $
6 Date: $Date: 2004/06/20 18:08:47 $
7 Version: $Revision: 1.14 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #ifndef GDCMDICTENTRY_H
20 #define GDCMDICTENTRY_H
22 #include "gdcmCommon.h"
24 //-----------------------------------------------------------------------------
26 * \defgroup gdcmDictEntry
28 * the gdcmDictEntry in an element contained by the gdcmDict.
30 * - the key referenced by the DICOM norm or the constructor (for private keys)
31 * - the corresponding name in english (it's equivalent to a label)
35 class GDCM_EXPORT gdcmDictEntry
38 gdcmDictEntry(guint16 group,
40 std::string vr = "Unknown",
41 std::string fourth = "Unknown",
42 std::string name = "Unknown");
44 static TagKey TranslateToKey(guint16 group, guint16 element);
46 void SetVR(std::string);
49 * \ingroup gdcmDictEntry
50 * \brief tells if the V(alue) R(epresentation) is known (?!)
54 inline bool IsVRUnknown() {return vr == "??"; }
57 * \ingroup gdcmDictEntry
58 * \brief returns the Dicom Group Number of the current gdcmDictEntry
59 * return the Dicom Group Number
61 inline guint16 GetGroup(void) { return group; }
64 * \ingroup gdcmDictEntry
65 * \brief returns the Dicom Element Number of the current gdcmDictEntry
66 * return the Dicom Element Number
68 inline guint16 GetElement(void) { return element; }
71 * \ingroup gdcmDictEntry
72 * \brief returns the Dicom Value Representation of the current gdcmDictEntry
73 * return the Dicom Value Representation
75 inline std::string GetVR(void) { return vr; }
78 * \ingroup gdcmDictEntry
79 * \brief sets the key of the current gdcmDictEntry
80 * @param k New key to be set.
82 inline void SetKey(std::string k) { key = k; }
85 * \ingroup gdcmDictEntry
86 * \brief returns the Fourth field of the current gdcmDictEntry
87 * \warning NOT part of the Dicom Standard
88 * \ May be REMOVED an any time
90 * return the Fourth field
92 inline std::string GetFourth(void) { return fourth; }
95 * \ingroup gdcmDictEntry
96 * \brief returns the Dicom Name of the current gdcmDictEntry
97 * \ e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010)
98 * return the Dicom Name
100 inline std::string GetName(void) { return name; }
103 * \ingroup gdcmDictEntry
104 * \brief Gets the key of the current gdcmDictEntry
107 inline std::string GetKey(void) { return key; }
110 // FIXME : where are the group and element used except from building up
111 // a TagKey. If the answer is nowhere then there is no need
112 // to store the group and element independently.
114 // --> EVERYWHERE ! The alternate question would be :
115 // What's TagKey used for ?
117 /// DicomGroup number
118 guint16 group; // e.g. 0x0010
119 /// DicomElement number
120 guint16 element; // e.g. 0x0103
122 * \ingroup gdcmDictEntry
123 * \brief Value Representation i.e. some clue about the nature
124 * of the data represented
125 * e.g. "FD" short for "Floating Point Double"
130 * \brief AVOID using the following fourth field at all costs.
132 * They are at leat two good reasons for NOT using fourth:
133 * - the main reason is that it is NOT part of the 'official'
135 * - a second reason is that it is not defined for all the groups.
137 * Still it provides some semantics as group name abbreviation that
138 * can prove of some help when organizing things in an interface.
139 * For the time being we keep it in gdcm but it migth be removed in
140 * future releases it proves to be source of confusion.
141 * Here is a small dictionary we encountered in "nature":
143 * - META Meta Information
155 * - NMI Nuclear Medicine
157 * - BFS Basic Film Session
158 * - BFB Basic Film Box
159 * - BIB Basic Image Box
174 * Other usefull abreviations used for Radiographic view associated with
175 * Patient Position (0018,5100):
176 * - AP = Anterior/Posterior
177 * - PA = Posterior/Anterior
178 * - LL = Left Lateral
179 * - RL = Right Lateral
180 * - RLD = Right Lateral Decubitus
181 * - LLD = Left Lateral Decubitus
182 * - RLO = Right Lateral Oblique
183 * - LLO = Left Lateral Oblique
188 /// e.g. "Patient's Name"
191 /// Redundant with (group, element) but we add it on efficiency purposes.
194 // DCMTK has many fields for handling a DictEntry (see below). What are the
195 // relevant ones for gdcmlib ?
196 // struct DBI_SimpleEntry {
197 // Uint16 upperGroup;
198 // Uint16 upperElement;
200 // const char* tagName;
203 // const char* standardVersion;
204 // DcmDictRangeRestriction groupRestriction;
205 // DcmDictRangeRestriction elementRestriction;
209 //-----------------------------------------------------------------------------