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