]> Creatis software - gdcm.git/blob - src/gdcmDictEntry.h
* src/*.h : add comments
[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         // fabrique une 'clé' par concaténation du numGroupe et du numElement
54         
55         // Pourquoi fait-elle partie de DictEntry?
56         // elle pourrait etre utilisée egalement ailleurs, hors tout Dictionnaire
57         
58         // Pourquoi 'static'?
59         
60    static TagKey TranslateToKey(guint16 group, guint16 element);
61         
62    guint16      GetGroup(void)  {return group;  };
63    guint16      GetElement(void){return element;};
64    std::string  GetVR(void)     {return vr;     };
65    void         SetVR(std::string);
66    void         SetKey(std::string k){ key = k; };
67    bool         IsVrUnknown(void);
68    std::string  GetFourth(void) {return fourth;};
69    std::string  GetName(void)   {return name;  };
70    std::string  GetKey(void)    {return key;   };
71 };
72
73 #endif