00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GDCMDOCENTRY_H
00020 #define GDCMDOCENTRY_H
00021
00022 #include "gdcmRefCounter.h"
00023 #include "gdcmDictEntry.h"
00024
00025 #include <iostream>
00026 #include <fstream>
00027
00028 namespace gdcm
00029 {
00030 class File;
00031 class SeqEntry;
00032
00033
00038 class GDCM_EXPORT DocEntry : public RefCounter
00039 {
00040 gdcmTypeMacro(DocEntry);
00041
00042 public:
00043 virtual void Print (std::ostream &os = std::cout, std::string const &indent = "");
00044 virtual void WriteContent(std::ofstream *fp, FileType filetype);
00045
00048 DictEntry * GetDictEntry() { return DicomDict; }
00049
00051 const uint16_t &GetGroup() const { return DicomDict->GetGroup(); }
00052
00054 const uint16_t &GetElement() const { return DicomDict->GetElement();}
00055
00057 TagKey GetKey() const { return DicomDict->GetKey(); }
00058
00061 std::string const &GetName() const { return DicomDict->GetName(); }
00062
00066 VRKey const &GetVR() const { return DicomDict->GetVR(); }
00067
00071 std::string const &GetVM() const { return DicomDict->GetVM(); }
00072
00074 void SetVM( TagName const &v) { DicomDict->SetVM(v); }
00075
00079 const size_t &GetOffset() const { return Offset; }
00080
00083 void SetReadLength(uint32_t l) { ReadLength = l; }
00088 const uint32_t &GetReadLength() const { return ReadLength; }
00089
00092 virtual void SetLength(uint32_t l) { Length = l; }
00096 const uint32_t &GetLength() const { return Length; }
00097
00098 uint32_t GetFullLength();
00099 virtual uint32_t ComputeFullLength() = 0;
00100
00101
00105 void SetOffset(size_t of) { Offset = of; }
00106
00108 void SetImplicitVR() { ImplicitVR = true; }
00109
00112 bool IsImplicitVR() const { return ImplicitVR; }
00113
00116 bool IsVRUnknown() const { return DicomDict->IsVRUnknown(); }
00117
00120 bool IsVMUnknown() const { return DicomDict->IsVMUnknown(); }
00121
00122 bool IsItemDelimitor();
00123 bool IsItemStarter();
00124 bool IsSequenceDelimitor();
00125
00126 virtual void Copy(DocEntry *doc);
00127
00128 protected:
00129 DocEntry(DictEntry*);
00130 virtual ~DocEntry();
00131
00133 DictEntry *DicomDict;
00134
00137 uint32_t Length;
00138
00140 uint32_t ReadLength;
00141
00145 bool ImplicitVR;
00146
00148 size_t Offset;
00149
00150 private:
00151 };
00152 }
00153
00154 #endif