GDCM 3.0.24
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
gdcm::DataElement Class Reference

Class to represent a Data Element either Implicit or Explicit. More...

#include <gdcmDataElement.h>

Inheritance diagram for gdcm::DataElement:
[legend]
Collaboration diagram for gdcm::DataElement:
[legend]

Public Member Functions

 DataElement (const DataElement &_val)
 
 DataElement (const Tag &t=Tag(0), const VL &vl=0, const VR &vr=VR::INVALID)
 
void Clear ()
 Clear Data Element (make Value empty and invalidate Tag & VR)
 
void Empty ()
 Make Data Element empty (no Value)
 
const ByteValueGetByteValue () const
 
template<typename TDE >
VL GetLength () const
 
SequenceOfFragmentsGetSequenceOfFragments ()
 
const SequenceOfFragmentsGetSequenceOfFragments () const
 
TagGetTag ()
 
const TagGetTag () const
 Get Tag.
 
ValueGetValue ()
 
Value const & GetValue () const
 Set/Get Value (bytes array, SQ of items, SQ of fragments):
 
SmartPointer< SequenceOfItemsGetValueAsSQ () const
 
VLGetVL ()
 
const VLGetVL () const
 Get VL.
 
VR const & GetVR () const
 
bool IsEmpty () const
 Check if Data Element is empty.
 
bool IsUndefinedLength () const
 return if Value Length if of undefined length
 
bool operator< (const DataElement &de) const
 
DataElementoperator= (const DataElement &)=default
 
bool operator== (const DataElement &de) const
 
template<typename TDE , typename TSwap >
std::istream & Read (std::istream &is)
 
template<typename TDE , typename TSwap >
std::istream & ReadOrSkip (std::istream &is, std::set< Tag > const &skiptags)
 
template<typename TDE , typename TSwap >
std::istream & ReadPreValue (std::istream &is, std::set< Tag > const &skiptags)
 
template<typename TDE , typename TSwap >
std::istream & ReadValue (std::istream &is, std::set< Tag > const &skiptags)
 
template<typename TDE , typename TSwap >
std::istream & ReadValueWithLength (std::istream &is, VL &length, std::set< Tag > const &skiptags)
 
template<typename TDE , typename TSwap >
std::istream & ReadWithLength (std::istream &is, VL &length)
 
void SetByteValue (const char *array, VL length)
 
void SetTag (const Tag &t)
 
void SetValue (Value const &vl)
 
void SetVL (const VL &vl)
 
void SetVLToUndefined ()
 
void SetVR (VR const &vr)
 
template<typename TDE , typename TSwap >
const std::ostream & Write (std::ostream &os) const
 

Protected Types

typedef SmartPointer< ValueValuePtr
 

Protected Member Functions

void SetValueFieldLength (VL vl, bool readvalues)
 

Protected Attributes

Tag TagField
 
ValuePtr ValueField
 
VL ValueLengthField
 
VR VRField
 

Friends

std::ostream & operator<< (std::ostream &_os, const DataElement &_val)
 

Detailed Description

Class to represent a Data Element either Implicit or Explicit.

DATA ELEMENT: A unit of information as defined by a single entry in the data dictionary. An encoded Information Object Definition (IOD) Attribute that is composed of, at a minimum, three fields: a Data Element Tag, a Value Length, and a Value Field. For some specific Transfer Syntaxes, a Data Element also contains a VR Field where the Value Representation of that Data Element is specified explicitly.

Design:

