#include <gdcmContentEntry.h>
Inheritance diagram for gdcm::ContentEntry:
Public Member Functions | |
virtual void | WriteContent (std::ofstream *fp, FileType filetype)=0 |
Writes the common part of any ValEntry, BinEntry, SeqEntry. | |
virtual void | SetValue (std::string const &val) |
Sets the value (string) of the current Dicom entry. | |
std::string const & | GetValue () const |
Returns the 'Value' (e.g. "Dupond Marcel") converted into a 'string', event if it's physically stored on disk as an integer. | |
void | Copy (DocEntry *doc) |
Copies all the attributes from an other DocEntry. | |
virtual void | Print (std::ostream &os=std::cout, std::string const &indent="") |
Prints the common part of ValEntry, BinEntry, SeqEntry. | |
DictEntry * | GetDictEntry () |
Gets the DicEntry of the current Dicom entry. | |
uint16_t | GetGroup () |
Returns the Dicom Group number of the current Dicom entry. | |
uint16_t | GetElement () |
Returns the Dicom Element number of the current Dicom entry. | |
void | SetKey (TagKey const &key) |
Set the 'key' of the current Dicom entry. | |
std::string const & | GetKey () const |
Returns the 'key' of the current Dicom entry. | |
std::string const & | GetName () const |
Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom Dictionnary of the current Dicom Header Entry. | |
std::string const & | GetVR () const |
Returns the 'Value Representation' (e.g. "PN" : Person Name, "SL" : Signed Long), found in the Dicom header or in the Dicom Dictionnary, of the current Dicom entry. | |
std::string const & | GetVM () const |
Returns the 'Value Multiplicity' (e.g. "1", "1-n", "6"), found in the Dicom entry or in the Dicom Dictionnary of the current Dicom entry. | |
void | SetVM (TagName const &v) |
Sets the 'Value Multiplicity' of the current Dicom entry. | |
size_t | GetOffset () |
Returns offset (since the beginning of the file, including the File Preamble, if any) of the value of the current Dicom entry. | |
void | SetReadLength (uint32_t l) |
Sets only 'Read Length' (*not* 'Usable Length') of the current Dicom entry. | |
uint32_t | GetReadLength () |
Returns the 'read length' of the current Dicom entry. | |
void | SetLength (uint32_t l) |
Sets both 'Read Length' and 'Usable Length' of the current Dicom entry. | |
uint32_t | GetLength () |
Returns the actual value length of the current Dicom entry. | |
uint32_t | GetFullLength () |
Gets the full length of the elementary DocEntry (not only value length) depending on the VR. | |
void | SetOffset (size_t of) |
Sets the offset of the Dicom entry. | |
void | SetImplicitVR () |
Sets to TRUE the ImplicitVr flag of the current Dicom entry. | |
bool | IsImplicitVR () |
Tells us if the current Dicom entry was checked as ImplicitVr. | |
bool | IsVRUnknown () |
Tells us if the VR of the current Dicom entry is Unknown. | |
bool | IsVMUnknown () |
Tells us if the VM of the current Dicom entry is Unknown. | |
bool | IsItemDelimitor () |
tells us if entry is the last one of a 'no length' SequenceItem (fffe,e00d) | |
bool | IsSequenceDelimitor () |
tells us if entry is the last one of a 'no length' Sequence (fffe,e0dd) | |
void | SetPrintLevel (int level) |
Sets the print level for the Dicom Header Elements. | |
int | GetPrintLevel () |
Gets the print level for the Dicom Entries. | |
Protected Member Functions | |
ContentEntry (DictEntry *e) | |
Constructor for a given DictEntry. | |
ContentEntry (DocEntry *d) | |
Constructor for a given DocEntry. | |
~ContentEntry () | |
Canonical destructor. | |
Protected Attributes | |
DictEntry * | DicomDict |
pointer to the underlying Dicom dictionary element | |
uint32_t | Length |
Correspond to the real length of the data This length might always be even. | |
uint32_t | ReadLength |
Length to read in the file to obtain data. | |
bool | ImplicitVR |
Even when reading explicit vr files, some elements happen to be implicit. Flag them here since we can't use the entry->vr without breaking the underlying dictionary. | |
size_t | Offset |
Offset from the beginning of file for direct user access. | |
TagKey | Key |
Generalized key of this DocEntry (for details on the generalized key refer to TagKey documentation). | |
int | PrintLevel |
Amount of printed details for each Dicom Entries : 0 : stands for the least detail level. | |
Private Attributes | |
std::string | Value |
Dicom entry value, internaly represented as a std::string. The Value Representation (VR) is independently used in order to interpret (decode) this field. |
Definition at line 37 of file gdcmContentEntry.h.
|
Constructor for a given DictEntry.
Definition at line 37 of file gdcmContentEntry.cxx. References gdcm::GDCM_UNFOUND.
00038 : DocEntry(e) 00039 { 00040 Value = GDCM_UNFOUND; 00041 } |
|
Constructor for a given DocEntry.
Definition at line 47 of file gdcmContentEntry.cxx. References Copy().
|
|
Canonical destructor.
Definition at line 56 of file gdcmContentEntry.cxx.
00057 { 00058 } |
|
Copies all the attributes from an other DocEntry.
Reimplemented from gdcm::DocEntry. Definition at line 65 of file gdcmContentEntry.cxx. References Value. Referenced by gdcm::BinEntry::BinEntry(), ContentEntry(), gdcm::FileHelper::CopyBinEntry(), gdcm::FileHelper::CopyValEntry(), gdcm::File::File(), gdcm::FileHelper::SetWriteToLibido(), and gdcm::ValEntry::ValEntry().
00066 { 00067 DocEntry::Copy(doc); 00068 00069 ContentEntry *entry = dynamic_cast<ContentEntry *>(doc); 00070 if(entry) 00071 Value = entry->Value; 00072 } |
|
Gets the DicEntry of the current Dicom entry.
Definition at line 52 of file gdcmDocEntry.h. Referenced by gdcm::FileHelper::CopyBinEntry(), gdcm::FileHelper::CopyValEntry(), gdcm::DocEntryArchive::Push(), and gdcm::FileHelper::SetWriteToLibido().
00052 { return DicomDict; }; |
|
Returns the Dicom Element number of the current Dicom entry.
Definition at line 58 of file gdcmDocEntry.h. Referenced by gdcm::SQItem::AddEntry(), gdcm::Document::ComputeGroup0002Length(), gdcm::Document::FixDocEntryFoundLength(), gdcm::Document::IsDocEntryAnInteger(), gdcm::DocEntry::IsItemDelimitor(), gdcm::DocEntry::IsSequenceDelimitor(), gdcm::Document::ParseDES(), gdcm::ValEntry::Print(), gdcm::DocEntry::Print(), gdcm::Document::ReadNextDocEntry(), and gdcm::DocEntry::WriteContent().
00058 { return DicomDict->GetElement();}; |
|
Gets the full length of the elementary DocEntry (not only value length) depending on the VR.
Definition at line 150 of file gdcmDocEntry.cxx. References gdcm::DocEntry::GetReadLength(), gdcm::DocEntry::GetVR(), and gdcm::DocEntry::IsImplicitVR().
00151 { 00152 uint32_t l = GetReadLength(); 00153 if ( IsImplicitVR() ) 00154 { 00155 l = l + 8; // 2 (gr) + 2 (el) + 4 (lgth) 00156 } 00157 else 00158 { 00159 if ( GetVR()=="OB" || GetVR()=="OW" || GetVR()=="SQ" ) 00160 { 00161 l = l + 12; // 2 (gr) + 2 (el) + 2 (vr) + 2 (unused) + 4 (lgth) 00162 } 00163 else 00164 { 00165 l = l + 8; // 2 (gr) + 2 (el) + 2 (vr) + 2 (lgth) 00166 } 00167 } 00168 return l; 00169 } |
|
Returns the Dicom Group number of the current Dicom entry.
Definition at line 55 of file gdcmDocEntry.h. Referenced by gdcm::SQItem::AddEntry(), gdcm::Document::ComputeGroup0002Length(), gdcm::Document::FixDocEntryFoundLength(), gdcm::Document::IsDocEntryAnInteger(), gdcm::DocEntry::IsItemDelimitor(), gdcm::DocEntry::IsSequenceDelimitor(), gdcm::Document::LoadDocEntry(), gdcm::Document::ParseDES(), gdcm::ValEntry::Print(), gdcm::DocEntry::Print(), gdcm::Document::ReadNextDocEntry(), gdcm::Document::SkipToNextDocEntry(), gdcm::ValEntry::WriteContent(), gdcm::DocEntry::WriteContent(), and gdcm::BinEntry::WriteContent().
00055 { return DicomDict->GetGroup(); }; |
|
Returns the 'key' of the current Dicom entry.
Definition at line 63 of file gdcmDocEntry.h. Referenced by gdcm::ElementSet::AddEntry(), gdcm::Document::ParseDES(), gdcm::Document::ParseSQ(), gdcm::SQItem::RemoveEntry(), gdcm::ElementSet::RemoveEntry(), gdcm::SQItem::RemoveEntryNoDestroy(), and gdcm::ElementSet::RemoveEntryNoDestroy().
00063 { return Key; } |
|
Returns the actual value length of the current Dicom entry.
Definition at line 102 of file gdcmDocEntry.h. Referenced by gdcm::File::AnonymizeNoLoad(), gdcm::Document::ComputeGroup0002Length(), gdcm::Document::GetDocEntryValue(), gdcm::DocEntrySet::GetEntryLength(), gdcm::File::GetPixelAreaLength(), gdcm::Document::IsDocEntryAnInteger(), gdcm::Document::LoadDocEntry(), gdcm::Document::LoadEntryBinArea(), gdcm::ValEntry::Print(), gdcm::BinEntry::Print(), gdcm::Document::SkipDocEntry(), gdcm::ValEntry::WriteContent(), gdcm::DocEntry::WriteContent(), and gdcm::BinEntry::WriteContent().
00102 { return Length; }; |
|
Returns the 'Name' '(e.g. "Patient's Name") found in the Dicom Dictionnary of the current Dicom Header Entry.
Definition at line 67 of file gdcmDocEntry.h. Referenced by gdcm::DocEntry::Print().
00067 { return DicomDict->GetName(); }; |
|
Returns offset (since the beginning of the file, including the File Preamble, if any) of the value of the current Dicom entry.
Definition at line 85 of file gdcmDocEntry.h. Referenced by gdcm::File::AnonymizeNoLoad(), gdcm::File::File(), gdcm::File::GetPixelOffset(), gdcm::Document::LoadDocEntry(), gdcm::Document::LoadEntryBinArea(), gdcm::Document::ParseDES(), gdcm::DocEntry::Print(), gdcm::SeqEntry::SeqEntry(), and gdcm::Document::SkipToNextDocEntry().
00085 { return Offset; }; |
|
Gets the print level for the Dicom Entries.
Definition at line 48 of file gdcmBase.h.
00048 { return PrintLevel; }; |
|
Returns the 'read length' of the current Dicom entry.
Definition at line 94 of file gdcmDocEntry.h. Referenced by gdcm::DocEntry::GetFullLength(), gdcm::Document::ParseDES(), gdcm::Document::ParseSQ(), gdcm::SeqEntry::Print(), gdcm::DocEntry::Print(), and gdcm::Document::SkipToNextDocEntry().
00094 { return ReadLength; }; |
|
Returns the 'Value' (e.g. "Dupond Marcel") converted into a 'string', event if it's physically stored on disk as an integer.
Definition at line 46 of file gdcmContentEntry.h. Referenced by gdcm::DicomDir::CreateDicomDir(), gdcm::DocEntrySet::GetEntryValue(), gdcm::Document::GetTransferSyntax(), gdcm::ValEntry::Print(), gdcm::BinEntry::Print(), gdcm::FileHelper::SetWriteToLibido(), gdcm::FileHelper::SetWriteToNoLibido(), and gdcm::ValEntry::WriteContent().
00046 { return Value; }; |
|
Returns the 'Value Multiplicity' (e.g. "1", "1-n", "6"), found in the Dicom entry or in the Dicom Dictionnary of the current Dicom entry.
Definition at line 77 of file gdcmDocEntry.h.
00077 { return DicomDict->GetVM(); }; |
|
Returns the 'Value Representation' (e.g. "PN" : Person Name, "SL" : Signed Long), found in the Dicom header or in the Dicom Dictionnary, of the current Dicom entry.
Definition at line 72 of file gdcmDocEntry.h. Referenced by gdcm::Document::ComputeGroup0002Length(), gdcm::FileHelper::CopyBinEntry(), gdcm::File::File(), gdcm::Document::FixDocEntryFoundLength(), gdcm::Document::GetDocEntryUnvalue(), gdcm::Document::GetDocEntryValue(), gdcm::DocEntrySet::GetEntryVR(), gdcm::DocEntry::GetFullLength(), gdcm::DocEntrySet::InsertBinEntry(), gdcm::DocEntrySet::InsertValEntry(), gdcm::Document::IsDocEntryAnInteger(), gdcm::Document::LoadDocEntry(), gdcm::Document::ParseDES(), gdcm::ValEntry::Print(), gdcm::DocEntry::Print(), gdcm::ValEntry::SetValue(), gdcm::ValEntry::WriteContent(), gdcm::DocEntry::WriteContent(), and gdcm::BinEntry::WriteContent().
00072 { return DicomDict->GetVR(); }; |
|
Tells us if the current Dicom entry was checked as ImplicitVr.
Definition at line 117 of file gdcmDocEntry.h. References gdcm::ImplicitVR. Referenced by gdcm::Document::GetDocEntryUnvalue(), gdcm::Document::GetDocEntryValue(), gdcm::DocEntry::GetFullLength(), and gdcm::SeqEntry::SeqEntry().
00117 { return ImplicitVR; }; |
|
tells us if entry is the last one of a 'no length' SequenceItem (fffe,e00d)
Definition at line 175 of file gdcmDocEntry.cxx. References gdcm::DocEntry::GetElement(), and gdcm::DocEntry::GetGroup(). Referenced by gdcm::Document::ParseDES().
00176 { 00177 return (GetGroup() == 0xfffe && GetElement() == 0xe00d); 00178 } |
|
tells us if entry is the last one of a 'no length' Sequence (fffe,e0dd)
Definition at line 184 of file gdcmDocEntry.cxx. References gdcm::DocEntry::GetElement(), and gdcm::DocEntry::GetGroup(). Referenced by gdcm::Document::ParseSQ().
00185 { 00186 return (GetGroup() == 0xfffe && GetElement() == 0xe0dd); 00187 } |
|
Tells us if the VM of the current Dicom entry is Unknown.
Definition at line 125 of file gdcmDocEntry.h.
00125 { return DicomDict->IsVMUnknown(); }; |
|
Tells us if the VR of the current Dicom entry is Unknown.
Definition at line 121 of file gdcmDocEntry.h.
00121 { return DicomDict->IsVRUnknown(); }; |
|
Prints the common part of ValEntry, BinEntry, SeqEntry.
Reimplemented from gdcm::Base. Reimplemented in gdcm::BinEntry, gdcm::SeqEntry, and gdcm::ValEntry. Definition at line 214 of file gdcmDocEntry.cxx. References gdcm::GDCM_UNKNOWN, gdcm::DocEntry::GetElement(), gdcm::DocEntry::GetGroup(), gdcm::DocEntry::GetName(), gdcm::DocEntry::GetOffset(), gdcm::DocEntry::GetReadLength(), gdcm::DocEntry::GetVR(), and gdcm::TSKey. Referenced by gdcm::SQItem::Print(), gdcm::SeqEntry::Print(), and gdcm::ElementSet::Print().
00215 { 00216 size_t o; 00217 std::string st; 00218 TSKey v; 00219 std::string d2, vr; 00220 std::ostringstream s; 00221 uint32_t lgth; 00222 00223 o = GetOffset(); 00224 vr = GetVR(); 00225 if(vr==GDCM_UNKNOWN) 00226 vr=" "; 00227 00228 s << DictEntry::TranslateToKey(GetGroup(),GetElement()); 00229 00230 if (PrintLevel >= 2) 00231 { 00232 s << " lg : "; 00233 lgth = GetReadLength(); // ReadLength, as opposed to Length 00234 if (lgth == 0xffffffff) 00235 { 00236 st = Util::Format("x(ffff)"); // I said : "x(ffff)" ! 00237 s.setf(std::ios::left); 00238 s << std::setw(10-st.size()) << " "; 00239 s << st << " "; 00240 s.setf(std::ios::left); 00241 s << std::setw(8) << "-1"; 00242 } 00243 else 00244 { 00245 st = Util::Format("x(%x)",lgth); 00246 s.setf(std::ios::left); 00247 s << std::setw(10-st.size()) << " "; 00248 s << st << " "; 00249 s.setf(std::ios::left); 00250 s << std::setw(8) << lgth; 00251 } 00252 s << " Off.: "; 00253 st = Util::Format("x(%x)",o); 00254 s << std::setw(10-st.size()) << " "; 00255 s << st << " "; 00256 s << std::setw(8) << o; 00257 } 00258 00259 s << "[" << vr << "] "; 00260 00261 if (PrintLevel >= 1) 00262 { 00263 s.setf(std::ios::left); 00264 s << std::setw(66-GetName().length()) << " "; 00265 } 00266 00267 s << "[" << GetName()<< "]"; 00268 os << s.str(); 00269 } |
|
Sets to TRUE the ImplicitVr flag of the current Dicom entry.
Definition at line 113 of file gdcmDocEntry.h. References gdcm::ImplicitVR. Referenced by gdcm::Document::ReadNextDocEntry().
00113 { ImplicitVR = true; }; |
|
Set the 'key' of the current Dicom entry.
Definition at line 61 of file gdcmDocEntry.h. References gdcm::TagKey. Referenced by gdcm::DocEntry::DocEntry(), and gdcm::Document::ParseDES().
00061 { Key = key; } |
|
Sets both 'Read Length' and 'Usable Length' of the current Dicom entry.
Definition at line 98 of file gdcmDocEntry.h. Referenced by gdcm::Document::FixDocEntryFoundLength(), gdcm::DocEntrySet::SetBinEntry(), gdcm::ValEntry::SetValue(), gdcm::FileHelper::SetWriteToRaw(), and gdcm::FileHelper::SetWriteToRGB().
00098 { Length = l; }; |
|
Sets the offset of the Dicom entry.
Definition at line 110 of file gdcmDocEntry.h. Referenced by gdcm::DicomDirObject::FillObject(), gdcm::Document::ReadNextDocEntry(), and gdcm::DicomDir::SetElement().
00110 { Offset = of; }; |
|
Sets the print level for the Dicom Header Elements.
Definition at line 45 of file gdcmBase.h. Referenced by gdcm::SQItem::Print(), gdcm::SeqEntry::Print(), gdcm::FileHelper::Print(), gdcm::ElementSet::Print(), and gdcm::DicomDir::Print().
00045 { PrintLevel = level; }; |
|
Sets only 'Read Length' (*not* 'Usable Length') of the current Dicom entry.
Definition at line 89 of file gdcmDocEntry.h. Referenced by gdcm::Document::FixDocEntryFoundLength().
00089 { ReadLength = l; }; |
|
Sets the value (string) of the current Dicom entry.
Reimplemented in gdcm::ValEntry. Definition at line 43 of file gdcmContentEntry.h. Referenced by gdcm::Document::LoadDocEntry(), gdcm::DocEntrySet::SetBinEntry(), gdcm::FileHelper::SetWriteToRaw(), and gdcm::FileHelper::SetWriteToRGB().
00043 { Value = val; }; |
|
Sets the 'Value Multiplicity' of the current Dicom entry.
Definition at line 80 of file gdcmDocEntry.h. References gdcm::TagName.
00080 { DicomDict->SetVM(v); }; |
|
Writes the common part of any ValEntry, BinEntry, SeqEntry.
Reimplemented from gdcm::DocEntry. Implemented in gdcm::BinEntry, and gdcm::ValEntry. |
|
pointer to the underlying Dicom dictionary element
Definition at line 134 of file gdcmDocEntry.h. Referenced by gdcm::DocEntry::DocEntry(). |
|
Even when reading explicit vr files, some elements happen to be implicit. Flag them here since we can't use the entry->vr without breaking the underlying dictionary.
Definition at line 146 of file gdcmDocEntry.h. Referenced by gdcm::DocEntry::Copy(), gdcm::DocEntry::DocEntry(), and gdcm::SeqEntry::SeqEntry(). |
|
Generalized key of this DocEntry (for details on the generalized key refer to TagKey documentation).
Definition at line 153 of file gdcmDocEntry.h. |
|
Correspond to the real length of the data This length might always be even.
Definition at line 138 of file gdcmDocEntry.h. Referenced by gdcm::DocEntry::Copy(), and gdcm::DocEntry::DocEntry(). |
|
Offset from the beginning of file for direct user access.
Definition at line 149 of file gdcmDocEntry.h. Referenced by gdcm::DocEntry::Copy(), and gdcm::DocEntry::DocEntry(). |
|
Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.
Definition at line 53 of file gdcmBase.h. Referenced by gdcm::Base::Base(). |
|
Length to read in the file to obtain data.
Definition at line 141 of file gdcmDocEntry.h. Referenced by gdcm::DocEntry::Copy(), and gdcm::DocEntry::DocEntry(). |
|
Dicom entry value, internaly represented as a std::string. The Value Representation (VR) is independently used in order to interpret (decode) this field.
Definition at line 62 of file gdcmContentEntry.h. Referenced by Copy(). |