]> Creatis software - gdcm.git/blob - src/gdcmElValue.h
* src/gdcm.h splitted in gdcmCommon.h, gdcmDict.h, gdcmDictEntry.h,
[gdcm.git] / src / gdcmElValue.h
1 // gdcmElValue.h
2
3 #ifndef GDCMELVALUE_H
4 #define GDCMELVALUE_H
5
6 #include "gdcmDictEntry.h"
7
8
9 ///////////////////////////////////////////////////////////////////////////
10 // The dicom header of a Dicom file contains a set of such ELement VALUES
11 // (when successfuly parsed against a given Dicom dictionary)
12 class GDCM_EXPORT ElValue {
13 private:
14         gdcmDictEntry *entry;
15         guint32 LgrElem;
16         bool ImplicitVr;       // Even when reading explicit vr files, some
17                                // elements happen to be implicit. Flag them here
18                                // since we can't use the entry->vr without breaking
19                                // the underlying dictionary.
20 public:
21         string  value;
22         size_t Offset;     // Offset from the begining of file for direct user access
23         
24         ElValue(gdcmDictEntry*);
25         void SetDictEntry(gdcmDictEntry *NewEntry) { entry = NewEntry; };
26         bool   IsVrUnknown(void) { return entry->IsVrUnknown(); };
27         void SetImplicitVr(void) { ImplicitVr = true; };
28         bool  IsImplicitVr(void) { return ImplicitVr; };
29         
30         guint16 GetGroup(void)   { return entry->GetGroup();  };
31         guint16 GetElement(void) { return entry->GetElement();};
32         string  GetKey(void)     { return entry->GetKey();    };
33         string  GetName(void)    { return entry->GetName();   };
34         string  GetVR(void)      { return entry->GetVR();     };
35         void    SetVR(string v)  { entry->SetVR(v);           }; 
36         void SetLength(guint32 l){ LgrElem = l;               };
37         guint32 GetLength(void)  { return LgrElem;            };
38         
39         // Question : SetLength est public 
40         // (sinon, on ne pourrait pas l'appeler dans ElValSet)
41         // alors que *personne* ne devrait s'en servir !
42         // c'est *forcément* la lgr de la string 'value', non?
43
44         void SetValue(string val){ value = val; };
45         string  GetValue(void)   { return value;};
46
47         void SetOffset(size_t of){ Offset = of; };
48         size_t  GetOffset(void)  { return Offset;};
49         // Question : SetOffset est public ...
50         // Quel utilisateur serait ammené à modifier l'Offset ?
51 };
52
53 #endif