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; };
40 void Print (std::ostream & os = std::cout);
42 * \ingroup gdcmHeaderEntry
43 * \brief Sets the print level for the Dicom Header Elements
44 * \note 0 for Light Print; 1 for 'medium' Print, 2 for Heavy
46 void SetPrintLevel(int level) { printLevel = level; };
49 * \ingroup gdcmHeaderEntry
50 * \brief Sets the offset of the Dicom Element
51 * \warning : use with caution !
52 * @param of offset to be set
54 inline void gdcmHeaderEntry::SetOffset(size_t of) { Offset = of; };
57 * \ingroup gdcmHeaderEntry
58 * \brief Sets the DicEntry of the current Dicom Element
59 * @param NewEntry pointer to the DictEntry
61 inline void gdcmHeaderEntry::SetDictEntry(gdcmDictEntry *NewEntry) {
66 * \ingroup gdcmHeaderEntry
67 * \brief Sets to TRUE the ImplicitVr flag of the current Dicom Element
69 inline void gdcmHeaderEntry::SetImplicitVr(void) {
74 * \ingroup gdcmHeaderEntry
75 * \brief tells us if the current Dicom Element was checked as ImplicitVr
76 * @return true if the current Dicom Element was checked as ImplicitVr
78 inline bool gdcmHeaderEntry::IsImplicitVr(void) {
83 * \ingroup gdcmHeaderEntry
84 * \brief Gets the DicEntry of the current Dicom Element
85 * @return the DicEntry of the current Dicom Element
87 gdcmDictEntry * gdcmHeaderEntry::GetDictEntry(void) {
92 * \ingroup gdcmHeaderEntry
93 * \brief tells us if the VR of the current Dicom Element is Unkonwn
94 * @return true if the VR is unkonwn
96 inline bool gdcmHeaderEntry::IsVRUnknown(void) {
97 return entry->IsVRUnknown();
101 // FIXME: In fact we should be more specific and use :
102 // friend gdcmHeaderEntry * gdcmHeader::ReadNextElement(void);
103 friend class gdcmHeader;
106 gdcmDictEntry *entry;
107 guint32 UsableLength; // Updated from ReadLength, by FixFoungLentgh()
108 // for fixing a bug in the header or helping
109 // the parser going on
111 guint32 ReadLength; // Length actually read on disk
112 // (before FixFoundLength)
113 // ReadLength will be updated only when
114 // FixFoundLength actually fixes a bug in the header,
115 // not when it performs a trick to help the Parser
117 // *for internal* use only
119 bool ImplicitVr; // Even when reading explicit vr files, some
120 // elements happen to be implicit. Flag them here
121 // since we can't use the entry->vr without breaking
122 // the underlying dictionary.
126 void *voidArea; // unsecure memory area to hold 'non string' values
127 // (ie : Lookup Tables, overlays)
128 size_t Offset; // Offset from the begining of file for direct user access
132 //-----------------------------------------------------------------------------