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; };
27 inline void * GetVoidArea(void) { return voidArea; };
28 inline size_t GetOffset(void) { return Offset; };
29 inline guint32 GetLength(void) { return UsableLength; };
30 inline void SetVR(std::string v) { entry->SetVR(v); };
31 inline void SetLength(guint32 l) { ReadLength=UsableLength=l;};
33 // The following 3 members, for internal use only !
34 inline void SetReadLength(guint32 l) { ReadLength = l; };
35 inline void SetUsableLength(guint32 l){ UsableLength = l; };
36 inline guint32 GetReadLength(void) { return ReadLength;};
38 inline void SetValue(std::string val) { value = val; };
39 inline void SetVoidArea(void * area) { voidArea = area; };
41 void Print (std::ostream & os = std::cout);
43 * \ingroup gdcmHeaderEntry
44 * \brief Sets the print level for the Dicom Header Elements
45 * \note 0 for Light Print; 1 for 'medium' Print, 2 for Heavy
47 void SetPrintLevel(int level) { printLevel = level; };
50 * \ingroup gdcmHeaderEntry
51 * \brief Sets the offset of the Dicom Element
52 * \warning : use with caution !
53 * @param of offset to be set
55 inline void gdcmHeaderEntry::SetOffset(size_t of) { Offset = of; };
58 * \ingroup gdcmHeaderEntry
59 * \brief Sets the DicEntry of the current Dicom Element
60 * @param NewEntry pointer to the DictEntry
62 inline void gdcmHeaderEntry::SetDictEntry(gdcmDictEntry *NewEntry) {
67 * \ingroup gdcmHeaderEntry
68 * \brief Sets to TRUE the ImplicitVr flag of the current Dicom Element
70 inline void gdcmHeaderEntry::SetImplicitVr(void) {
75 * \ingroup gdcmHeaderEntry
76 * \brief tells us if the current Dicom Element was checked as ImplicitVr
77 * @return true if the current Dicom Element was checked as ImplicitVr
79 inline bool gdcmHeaderEntry::IsImplicitVr(void) {
84 * \ingroup gdcmHeaderEntry
85 * \brief Gets the DicEntry of the current Dicom Element
86 * @return the DicEntry of the current Dicom Element
88 gdcmDictEntry * gdcmHeaderEntry::GetDictEntry(void) {
93 * \ingroup gdcmHeaderEntry
94 * \brief tells us if the VR of the current Dicom Element is Unkonwn
95 * @return true if the VR is unkonwn
97 inline bool gdcmHeaderEntry::IsVRUnknown(void) {
98 return entry->IsVRUnknown();
102 // FIXME: In fact we should be more specific and use :
103 // friend gdcmHeaderEntry * gdcmHeader::ReadNextElement(void);
104 friend class gdcmHeader;
107 gdcmDictEntry *entry;
108 guint32 UsableLength; // Updated from ReadLength, by FixFoungLentgh()
109 // for fixing a bug in the header or helping
110 // the parser going on
112 guint32 ReadLength; // Length actually read on disk
113 // (before FixFoundLength)
114 // ReadLength will be updated only when
115 // FixFoundLength actually fixes a bug in the header,
116 // not when it performs a trick to help the Parser
118 // *for internal* use only
120 bool ImplicitVr; // Even when reading explicit vr files, some
121 // elements happen to be implicit. Flag them here
122 // since we can't use the entry->vr without breaking
123 // the underlying dictionary.
127 void *voidArea; // unsecure memory area to hold 'non string' values
128 // (ie : Lookup Tables, overlays)
129 size_t Offset; // Offset from the begining of file for direct user access
133 //-----------------------------------------------------------------------------