See also
ExplicitDataElement ImplicitDataElement
Examples
BasicImageAnonymizer.cs, ChangePrivateTags.cxx, ChangeSequenceUltrasound.cxx, CreateARGBImage.cxx, CreateCMYKImage.cxx, DecompressImage.cs, DecompressImageMultiframe.cs, DecompressJPEGFile.cs, DiffFile.cxx, DumpADAC.cxx, DumpCSA.cs, DumpExamCard.cxx, DumpGEMSMovieGroup.cxx, DumpImageHeaderInfo.cxx, DumpPhilipsECHO.cxx, DumpSiemensBase64.cxx, DumpToshibaDTI.cxx, DumpToshibaDTI2.cxx, DumpVisusChange.cxx, DuplicatePCDE.cxx, ELSCINT1WaveToText.cxx, ExtractEncapsulatedFile.cs, ExtractEncryptedContent.cxx, ExtractIconFromFile.cxx, Extracting_All_Resolution.cxx, Fake_Image_Using_Stream_Image_Writer.cxx, FileChangeTS.cs, FileChangeTSLossy.cs, FixBrokenJ2K.cxx, FixJAIBugJPEGLS.cxx, GenAllVR.cxx, GenFakeIdentifyFile.cxx, GenFakeImage.cxx, GenLongSeqs.cxx, GenSeqs.cxx, GetJPEGSamplePrecision.cxx, GetSequenceUltrasound.cxx, GetSubSequenceData.cxx, LargeVRDSExplicit.cxx, MpegVideoInfo.cs, NewSequence.cs, ReadAndDumpDICOMDIR.cxx, ReadExplicitLengthSQIVR.cxx, ReadGEMSSDO.cxx, SimplePrint.cs, StreamImageReaderTest.cxx, csa2img.cxx, gdcmrtionplan.cxx, gdcmrtplan.cxx, iU22tomultisc.cxx, pmsct_rgb1.cxx, and rle2img.cxx.

Member Typedef Documentation

◆ ValuePtr

Constructor & Destructor Documentation

◆ DataElement() [1/2]

gdcm::DataElement::DataElement ( const Tag t = Tag(0),
const VL vl = 0,
const VR vr = VR::INVALID 
)
inline

◆ DataElement() [2/2]

gdcm::DataElement::DataElement ( const DataElement _val)
inline

Member Function Documentation

◆ Clear()

void gdcm::DataElement::Clear ( )
inline

Clear Data Element (make Value empty and invalidate Tag & VR)

◆ Empty()

void gdcm::DataElement::Empty ( )
inline

Make Data Element empty (no Value)

◆ GetByteValue()

const ByteValue * gdcm::DataElement::GetByteValue ( ) const
inline

◆ GetLength()

template<typename TDE >
VL gdcm::DataElement::GetLength ( ) const
inline

◆ GetSequenceOfFragments() [1/2]

SequenceOfFragments * gdcm::DataElement::GetSequenceOfFragments ( )

◆ GetSequenceOfFragments() [2/2]

const SequenceOfFragments * gdcm::DataElement::GetSequenceOfFragments ( ) const

Return the Value of DataElement as a Sequence Of Fragments (if possible)

Warning
: You need to check for NULL return value
Examples
DecompressImage.cs, FixBrokenJ2K.cxx, FixJAIBugJPEGLS.cxx, and GetJPEGSamplePrecision.cxx.

◆ GetTag() [1/2]

Tag & gdcm::DataElement::GetTag ( )
inline

◆ GetTag() [2/2]

const Tag & gdcm::DataElement::GetTag ( ) const
inline

◆ GetValue() [1/2]

Value & gdcm::DataElement::GetValue ( )
inline

References gdcmAssertAlwaysMacro.

◆ GetValue() [2/2]

Value const & gdcm::DataElement::GetValue ( ) const
inline

◆ GetValueAsSQ()

SmartPointer< SequenceOfItems > gdcm::DataElement::GetValueAsSQ ( ) const

Interpret the Value stored in the DataElement. This is more robust (but also more expensive) to call this function rather than the simplest form: GetSequenceOfItems() It also return NULL when the Value is NOT of type SequenceOfItems

