1 // gdcmHeaderEntrySet.h
2 //-----------------------------------------------------------------------------
3 #ifndef GDCMHeaderEntrySet_H
4 #define GDCMHeaderEntrySet_H
6 #include "gdcmCommon.h"
7 #include "gdcmHeaderEntry.h"
11 #include <list> // for linking together *all* the Dicom Elements
13 //-----------------------------------------------------------------------------
14 typedef std::multimap<TagKey, gdcmHeaderEntry*> TagHeaderEntryHT;
15 typedef std::pair<TagKey, gdcmHeaderEntry*> PairHT;
16 typedef std::pair<TagHeaderEntryHT::iterator,TagHeaderEntryHT::iterator> IterHT;
18 typedef std::list<gdcmHeaderEntry*> ListTag; // for linking together the Elements
20 // TODO : to be removed after re-writting gdcmHeaderEntrySet::UpdateGroupLength
21 // using the chained list instead of the H table
22 typedef std::string GroupKey;
23 typedef std::map<GroupKey, int> GroupHT;
25 //-----------------------------------------------------------------------------
27 * Container for a set of successfully parsed HeaderEntrys (i.e. Dicom Elements).
29 class GDCM_EXPORT gdcmHeaderEntrySet {
31 ~gdcmHeaderEntrySet();
33 void Print(std::ostream &);
35 void Add(gdcmHeaderEntry*);
37 gdcmHeaderEntry* GetHeaderEntryByNumber(guint16 group, guint16 element);
38 std::string GetEntryByNumber(guint16 group, guint16 element);
40 bool SetEntryByNumber(std::string content, guint16 group, guint16 element);
41 bool SetEntryLengthByNumber(guint32 l, guint16 group, guint16 element);
42 bool SetVoidAreaByNumber(void *a, guint16 Group, guint16 Elem );
44 guint32 GenerateFreeTagKeyInGroup(guint16 group);
45 int CheckIfExistByNumber(guint16 Group, guint16 Elem ); // int !
48 * \ingroup gdcmHeaderEntrySet
49 * \brief returns a ref to the Dicom Header H table (multimap)
50 * return the Dicom Header H table
52 inline TagHeaderEntryHT & gdcmHeaderEntrySet::GetTagHT(void) { return tagHT; };
55 * \ingroup gdcmHeaderEntrySet
56 * \brief returns a ref to the Dicom Header chained list
57 * return the Dicom Header chained list
59 inline ListTag & gdcmHeaderEntrySet::GetListEntry(void) { return listEntries; };
61 bool Write(FILE *fp, FileType type);
64 void UpdateGroupLength(bool SkipSequence = false, FileType type = ImplicitVR);
65 void WriteEntries(FileType type, FILE *);
68 TagHeaderEntryHT tagHT; // H Table (multimap), to provide fast access
69 ListTag listEntries; // chained list, to keep the 'spacial' ordering
72 //-----------------------------------------------------------------------------