2 //-----------------------------------------------------------------------------
3 #ifndef GDCMHeaderEntry_H
4 #define GDCMHeaderEntry_H
9 #include "gdcmDictEntry.h"
12 //-----------------------------------------------------------------------------
14 * The dicom header of a Dicom file contains a set of such entries
15 * (when successfuly parsed against a given Dicom dictionary)
17 class GDCM_EXPORT gdcmHeaderEntry {
19 gdcmHeaderEntry(gdcmDictEntry*);
21 inline guint16 GetGroup(void) { return entry->GetGroup(); };
22 inline guint16 GetElement(void) { return entry->GetElement();};
23 inline std::string GetKey(void) { return entry->GetKey(); };
24 inline std::string GetName(void) { return entry->GetName(); };
25 inline std::string GetVR(void) { return entry->GetVR(); };
26 inline std::string GetValue(void) { return value; };
28 inline void * GetVoidArea(void) { return voidArea; };
29 inline size_t GetOffset(void) { return Offset; };
30 inline guint32 GetLength(void) { return UsableLength; };
32 inline void SetVR(std::string v) { entry->SetVR(v); };
33 inline void SetLength(guint32 l) { ReadLength=UsableLength=l;};
35 // The following 3 members, for internal use only !
36 inline void SetReadLength(guint32 l) { ReadLength = l; };
37 inline void SetUsableLength(guint32 l){ UsableLength = l; };
38 inline guint32 GetReadLength(void) { return ReadLength;};
40 inline void SetValue(std::string val) { value = val; };
41 inline void SetVoidArea(void * area) { voidArea = area; };
44 * \ingroup gdcmHeaderEntry
45 * \brief Sets the offset of the Dicom Element
46 * \warning : use with caution !
47 * @param of offset to be set
49 inline void gdcmHeaderEntry::SetOffset(size_t of) { Offset = of; };
52 * \ingroup gdcmHeaderEntry
53 * \brief Sets to TRUE the ImplicitVr flag of the current Dicom Element
55 inline void gdcmHeaderEntry::SetImplicitVR(void) { ImplicitVR = true; };
58 * \ingroup gdcmHeaderEntry
59 * \brief tells us if the current Dicom Element was checked as ImplicitVr
60 * @return true if the current Dicom Element was checked as ImplicitVr
62 inline bool gdcmHeaderEntry::IsImplicitVR(void) { return ImplicitVR; };
65 * \ingroup gdcmHeaderEntry
66 * \brief tells us if the VR of the current Dicom Element is Unkonwn
67 * @return true if the VR is unkonwn
69 inline bool gdcmHeaderEntry::IsVRUnknown(void) { return entry->IsVRUnknown(); };
72 * \ingroup gdcmHeaderEntry
73 * \brief Sets the DicEntry of the current Dicom Element
74 * @param NewEntry pointer to the DictEntry
76 inline void gdcmHeaderEntry::SetDictEntry(gdcmDictEntry *NewEntry) {
81 * \ingroup gdcmHeaderEntry
82 * \brief Gets the DicEntry of the current Dicom Element
83 * @return the DicEntry of the current Dicom Element
85 gdcmDictEntry * gdcmHeaderEntry::GetDictEntry(void) { return entry; };
88 * \ingroup gdcmHeaderEntry
89 * \brief Sets the print level for the Dicom Header Elements
90 * \note 0 for Light Print; 1 for 'medium' Print, 2 for Heavy
92 void SetPrintLevel(int level) { printLevel = level; };
93 void Print (std::ostream & os = std::cout);
96 // FIXME: In fact we should be more specific and use :
97 // friend gdcmHeaderEntry * gdcmHeader::ReadNextElement(void);
98 friend class gdcmHeader;
101 gdcmDictEntry *entry;
102 guint32 UsableLength; // Updated from ReadLength, by FixFoungLentgh()
103 // for fixing a bug in the header or helping
104 // the parser going on
106 guint32 ReadLength; // Length actually read on disk
107 // (before FixFoundLength)
108 // ReadLength will be updated only when
109 // FixFoundLength actually fixes a bug in the header,
110 // not when it performs a trick to help the Parser
112 // *for internal* use only
114 bool ImplicitVR; // Even when reading explicit vr files, some
115 // elements happen to be implicit. Flag them here
116 // since we can't use the entry->vr without breaking
117 // the underlying dictionary.
121 void *voidArea; // unsecure memory area to hold 'non string' values
122 // (ie : Lookup Tables, overlays)
123 size_t Offset; // Offset from the begining of file for direct user access
127 //-----------------------------------------------------------------------------