1 /*=========================================================================
4 Module: $RCSfile: gdcmDict.h,v $
6 Date: $Date: 2004/11/16 02:54:35 $
7 Version: $Revision: 1.23 $
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"
32 //-----------------------------------------------------------------------------
33 typedef std::map<TagKey, DictEntry> TagKeyHT;
34 typedef std::map<TagName, DictEntry> TagNameHT;
35 typedef std::list<std::string> EntryNamesList;
36 typedef std::map<std::string,
37 std::list<std::string> > EntryNamesByCatMap;
38 //-----------------------------------------------------------------------------
41 * \brief Dict acts a memory representation of a dicom dictionary i.e.
42 * it is a container for a collection of dictionary entries. The
43 * dictionary is loaded from in an ascii file.
44 * There should be a single public dictionary (THE dictionary of
45 * the actual DICOM v3) but as many shadow dictionaries as imagers
46 * combined with all software versions...
49 class GDCM_EXPORT Dict
52 Dict(std::string const & filename);
56 void Print(std::ostream &os = std::cout);
57 void PrintByKey(std::ostream &os = std::cout);
58 void PrintByName(std::ostream &os = std::cout);
61 bool AddNewEntry (DictEntry const & newEntry);
62 bool ReplaceEntry(DictEntry const & newEntry);
63 bool RemoveEntry (TagKey const & key);
64 bool RemoveEntry (uint16_t group, uint16_t element);
67 DictEntry *GetDictEntryByName(TagName const & name);
68 DictEntry *GetDictEntryByNumber(uint16_t group, uint16_t element);
70 EntryNamesList *GetDictEntryNames();
71 EntryNamesByCatMap *GetDictEntryNamesByCategory();
73 /// \brief Returns a ref to the Dicom Dictionary H table (map)
74 /// @return the Dicom Dictionary H table
75 const TagKeyHT & GetEntriesByKey() const { return KeyHt; }
77 /// \brief Returns a ref to the Dicom Dictionary H table (map)
78 /// @return the Dicom Dictionary H table
79 const TagNameHT & GetEntriesByName() const { return NameHt; }
82 /// ASCII file holding the Dictionnary
85 /// Access through TagKey (see alternate access with NameHt)
88 /// Access through TagName (see alternate access with KeyHt)
91 } // end namespace gdcm
93 //-----------------------------------------------------------------------------