1 /*=========================================================================
4 Module: $RCSfile: gdcmDict.h,v $
6 Date: $Date: 2004/10/12 04:35:45 $
7 Version: $Revision: 1.19 $
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"
31 //-----------------------------------------------------------------------------
32 typedef std::map<TagKey, DictEntry*> TagKeyHT;
33 typedef std::map<TagName, DictEntry*> TagNameHT;
35 //-----------------------------------------------------------------------------
38 * \brief Dict acts a memory representation of a dicom dictionary i.e.
39 * it is a container for a collection of dictionary entries. The
40 * dictionary is loaded from in an ascii file.
41 * There should be a single public dictionary (THE dictionary of
42 * the actual DICOM v3) but as many shadow dictionaries as imagers
43 * combined with all software versions...
46 class GDCM_EXPORT Dict
49 Dict(std::string const & FileName);
53 void Print(std::ostream &os = std::cout);
54 void PrintByKey(std::ostream &os = std::cout);
55 void PrintByName(std::ostream &os = std::cout);
58 bool AddNewEntry (DictEntry *NewEntry);
59 bool ReplaceEntry(DictEntry *NewEntry);
60 bool RemoveEntry (TagKey key);
61 bool RemoveEntry (uint16_t group, uint16_t element);
64 DictEntry *GetDictEntryByName(TagName name);
65 DictEntry *GetDictEntryByNumber(uint16_t group, uint16_t element);
67 std::list<std::string> *GetDictEntryNames();
68 std::map<std::string, std::list<std::string> > *
69 GetDictEntryNamesByCategory();
71 /// \brief Returns a ref to the Dicom Dictionary H table (map)
72 /// @return the Dicom Dictionary H table
73 TagKeyHT & GetEntriesByKey() { return KeyHt; }
75 /// \brief Returns a ref to the Dicom Dictionary H table (map)
76 /// @return the Dicom Dictionary H table
77 TagNameHT & GetEntriesByName() { return NameHt; }
80 /// ASCII file holding the Dictionnary
82 /// Access through TagKey (see alternate access with NameHt)
84 /// Access through TagName (see alternate access with KeyHt)
87 } // end namespace gdcm
89 //-----------------------------------------------------------------------------