2 //-----------------------------------------------------------------------------
3 #ifndef GDCMDICTENTRY_H
4 #define GDCMDICTENTRY_H
6 #include "gdcmCommon.h"
8 //-----------------------------------------------------------------------------
10 * the gdcmDictEntry in an element contained by the gdcmDict.
12 * - the key referenced by the DICOM norm or the constructor (for private keys)
13 * - the corresponding name in english (it's equivalent to a label)
17 class GDCM_EXPORT gdcmDictEntry {
19 gdcmDictEntry(guint16 group,
21 std::string vr = "Unknown",
22 std::string fourth = "Unknown",
23 std::string name = "Unknown");
25 static TagKey TranslateToKey(guint16 group, guint16 element);
26 void SetVR(std::string);
29 * \ingroup gdcmDictEntry
30 * \brief tells if the V(alue) R(epresentation) is known (?!)
34 inline bool gdcmDictEntry::IsVRUnknown() {
35 if ( vr == "Unknown" )
41 * \ingroup gdcmDictEntry
42 * \brief returns the Dicom Group Number of the current gdcmDictEntry
43 * return the Dicom Group Number
45 inline guint16 gdcmDictEntry::GetGroup(void) {
50 * \ingroup gdcmDictEntry
51 * \brief returns the Dicom Element Number of the current gdcmDictEntry
52 * return the Dicom Element Number
54 inline guint16 gdcmDictEntry::GetElement(void) {
59 * \ingroup gdcmDictEntry
60 * \brief returns the Dicom Value Representation of the current gdcmDictEntry
61 * return the Dicom Value Representation
63 inline std::string gdcmDictEntry::GetVR(void) {
68 * \ingroup gdcmDictEntry
69 * \brief sets the key of the current gdcmDictEntry
70 * @param k New key to be set.
72 inline void gdcmDictEntry::SetKey(std::string k) {
77 * \ingroup gdcmDictEntry
78 * \brief returns the Fourth field of the current gdcmDictEntry
79 * \warning NOT part of the Dicom Standard
80 * \ May be REMOVED an any time
82 * return the Fourth field
84 inline std::string gdcmDictEntry::GetFourth(void) {
89 * \ingroup gdcmDictEntry
90 * \brief returns the Dicom Name of the current gdcmDictEntry
91 * \ e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010)
92 * return the Dicom Name
94 inline std::string gdcmDictEntry::GetName(void) {
99 * \ingroup gdcmDictEntry
100 * \brief Gets the key of the current gdcmDictEntry
103 inline std::string gdcmDictEntry::GetKey(void) {
108 // FIXME : were are the group and element used except from building up
109 // a TagKey. If the answer is nowhere then there is no need
110 // to store the group and element independently.
111 guint16 group; // e.g. 0x0010
112 guint16 element; // e.g. 0x0103
113 std::string vr; // Value Representation i.e. some clue about the nature
114 // of the data represented e.g. "FD" short for
115 // "Floating Point Double"
116 // CLEANME: find the official dicom name for this field !
117 std::string fourth; // Fourth field containing some semantics.
119 std::string name; // e.g. "Patient_Name"
120 TagKey key; // Redundant with (group, element) but we add it
121 // on efficiency purposes.
123 // DCMTK has many fields for handling a DictEntry (see below). What are the
124 // relevant ones for gdcmlib ?
125 // struct DBI_SimpleEntry {
126 // Uint16 upperGroup;
127 // Uint16 upperElement;
129 // const char* tagName;
132 // const char* standardVersion;
133 // DcmDictRangeRestriction groupRestriction;
134 // DcmDictRangeRestriction elementRestriction;
138 //-----------------------------------------------------------------------------