14 #ifndef GDCMDATAELEMENT_H
15 #define GDCMDATAELEMENT_H
36 class SequenceOfItems;
37 class SequenceOfFragments;
74 const VL&
GetVL()
const {
return ValueLengthField; }
79 void SetVL(
const VL &vl) { ValueLengthField = vl; }
80 void SetVLToUndefined();
84 VR const &
GetVR()
const {
return VRField; }
103 bool IsEmpty()
const {
return ValueField == 0 || (GetByteValue() && GetByteValue()->IsEmpty()); }
106 void Empty() { ValueField = 0; ValueLengthField = 0; }
114 ValueLengthField = 0;
161 bool IsUndefinedLength()
const {
162 return ValueLengthField.IsUndefined();
175 return GetTag() < de.
GetTag();
214 template <
typename TDE>
216 return static_cast<const TDE*
>(
this)->GetLength();
219 template <
typename TDE,
typename TSwap>
220 std::istream &
Read(std::istream &is) {
221 return static_cast<TDE*
>(
this)->
template Read<TSwap>(is);
224 template <
typename TDE,
typename TSwap>
225 std::istream &
ReadOrSkip(std::istream &is, std::set<Tag>
const &skiptags) {
227 return static_cast<TDE*
>(
this)->
template Read<TSwap>(is);
230 template <
typename TDE,
typename TSwap>
231 std::istream &
ReadPreValue(std::istream &is, std::set<Tag>
const &skiptags) {
233 return static_cast<TDE*
>(
this)->
template ReadPreValue<TSwap>(is);
235 template <
typename TDE,
typename TSwap>
236 std::istream &
ReadValue(std::istream &is, std::set<Tag>
const &skiptags) {
238 return static_cast<TDE*
>(
this)->
template ReadValue<TSwap>(is);
240 template <
typename TDE,
typename TSwap>
243 return static_cast<TDE*
>(
this)->
template ReadValueWithLength<TSwap>(is, length);
246 template <
typename TDE,
typename TSwap>
248 return static_cast<TDE*
>(
this)->
template ReadWithLength<TSwap>(is,length);
251 template <
typename TDE,
typename TSwap>
252 const std::ostream &
Write(std::ostream &os)
const {
253 return static_cast<const TDE*
>(
this)->
template Write<TSwap>(os);
266 void SetValueFieldLength(
VL vl,
bool readvalues );
283 return ! ( lhs == rhs );
288 #endif //GDCMDATAELEMENT_H
void SetVR(VR const &vr)
Definition: gdcmDataElement.h:88
void SetValue(Value const &vl)
Definition: gdcmDataElement.h:97
bool IsEmpty() const
Check if Data Element is empty.
Definition: gdcmDataElement.h:103
void SetTag(const Tag &t)
Definition: gdcmDataElement.h:71
std::istream & ReadWithLength(std::istream &is, VL &length)
Definition: gdcmDataElement.h:247
Class to represent a Sequence Of Items (value representation : SQ)
Definition: gdcmSequenceOfItems.h:39
void SetByteValue(const char *array, VL length)
Definition: gdcmDataElement.h:123
std::istream & ReadValue(std::istream &is, std::set< Tag > const &skiptags)
Definition: gdcmDataElement.h:236
DataElement(const DataElement &_val)
Definition: gdcmDataElement.h:165
Class to represent the value of a Data Element.
Definition: gdcmValue.h:29
const VL & GetVL() const
Get VL.
Definition: gdcmDataElement.h:74
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
bool operator!=(const CodeString &ref, const CodeString &cs)
Definition: gdcmCodeString.h:97
DataElement(const Tag &t=Tag(0), const VL &vl=0, const VR &vr=VR::INVALID)
Definition: gdcmDataElement.h:61
Value Length.
Definition: gdcmVL.h:29
Class to represent a Sequence Of Fragments.
Definition: gdcmSequenceOfFragments.h:31
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:92
VL ValueLengthField
Definition: gdcmDataElement.h:259
bool operator<(const DataElement &de) const
Definition: gdcmDataElement.h:173
const ByteValue * GetByteValue() const
Definition: gdcmDataElement.h:130
void SetVL(const VL &vl)
Definition: gdcmDataElement.h:79
VR VRField
Definition: gdcmDataElement.h:262
DataElement & operator=(const DataElement &de)
Definition: gdcmDataElement.h:177
const std::ostream & Write(std::ostream &os) const
Definition: gdcmDataElement.h:252
Class to represent a Data Element either Implicit or Explicit.
Definition: gdcmDataElement.h:58
Class to represent binary value (array of bytes)
Definition: gdcmByteValue.h:33
Value & GetValue()
Definition: gdcmDataElement.h:95
bool operator==(const DataElement &de) const
Definition: gdcmDataElement.h:186
std::istream & ReadPreValue(std::istream &is, std::set< Tag > const &skiptags)
Definition: gdcmDataElement.h:231
VR const & GetVR() const
Definition: gdcmDataElement.h:84
std::istream & Read(std::istream &is)
Definition: gdcmDataElement.h:220
Value const & GetValue() const
Set/Get Value (bytes array, SQ of items, SQ of fragments):
Definition: gdcmDataElement.h:94
void Clear()
Clear Data Element (make Value empty and invalidate Tag & VR)
Definition: gdcmDataElement.h:109
Class for Smart Pointer.
Definition: gdcmObject.h:26
VL & GetVL()
Definition: gdcmDataElement.h:75
virtual VL GetLength() const =0
Tag & GetTag()
Definition: gdcmDataElement.h:68
#define GDCM_LEGACY(method)
Definition: gdcmLegacyMacro.h:44
const Tag & GetTag() const
Get Tag.
Definition: gdcmDataElement.h:67
ValuePtr ValueField
Definition: gdcmDataElement.h:264
std::istream & ReadOrSkip(std::istream &is, std::set< Tag > const &skiptags)
Definition: gdcmDataElement.h:225
virtual void Print(std::ostream &) const
Definition: gdcmObject.h:87
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element). Basically an uint32_t which...
Definition: gdcmTag.h:38
VL GetLength() const
Definition: gdcmDataElement.h:215
Tag TagField
Definition: gdcmDataElement.h:257
VR class This is adapted from DICOM standard The biggest difference is the INVALID VR and the composi...
Definition: gdcmVR.h:54
void Empty()
Make Data Element empty (no Value)
Definition: gdcmDataElement.h:106
std::istream & ReadValueWithLength(std::istream &is, VL &length, std::set< Tag > const &skiptags)
Definition: gdcmDataElement.h:241
SmartPointer< Value > ValuePtr
Definition: gdcmDataElement.h:263