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 "gdcmBase.h"
00023 #include "gdcmDictEntry.h"
00024
00025 #include <iostream>
00026 #include <fstream>
00027
00028 namespace gdcm
00029 {
00030 class File;
00031 class ValEntry;
00032 class BinEntry;
00033 class SeqEntry;
00034
00035
00040 class GDCM_EXPORT DocEntry : public Base
00041 {
00042 public:
00043 DocEntry(DictEntry*);
00045 virtual ~DocEntry() {};
00046
00047 virtual void Print (std::ostream &os = std::cout, std::string const &indent = "");
00048 virtual void WriteContent(std::ofstream *fp, FileType filetype);
00049
00052 DictEntry * GetDictEntry() { return DicomDict; };
00053
00055 uint16_t GetGroup() { return DicomDict->GetGroup(); };
00056
00058 uint16_t GetElement() { return DicomDict->GetElement();};
00059
00061 void SetKey( TagKey const &key ) { Key = key; }
00063 std::string const &GetKey() const { return Key; }
00064
00067 std::string const &GetName() const { return DicomDict->GetName(); };
00068
00072 std::string const &GetVR() const { return DicomDict->GetVR(); };
00073
00077 std::string const &GetVM() const { return DicomDict->GetVM(); };
00078
00080 void SetVM( TagName const &v) { DicomDict->SetVM(v); };
00081
00085 size_t GetOffset() { return Offset; };
00086
00089 void SetReadLength(uint32_t l) { ReadLength = l; };
00094 uint32_t GetReadLength() { return ReadLength; };
00095
00098 void SetLength(uint32_t l) { Length = l; };
00102 uint32_t GetLength() { return Length; };
00103
00104 uint32_t GetFullLength();
00105
00106
00110 void SetOffset(size_t of) { Offset = of; };
00111
00113 void SetImplicitVR() { ImplicitVR = true; };
00114
00117 bool IsImplicitVR() { return ImplicitVR; };
00118
00121 bool IsVRUnknown() { return DicomDict->IsVRUnknown(); };
00122
00125 bool IsVMUnknown() { return DicomDict->IsVMUnknown(); };
00126
00127 bool IsItemDelimitor();
00128 bool IsSequenceDelimitor();
00129
00130 virtual void Copy(DocEntry *e);
00131
00132 protected:
00134 DictEntry *DicomDict;
00135
00138 uint32_t Length;
00139
00141 uint32_t ReadLength;
00142
00146 bool ImplicitVR;
00147
00149 size_t Offset;
00150
00153 TagKey Key;
00154
00155 private:
00156 };
00157 }
00158
00159 #endif