1 /*=========================================================================
4 Module: $RCSfile: gdcmDict.h,v $
6 Date: $Date: 2005/09/02 07:00:04 $
7 Version: $Revision: 1.40 $
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 =========================================================================*/
23 #include "gdcmDictEntry.h"
32 //-----------------------------------------------------------------------------
33 typedef std::string DictKey;
34 typedef std::map<TagKey, DictEntry> TagKeyHT;
35 //-----------------------------------------------------------------------------
37 * \brief Dict acts a memory representation of a dicom dictionary i.e.
38 * it is a container for a collection of dictionary entries.
39 * The dictionary is loaded from in an ascii file.
40 * There should be a single public dictionary (THE dictionary of
41 * the actual DICOM v3) but as many shadow dictionaries as imagers
42 * combined with all software versions...
45 class GDCM_EXPORT Dict : public Base
49 Dict(std::string const &filename);
52 bool AddDict(std::string const &filename);
53 bool RemoveDict(std::string const &filename);
55 void Print(std::ostream &os = std::cout, std::string const &indent = "");
58 bool AddEntry(DictEntry const &newEntry);
59 bool ReplaceEntry(DictEntry const &newEntry);
60 bool RemoveEntry (TagKey const &key);
61 bool RemoveEntry (uint16_t group, uint16_t elem);
65 DictEntry *GetEntry(uint16_t group, uint16_t elem);
66 DictEntry *GetEntry(TagKey const &key);
68 DictEntry *GetFirstEntry();
69 DictEntry *GetNextEntry();
72 void DoTheLoadingJob(std::ifstream &ifs);
74 /// ASCII file holding the Dictionnary
77 /// Access through TagKey
79 TagKeyHT::iterator ItKeyHt;
81 } // end namespace gdcm
83 //-----------------------------------------------------------------------------