]> Creatis software - gdcm.git/blob - src/gdcmDict.h
5e56f3356eacb26d85376f0cecc2c939cb9b4920
[gdcm.git] / src / gdcmDict.h
1 ////////////////////////////////////////////////////////////////////////////
2 // A single DICOM dictionary i.e. a container for a collection of dictionary
3 // entries. There should be a single public dictionary (THE dictionary of
4 // the actual DICOM v3) but as many shadow dictionaries as imagers 
5 // combined with all software versions...
6
7 #ifndef GDCMDICT_H
8 #define GDCMDICT_H
9
10 #include <map>
11 #include "gdcmCommon.h"
12 #include "gdcmDictEntry.h"
13
14 typedef map<TagKey,  gdcmDictEntry*> TagKeyHT;
15 typedef map<TagName, gdcmDictEntry*> TagNameHT;
16
17 /// Build a memory representation of a dicom dictionary by parsing
18 /// an ascii file
19 class GDCM_EXPORT gdcmDict {
20         string name;
21         string filename;
22    /// Access through TagKey (see alternate access with NameHt)
23         TagKeyHT  KeyHt;
24    /// Access through TagName (see alternate access with KeyHt)
25         TagNameHT NameHt;
26 public:
27         gdcmDict(string & FileName);
28         ~gdcmDict();
29         int AddNewEntry (gdcmDictEntry* NewEntry);
30         int ReplaceEntry(gdcmDictEntry* NewEntry);
31         int RemoveEntry (TagKey key);
32         int RemoveEntry (guint16 group, guint16 element);
33         gdcmDictEntry * GetTagByNumber(guint16 group, guint16 element);
34         gdcmDictEntry * GetTagByName(TagName name);
35         void Print(ostream&);
36         void PrintByKey(ostream&);
37         void PrintByName(ostream&);
38         TagKeyHT & GetEntries(void) { return KeyHt; }
39 };
40
41 #endif