2 //-----------------------------------------------------------------------------
3 #ifndef GDCMHeaderEntry_H
4 #define GDCMHeaderEntry_H
6 #include "gdcmDictEntry.h"
11 //-----------------------------------------------------------------------------
13 * The dicom header of a Dicom file contains a set of such entries
14 * (when successfuly parsed against a given Dicom dictionary)
16 class GDCM_EXPORT gdcmHeaderEntry {
18 gdcmHeaderEntry(gdcmDictEntry*);
20 inline guint16 GetGroup(void) { return entry->GetGroup(); };
21 inline guint16 GetElement(void) { return entry->GetElement();};
22 inline std::string GetKey(void) { return entry->GetKey(); };
23 inline std::string GetName(void) { return entry->GetName(); };
24 inline std::string GetVR(void) { return entry->GetVR(); };
25 inline std::string GetValue(void) { return value; };
26 inline void * GetVoidArea(void) { return voidArea; };
27 inline size_t GetOffset(void) { return Offset; };
28 inline guint32 GetLength(void) { return UsableLength; };
29 inline void SetVR(std::string v) { entry->SetVR(v); };
30 inline void SetLength(guint32 l) { ReadLength=UsableLength=l;};
32 // The following 3 members, for internal use only !
33 inline void SetReadLength(guint32 l) { ReadLength = l; };
34 inline void SetUsableLength(guint32 l){ UsableLength = l; };
35 inline guint32 GetReadLength(void) { return ReadLength;};
37 inline void SetValue(std::string val) { value = val; };
38 inline void SetVoidArea(void * area) { voidArea = area; };
41 * \ingroup gdcmHeaderEntry
42 * \brief Sets the offset of the Dicom Element
43 * \warning : use with caution !
44 * @param of offset to be set
46 inline void gdcmHeaderEntry::SetOffset(size_t of) { Offset = of; };
49 * \ingroup gdcmHeaderEntry
50 * \brief Sets the DicEntry of the current Dicom Element
51 * @param NewEntry pointer to the DictEntry
53 inline void gdcmHeaderEntry::SetDictEntry(gdcmDictEntry *NewEntry) {
58 * \ingroup gdcmHeaderEntry
59 * \brief Sets to TRUE the ImplicitVr flag of the current Dicom Element
61 inline void gdcmHeaderEntry::SetImplicitVr(void) {
66 * \ingroup gdcmHeaderEntry
67 * \brief tells us if the current Dicom Element was checked as ImplicitVr
68 * @return true if the current Dicom Element was checked as ImplicitVr
70 inline bool gdcmHeaderEntry::IsImplicitVr(void) {
75 * \ingroup gdcmHeaderEntry
76 * \brief Gets the DicEntry of the current Dicom Element
77 * @return the DicEntry of the current Dicom Element
79 gdcmDictEntry * gdcmHeaderEntry::GetDictEntry(void) {
84 * \ingroup gdcmHeaderEntry
85 * \brief tells us if the VR of the current Dicom Element is Unkonwn
86 * @return true if the VR is unkonwn
88 inline bool gdcmHeaderEntry::IsVRUnknown(void) {
89 return entry->IsVRUnknown();
93 // FIXME: In fact we should be more specific and use :
94 // friend gdcmHeaderEntry * gdcmHeader::ReadNextElement(void);
95 friend class gdcmHeader;
99 guint32 UsableLength; // Updated from ReadLength, by FixFoungLentgh()
100 // for fixing a bug in the header or helping
101 // the parser going on
103 guint32 ReadLength; // Length actually read on disk
104 // (before FixFoundLength)
105 // ReadLength will be updated only when
106 // FixFoundLength actually fixes a bug in the header,
107 // not when it performs a trick to help the Parser
109 // *for internal* use only
111 bool ImplicitVr; // Even when reading explicit vr files, some
112 // elements happen to be implicit. Flag them here
113 // since we can't use the entry->vr without breaking
114 // the underlying dictionary.
118 void *voidArea; // unsecure memory area to hold 'non string' values
119 // (ie : Lookup Tables, overlays)
120 size_t Offset; // Offset from the begining of file for direct user access
123 //-----------------------------------------------------------------------------