Warning
in case GetSequenceOfItems() succeed the function return this value, otherwise it creates a new SequenceOfItems, you should handle that in your case, for instance: SmartPointer<SequenceOfItems> sqi = de.GetValueAsSQ();
Examples
ChangeSequenceUltrasound.cxx, DumpExamCard.cxx, DumpGEMSMovieGroup.cxx, DumpPhilipsECHO.cxx, DumpToshibaDTI.cxx, DumpToshibaDTI2.cxx, DumpVisusChange.cxx, ExtractEncryptedContent.cxx, GetSequenceUltrasound.cxx, GetSubSequenceData.cxx, LargeVRDSExplicit.cxx, ReadAndDumpDICOMDIR.cxx, SimplePrint.cs, gdcmrtionplan.cxx, and gdcmrtplan.cxx.

◆ GetVL() [1/2]

VL & gdcm::DataElement::GetVL ( )
inline

◆ GetVL() [2/2]

const VL & gdcm::DataElement::GetVL ( ) const
inline

◆ GetVR()

VR const & gdcm::DataElement::GetVR ( ) const
inline

◆ IsEmpty()

bool gdcm::DataElement::IsEmpty ( ) const
inline

◆ IsUndefinedLength()

bool gdcm::DataElement::IsUndefinedLength ( ) const
inline

return if Value Length if of undefined length

◆ operator<()

bool gdcm::DataElement::operator< ( const DataElement de) const
inline

References GetTag().

◆ operator=()

DataElement & gdcm::DataElement::operator= ( const DataElement )
default

◆ operator==()

bool gdcm::DataElement::operator== ( const DataElement de) const
inline

◆ Read()

template<typename TDE , typename TSwap >
std::istream & gdcm::DataElement::Read ( std::istream &  is)
inline

◆ ReadOrSkip()

template<typename TDE , typename TSwap >
std::istream & gdcm::DataElement::ReadOrSkip ( std::istream &  is,
std::set< Tag > const &  skiptags 
)
inline

◆ ReadPreValue()

template<typename TDE , typename TSwap >
std::istream & gdcm::DataElement::ReadPreValue ( std::istream &  is,
std::set< Tag > const &  skiptags 
)
inline

◆ ReadValue()

template<typename TDE , typename TSwap >
std::istream & gdcm::DataElement::ReadValue ( std::istream &  is,
std::set< Tag > const &  skiptags 
)
inline

◆ ReadValueWithLength()

template<typename TDE , typename TSwap >
std::istream & gdcm::DataElement::ReadValueWithLength ( std::istream &  is,
VL length,
std::set< Tag > const &  skiptags 
)
inline

◆ ReadWithLength()

template<typename TDE , typename TSwap >
std::istream & gdcm::DataElement::ReadWithLength ( std::istream &  is,
VL length 
)
inline

◆ SetByteValue()

void gdcm::DataElement::SetByteValue ( const char *  array,
VL  length 
)
inline

◆ SetTag()

void gdcm::DataElement::SetTag ( const Tag t)
inline

◆ SetValue()

void gdcm::DataElement::SetValue ( Value const &  vl)
inline

◆ SetValueFieldLength()

void gdcm::DataElement::SetValueFieldLength ( VL  vl,
bool  readvalues 
)
protected

◆ SetVL()

void gdcm::DataElement::SetVL ( const VL vl)
inline

Set VL Use with cautious (need to match Part 6), advanced user only

See also
SetByteValue

◆ SetVLToUndefined()

void gdcm::DataElement::SetVLToUndefined ( )

◆ SetVR()

void gdcm::DataElement::SetVR ( VR const &  vr)
inline

◆ Write()

template<typename TDE , typename TSwap >
const std::ostream & gdcm::DataElement::Write ( std::ostream &  os) const
inline

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  _os,
const DataElement _val 
)
friend

Member Data Documentation

◆ TagField

Tag gdcm::DataElement::TagField
protected

Referenced by operator==().

◆ ValueField

ValuePtr gdcm::DataElement::ValueField
protected

Referenced by operator==().

◆ ValueLengthField

VL gdcm::DataElement::ValueLengthField
protected

Referenced by operator==().

◆ VRField

VR gdcm::DataElement::VRField
protected

Referenced by operator==().


The documentation for this class was generated from the following file: