]> Creatis software - gdcm.git/blob - src/gdcmElValue.h
* src/gdcmHeader.cxx gdcmHeader::gdcmHeader now calls LoadElements(),
[gdcm.git] / src / gdcmElValue.h
1 // $Header: /cvs/public/gdcm/src/Attic/gdcmElValue.h,v 1.3 2003/03/24 13:11:28 frog Exp $
2
3 #ifndef GDCMELVALUE_H
4 #define GDCMELVALUE_H
5
6 #include "gdcmDictEntry.h"
7 class gdcmHeader;
8
9
10 ///////////////////////////////////////////////////////////////////////////
11 // The dicom header of a Dicom file contains a set of such ELement VALUES
12 // (when successfuly parsed against a given Dicom dictionary)
13 class GDCM_EXPORT gdcmElValue {
14 private:
15         gdcmDictEntry *entry;
16         guint32 LgrElem;
17         bool ImplicitVr;       // Even when reading explicit vr files, some
18                                // elements happen to be implicit. Flag them here
19                                // since we can't use the entry->vr without breaking
20                                // the underlying dictionary.
21         void SetOffset(size_t of){ Offset = of; };
22    // FIXME: In fact we should be more specific and use :
23    //friend gdcmElValue * gdcmHeader::ReadNextElement(void);
24    friend class gdcmHeader;
25 public:
26         string  value;
27         size_t Offset;     // Offset from the begining of file for direct user access
28         
29         gdcmElValue(gdcmDictEntry*);
30         void SetDictEntry(gdcmDictEntry *NewEntry) { entry = NewEntry; };
31         bool   IsVrUnknown(void) { return entry->IsVrUnknown(); };
32         void SetImplicitVr(void) { ImplicitVr = true; };
33         bool  IsImplicitVr(void) { return ImplicitVr; };
34         
35         gdcmDictEntry * GetDictEntry(void) { return entry;    };
36         guint16 GetGroup(void)   { return entry->GetGroup();  };
37         guint16 GetElement(void) { return entry->GetElement();};
38         string  GetKey(void)     { return entry->GetKey();    };
39         string  GetName(void)    { return entry->GetName();   };
40         string  GetVR(void)      { return entry->GetVR();     };
41         void    SetVR(string v)  { entry->SetVR(v);           }; 
42         void SetLength(guint32 l){ LgrElem = l;               };
43         guint32 GetLength(void)  { return LgrElem;            };
44         
45         void SetValue(string val){ value = val; };
46         string  GetValue(void)   { return value;};
47
48         size_t  GetOffset(void)  { return Offset;};
49 };
50
51
52 #endif