1 /*=========================================================================
4 Module: $RCSfile: gdcmDict.h,v $
6 Date: $Date: 2004/09/27 08:39:06 $
7 Version: $Revision: 1.18 $
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.html 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
47 gdcmDict(std::string const & FileName);
51 void Print(std::ostream &os = std::cout);
52 void PrintByKey(std::ostream &os = std::cout);
53 void PrintByName(std::ostream &os = std::cout);
56 bool AddNewEntry (gdcmDictEntry *NewEntry);
57 bool ReplaceEntry(gdcmDictEntry *NewEntry);
58 bool RemoveEntry (gdcmTagKey key);
59 bool RemoveEntry (uint16_t group, uint16_t element);
62 gdcmDictEntry *GetDictEntryByName(TagName name);
63 gdcmDictEntry *GetDictEntryByNumber(uint16_t group, uint16_t element);
65 std::list<std::string> *GetDictEntryNames();
66 std::map<std::string, std::list<std::string> > *
67 GetDictEntryNamesByCategory();
69 /// \brief Returns a ref to the Dicom Dictionary H table (map)
70 /// @return the Dicom Dictionary H table
71 TagKeyHT & GetEntriesByKey() { return KeyHt; }
73 /// \brief Returns a ref to the Dicom Dictionary H table (map)
74 /// @return the Dicom Dictionary H table
75 TagNameHT & GetEntriesByName() { return NameHt; }
78 /// ASCII file holding the Dictionnary
80 /// Access through gdcmTagKey (see alternate access with NameHt)
82 /// Access through TagName (see alternate access with KeyHt)
86 //-----------------------------------------------------------------------------