]> Creatis software - gdcm.git/blob - src/gdcmDictEntry.h
remove H Table NameHT
[gdcm.git] / src / gdcmDictEntry.h
1 // gdcmDictEntry.h
2
3 #ifndef GDCMDICTENTRY_H
4 #define GDCMDICTENTRY_H
5
6 #include "gdcmCommon.h"
7
8 /*
9  * the gdcmDictEntry in an element contained by the gdcmDict.
10  * It contains :
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)
13  *  - the owner group
14  *  - etc.
15  */
16 class GDCM_EXPORT gdcmDictEntry {
17 private:
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.
28                         //(Group Name abbr.)
29    std::string  name;   // e.g. "Patient_Name"
30    TagKey  key;         // Redundant with (group, element) but we add it
31                         // on efficiency purposes.
32
33         // DCMTK has many fields for handling a DictEntry (see below). What are the
34         // relevant ones for gdcmlib ?
35         //      struct DBI_SimpleEntry {
36         //         Uint16 upperGroup;
37         //         Uint16 upperElement;
38         //         DcmEVR evr;
39         //         const char* tagName;
40         //         int vmMin;
41         //         int vmMax;
42         //         const char* standardVersion;
43         //         DcmDictRangeRestriction groupRestriction;
44         //         DcmDictRangeRestriction elementRestriction;
45         //       };
46 public:
47    gdcmDictEntry(guint16 group, 
48                  guint16 element,
49                  std::string vr     = "Unknown",
50                  std::string fourth = "Unknown",
51                  std::string name   = "Unknown");
52         
53    static TagKey TranslateToKey(guint16 group, guint16 element);
54
55 //   bool         IsVrUnknown(void);
56         
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);
65
66
67
68 /**
69  * \ingroup     gdcmDictEntry
70  * \brief       tells if the V(alue) R(epresentation) is known (?!)
71  *              
72  * @return 
73  */
74 inline bool gdcmDictEntry::IsVrUnknown() {
75         if ( vr == "Unknown" )
76                 return true;
77         return false;
78 }
79
80
81 /**
82  * \ingroup gdcmDictEntry
83  * \brief   returns the Dicom Group Number of the current gdcmDictEntry
84  * return the Dicom Group Number
85  */
86  inline guint16      gdcmDictEntry::GetGroup(void)  {
87     return group; 
88  }
89   
90 /**
91  * \ingroup gdcmDictEntry
92  * \brief   returns the Dicom Element Number of the current gdcmDictEntry
93  * return the Dicom Element Number
94  */
95  inline guint16      gdcmDictEntry::GetElement(void)  {
96     return element; 
97  }
98  
99  /**
100  * \ingroup gdcmDictEntry
101  * \brief   returns the Dicom Value Representation of the current gdcmDictEntry
102  * return the Dicom Value Representation
103  */
104  inline std::string      gdcmDictEntry::GetVR(void)  {
105     return vr; 
106  }
107  
108 /**
109  * \ingroup gdcmDictEntry
110  * \brief   sets the key of the current gdcmDictEntry
111  * @param k New key to be set.
112  */
113  inline void      gdcmDictEntry::SetKey(std::string k)  {
114     key = k; 
115  }
116  
117  /**
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
122  * \        NEVER use it
123  * return the Fourth field
124  */
125  inline std::string      gdcmDictEntry::GetFourth(void)  {
126     return fourth; 
127  } 
128
129  /**
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
134  */
135  inline std::string      gdcmDictEntry::GetName(void)  {
136     return name; 
137  } 
138  
139  /**
140  * \ingroup gdcmDictEntry
141  * \brief   Gets the key of the current gdcmDictEntry
142  * @return the key .
143  */
144  inline std::string      gdcmDictEntry::GetKey(void)  {
145     return key; 
146  }
147
148
149 };
150
151 #endif