3 #ifndef GDCMDICTENTRY_H
4 #define GDCMDICTENTRY_H
6 #include "gdcmCommon.h"
9 * the gdcmDictEntry in an element contained by the gdcmDict.
11 * - the key referenced by the DICOM norm or the constructor (for private keys)
12 * - the corresponding name in english (it's equivalent to a label)
16 class GDCM_EXPORT gdcmDictEntry {
18 // FIXME : were are the group and element used except from building up
19 // a TagKey. If the answer is nowhere then there is no need
20 // to store the group and element independently.
21 guint16 group; // e.g. 0x0010
22 guint16 element; // e.g. 0x0103
23 std::string vr; // Value Representation i.e. some clue about the nature
24 // of the data represented e.g. "FD" short for
25 // "Floating Point Double"
26 // CLEANME: find the official dicom name for this field !
27 std::string fourth; // Fourth field containing some semantics.
29 std::string name; // e.g. "Patient_Name"
30 TagKey key; // Redundant with (group, element) but we add it
31 // on efficiency purposes.
33 // DCMTK has many fields for handling a DictEntry (see below). What are the
34 // relevant ones for gdcmlib ?
35 // struct DBI_SimpleEntry {
37 // Uint16 upperElement;
39 // const char* tagName;
42 // const char* standardVersion;
43 // DcmDictRangeRestriction groupRestriction;
44 // DcmDictRangeRestriction elementRestriction;
47 gdcmDictEntry(guint16 group,
49 std::string vr = "Unknown",
50 std::string fourth = "Unknown",
51 std::string name = "Unknown");
53 static TagKey TranslateToKey(guint16 group, guint16 element);
55 // bool IsVrUnknown(void);
57 // inline guint16 GetGroup(void);
58 // inline guint16 GetElement(void);
59 // inline std::string GetVR(void);
60 void SetVR(std::string);
61 // inline void SetKey(std::string k);
62 // inline std::string GetFourth(void);
63 // inline std::string GetName(void);
64 // inline std::string GetKey(void);
69 * \ingroup gdcmDictEntry
70 * \brief tells if the V(alue) R(epresentation) is known (?!)
74 inline bool gdcmDictEntry::IsVrUnknown() {
75 if ( vr == "Unknown" )
82 * \ingroup gdcmDictEntry
83 * \brief returns the Dicom Group Number of the current gdcmDictEntry
84 * return the Dicom Group Number
86 inline guint16 gdcmDictEntry::GetGroup(void) {
91 * \ingroup gdcmDictEntry
92 * \brief returns the Dicom Element Number of the current gdcmDictEntry
93 * return the Dicom Element Number
95 inline guint16 gdcmDictEntry::GetElement(void) {
100 * \ingroup gdcmDictEntry
101 * \brief returns the Dicom Value Representation of the current gdcmDictEntry
102 * return the Dicom Value Representation
104 inline std::string gdcmDictEntry::GetVR(void) {
109 * \ingroup gdcmDictEntry
110 * \brief sets the key of the current gdcmDictEntry
111 * @param k New key to be set.
113 inline void gdcmDictEntry::SetKey(std::string k) {
118 * \ingroup gdcmDictEntry
119 * \brief returns the Fourth field of the current gdcmDictEntry
120 * \warning NOT part of the Dicom Standard
121 * \ May be REMOVED an any time
123 * return the Fourth field
125 inline std::string gdcmDictEntry::GetFourth(void) {
130 * \ingroup gdcmDictEntry
131 * \brief returns the Dicom Name of the current gdcmDictEntry
132 * \ e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010)
133 * return the Dicom Name
135 inline std::string gdcmDictEntry::GetName(void) {
140 * \ingroup gdcmDictEntry
141 * \brief Gets the key of the current gdcmDictEntry
144 inline std::string gdcmDictEntry::GetKey(void) {