1 /*=========================================================================
4 Module: $RCSfile: gdcmDict.h,v $
6 Date: $Date: 2004/07/02 13:55:27 $
7 Version: $Revision: 1.16 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
22 #include "gdcmCommon.h"
23 #include "gdcmDictEntry.h"
29 //-----------------------------------------------------------------------------
30 typedef std::map<gdcmTagKey, gdcmDictEntry*> TagKeyHT;
31 typedef std::map<TagName, gdcmDictEntry*> TagNameHT;
33 //-----------------------------------------------------------------------------
36 * \brief gdcmDict acts a memory representation of a dicom dictionary i.e.
37 * it is a container for a collection of dictionary entries. The
38 * dictionary is loaded from in an ascii file.
39 * There should be a single public dictionary (THE dictionary of
40 * the actual DICOM v3) but as many shadow dictionaries as imagers
41 * combined with all software versions...
44 class GDCM_EXPORT gdcmDict {
46 gdcmDict(std::string & FileName);
50 void Print(std::ostream &os = std::cout);
51 void PrintByKey(std::ostream &os = std::cout);
52 void PrintByName(std::ostream &os = std::cout);
55 bool AddNewEntry (gdcmDictEntry *NewEntry);
56 bool ReplaceEntry(gdcmDictEntry *NewEntry);
57 bool RemoveEntry (gdcmTagKey key);
58 bool RemoveEntry (uint16_t group, uint16_t element);
61 gdcmDictEntry *GetDictEntryByName(TagName name);
62 gdcmDictEntry *GetDictEntryByNumber(uint16_t group, uint16_t element);
64 std::list<std::string> *GetDictEntryNames(void);
65 std::map<std::string, std::list<std::string> > *
66 GetDictEntryNamesByCategory(void);
68 /// \brief Returns a ref to the Dicom Dictionary H table (map)
69 /// @return the Dicom Dictionary H table
70 TagKeyHT & GetEntriesByKey(void) { return KeyHt; }
72 /// \brief Returns a ref to the Dicom Dictionary H table (map)
73 /// @return the Dicom Dictionary H table
74 TagNameHT & GetEntriesByName(void) { return NameHt; }
77 /// ASCII file holding the Dictionnary
79 /// Access through gdcmTagKey (see alternate access with NameHt)
81 /// Access through TagName (see alternate access with KeyHt)
85 //-----------------------------------------------------------------------------