2 //-----------------------------------------------------------------------------
3 #ifndef GDCMDICTENTRY_H
4 #define GDCMDICTENTRY_H
6 #include "gdcmCommon.h"
8 //-----------------------------------------------------------------------------
10 * \defgroup gdcmDictEntry
12 * the gdcmDictEntry in an element contained by the gdcmDict.
14 * - the key referenced by the DICOM norm or the constructor (for private keys)
15 * - the corresponding name in english (it's equivalent to a label)
19 class GDCM_EXPORT gdcmDictEntry {
21 gdcmDictEntry(guint16 group,
23 std::string vr = "Unknown",
24 std::string fourth = "Unknown",
25 std::string name = "Unknown");
27 static TagKey TranslateToKey(guint16 group, guint16 element);
28 void SetVR(std::string);
31 * \ingroup gdcmDictEntry
32 * \brief tells if the V(alue) R(epresentation) is known (?!)
36 inline bool gdcmDictEntry::IsVRUnknown() {
37 if ( vr == "Unknown" )
43 * \ingroup gdcmDictEntry
44 * \brief returns the Dicom Group Number of the current gdcmDictEntry
45 * return the Dicom Group Number
47 inline guint16 gdcmDictEntry::GetGroup(void) {
52 * \ingroup gdcmDictEntry
53 * \brief returns the Dicom Element Number of the current gdcmDictEntry
54 * return the Dicom Element Number
56 inline guint16 gdcmDictEntry::GetElement(void) {
61 * \ingroup gdcmDictEntry
62 * \brief returns the Dicom Value Representation of the current gdcmDictEntry
63 * return the Dicom Value Representation
65 inline std::string gdcmDictEntry::GetVR(void) {
70 * \ingroup gdcmDictEntry
71 * \brief sets the key of the current gdcmDictEntry
72 * @param k New key to be set.
74 inline void gdcmDictEntry::SetKey(std::string k) {
79 * \ingroup gdcmDictEntry
80 * \brief returns the Fourth field of the current gdcmDictEntry
81 * \warning NOT part of the Dicom Standard
82 * \ May be REMOVED an any time
84 * return the Fourth field
86 inline std::string gdcmDictEntry::GetFourth(void) {
91 * \ingroup gdcmDictEntry
92 * \brief returns the Dicom Name of the current gdcmDictEntry
93 * \ e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010)
94 * return the Dicom Name
96 inline std::string gdcmDictEntry::GetName(void) {
101 * \ingroup gdcmDictEntry
102 * \brief Gets the key of the current gdcmDictEntry
105 inline std::string gdcmDictEntry::GetKey(void) {
110 // FIXME : were 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.
113 guint16 group; // e.g. 0x0010
114 guint16 element; // e.g. 0x0103
115 std::string vr; // Value Representation i.e. some clue about the nature
116 // of the data represented e.g. "FD" short for
117 // "Floating Point Double"
118 // CLEANME: find the official dicom name for this field !
119 std::string fourth; // Fourth field containing some semantics.
121 std::string name; // e.g. "Patient_Name"
122 TagKey key; // Redundant with (group, element) but we add it
123 // on efficiency purposes.
125 // DCMTK has many fields for handling a DictEntry (see below). What are the
126 // relevant ones for gdcmlib ?
127 // struct DBI_SimpleEntry {
128 // Uint16 upperGroup;
129 // Uint16 upperElement;
131 // const char* tagName;
134 // const char* standardVersion;
135 // DcmDictRangeRestriction groupRestriction;
136 // DcmDictRangeRestriction elementRestriction;
140 //-----------------------------------------------------------------------------