gdcm::DataSet Class Reference

Class to represent a Data Set (which contains Data Elements). More...

`#include <gdcmDataSet.h>`

Inheritance diagram for gdcm::DataSet:
[legend]

## Public Types

typedef DataElementSet::const_iterator | ConstIterator
typedef std::set< DataElement > | DataElementSet
typedef DataElementSet::iterator | Iterator
typedef DataElementSet::size_type | SizeType

## Public Member Functions

Iterator | Begin ()
ConstIterator | Begin () const
void | Clear ()
template<typename TDE>
unsigned int | ComputeGroupLength (Tag const &tag) const
Iterator | End ()
ConstIterator | End () const
bool | FindDataElement (const PrivateTag &t) const
| Look up if private tag 't' is present in the dataset:
bool | FindDataElement (const Tag &t) const
const DataElement & | FindNextDataElement (const Tag &t) const
const DataElement & | GetDataElement (const PrivateTag &t) const
| Return the dataelement.
const DataElement & | GetDataElement (const Tag &t) const
DataElementSet & | GetDES ()
const DataElementSet & | GetDES () const
template<typename TDE>
VL | GetLength () const
MediaStorage | GetMediaStorage () const
std::string | GetPrivateCreator (const Tag &t) const
PrivateTag | GetPrivateTag (const Tag &t) const
| Return the private tag of the private tag 't', private creator will be set to empty if not found.
void | Insert (const DataElement &de)
bool | IsEmpty () const
| Returns if the dataset is empty.
const DataElement & | operator() (uint16_t group, uint16_t element) const
DataSet & | operator= (DataSet const &)=default
const DataElement & | operator[] (const Tag &t) const
void | Print (std::ostream &os, std::string const &indent="") const
template<typename TDE, typename TSwap>
std::istream & | Read (std::istream &is)
template<typename TDE, typename TSwap>
std::istream & | ReadNested (std::istream &is)
template<typename TDE, typename TSwap>
std::istream & | ReadSelectedPrivateTags (std::istream &is, const std::set< PrivateTag > &tags, bool readvalues=true)
template<typename TDE, typename TSwap>
std::istream & | ReadSelectedPrivateTagsWithLength (std::istream &is, const std::set< PrivateTag > &tags, VL &length, bool readvalues=true)
template<typename TDE, typename TSwap>
std::istream & | ReadSelectedTags (std::istream &is, const std::set< Tag > &tags, bool readvalues=true)
template<typename TDE, typename TSwap>
std::istream & | ReadSelectedTagsWithLength (std::istream &is, const std::set< Tag > &tags, VL &length, bool readvalues=true)
template<typename TDE, typename TSwap>
std::istream & | ReadUpToTag (std::istream &is, const Tag &t, std::set< Tag > const &skiptags)
template<typename TDE, typename TSwap>
std::istream & | ReadUpToTagWithLength (std::istream &is, const Tag &t, std::set< Tag > const &skiptags, VL &length)
template<typename TDE, typename TSwap>
std::istream & | ReadWithLength (std::istream &is, VL &length)
SizeType | Remove (const Tag &tag)
| Completely remove a dataelement from the dataset.
void | Replace (const DataElement &de)
| Replace a dataelement with another one.
void | ReplaceEmpty (const DataElement &de)
| Only replace a DICOM attribute when it is missing or empty.
SizeType | Size () const
template<typename TDE, typename TSwap>
std::ostream const & | Write (std::ostream &os) const

## Protected Member Functions

Tag | ComputeDataElement (const PrivateTag &t) const
const DataElement & | GetDEEnd () const
void | InsertDataElement (const DataElement &de)

## Friends

class | CSAHeader
std::ostream & | operator<< (std::ostream &_os, const DataSet &val)

## Detailed Description

Class to represent a Data Set (which contains Data Elements).

A Data Set represents an instance of a real world Information Object

Note
  DATA SET: Exchanged information consisting of a structured set of Attribute values directly or indirectly related to Information Objects. The value of each Attribute in a Data Set is expressed as a Data Element. A collection of Data Elements ordered by increasing Data Element Tag number that is an encoding of the values of Attributes of a real world object.
  Implementation note. If one do: DataSet ds; ds.SetLength(0); ds.Read(is); setting length to 0 actually means try to read is as if it was a root DataSet. Other value are undefined (nested dataset with undefined length) or defined length (different from 0) means nested dataset with defined length.

Warning
  a DataSet does not have a Transfer Syntax type, only a File does.

Examples
  ChangePrivateTags.cxx, ChangeSequenceUltrasound.cxx, CompressLossyJPEG.cs, CreateFakeRTDOSE.cxx, CreateJPIPDataSet.cxx, DeriveSeries.cxx, 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, Extracting_All_Resolution.cxx, Fake_Image_Using_Stream_Image_Writer.cxx, FileChangeTS.cs, FileChangeTSLossy.cs, FixOrientation.cxx, GenAllVR.cxx, GenFakeIdentifyFile.cxx, GenLongSeqs.cxx, GenSeqs.cxx, GetJPEGSamplePrecision.cxx, GetSequenceUltrasound.cxx, GetSubSequenceData.cxx, HelloWorld.cxx, LargeVRDSExplicit.cxx, MergeTwoFiles.cxx, MrProtocol.cxx, NewSequence.cs, PatchFile.cxx, ReadAndDumpDICOMDIR.cxx, ReadAndPrintAttributes.cxx, ReadExplicitLengthSQIVR.cxx, ReadGEMSSDO.cxx, SimplePrint.cs, SortImage.cxx, SortImage2.cs, StreamImageReaderTest.cxx, TemplateEmptyImage.cxx, VolumeSorter.cxx, csa2img.cxx, gdcmrtionplan.cxx, gdcmrtplan.cxx, iU22tomultisc.cxx, pmsct_rgb1.cxx, and rle2img.cxx.

## Member Typedef Documentation

## ConstIterator

typedef DataElementSet::const_iterator gdcm::DataSet::ConstIterator

Examples
  DiffFile.cxx, DumpGEMSMovieGroup.cxx, DumpVisusChange.cxx, and DuplicatePCDE.cxx.

## DataElementSet

typedef std::set<DataElement> gdcm::DataSet::DataElementSet

## Iterator

typedef DataElementSet::iterator gdcm::DataSet::Iterator

## SizeType

typedef DataElementSet::size_type gdcm::DataSet::SizeType

## Member Function Documentation

## Begin() [1/2]

Iterator gdcm::DataSet::Begin | ( |  | ) |

inline

## Begin() [2/2]

ConstIterator gdcm::DataSet::Begin | ( |  | ) | const

inline

Examples
  DiffFile.cxx, DumpGEMSMovieGroup.cxx, DumpVisusChange.cxx, and DuplicatePCDE.cxx.

## Clear()

void gdcm::DataSet::Clear | ( |  | ) |

inline

Referenced by gdcm::Item::Read().

## ComputeDataElement()

Tag gdcm::DataSet::ComputeDataElement | ( | const PrivateTag & | t | ) | const

protected

References operator<<.

## ComputeGroupLength()

template<typename TDE>

unsigned int gdcm::DataSet::ComputeGroupLength | ( | Tag const & | tag | ) | const

inline

References gdcm::Tag::GetElement(), and gdcm::Tag::GetGroup().

## End() [1/2]

Iterator gdcm::DataSet::End | ( |  | ) |

inline

## End() [2/2]

ConstIterator gdcm::DataSet::End | ( |  | ) | const

inline

Examples
  DiffFile.cxx, DumpGEMSMovieGroup.cxx, DumpVisusChange.cxx, and DuplicatePCDE.cxx.

## FindDataElement() [1/2]

bool gdcm::DataSet::FindDataElement | ( | const PrivateTag & | t | ) | const

Look up if private tag 't' is present in the dataset:

Examples
  ChangePrivateTags.cxx, ChangeSequenceUltrasound.cxx, DumpADAC.cxx, DumpCSA.cs, DumpExamCard.cxx, DumpGEMSMovieGroup.cxx, DumpImageHeaderInfo.cxx, DumpPhilipsECHO.cxx, DumpSiemensBase64.cxx, DumpToshibaDTI.cxx, DumpToshibaDTI2.cxx, DumpVisusChange.cxx, ELSCINT1WaveToText.cxx, ExtractEncapsulatedFile.cs, ExtractEncryptedContent.cxx, GetSequenceUltrasound.cxx, GetSubSequenceData.cxx, LargeVRDSExplicit.cxx, MrProtocol.cxx, ReadAndDumpDICOMDIR.cxx, ReadAndPrintAttributes.cxx, ReadGEMSSDO.cxx, csa2img.cxx, gdcmrtionplan.cxx, gdcmrtplan.cxx, pmsct_rgb1.cxx, and rle2img.cxx.

Referenced by gdcm::Attribute< Group, Element, TVR, TVM >::SetFromDataSet(), gdcm::Attribute< Group, Element, TVR, VM::VM1 >::SetFromDataSet(), and gdcm::Attribute< Group, Element, TVR, VM::VM1_n >::SetFromDataSet().

## FindDataElement() [2/2]

bool gdcm::DataSet::FindDataElement | ( | const Tag & | t | ) | const

inline

References GetDataElement(), and GetDEEnd().

## FindNextDataElement()

const DataElement & gdcm::DataSet::FindNextDataElement | ( | const Tag & | t | ) | const

inline

Examples
  DuplicatePCDE.cxx.

References GetDEEnd().

## GetDataElement() [1/2]

const DataElement & gdcm::DataSet::GetDataElement | ( | const PrivateTag & | t | ) | const

Return the dataelement.

## GetDataElement() [2/2]

const DataElement & gdcm::DataSet::GetDataElement | ( | const Tag & | t | ) | const

inline

Return the DataElement with Tag 't'

Warning
  : This only search at the 'root level' of the DataSet

Examples
  ChangePrivateTags.cxx, ChangeSequenceUltrasound.cxx, DecompressImage.cs, DeriveSeries.cxx, DumpADAC.cxx, DumpCSA.cs, DumpExamCard.cxx, DumpGEMSMovieGroup.cxx, DumpImageHeaderInfo.cxx, DumpPhilipsECHO.cxx, DumpSiemensBase64.cxx, DumpToshibaDTI.cxx, DumpToshibaDTI2.cxx, DumpVisusChange.cxx, ELSCINT1WaveToText.cxx, ExtractEncapsulatedFile.cs, ExtractEncryptedContent.cxx, FixBrokenJ2K.cxx, FixJAIBugJPEGLS.cxx, GetJPEGSamplePrecision.cxx, GetSequenceUltrasound.cxx, GetSubSequenceData.cxx, LargeVRDSExplicit.cxx, MrProtocol.cxx, PatchFile.cxx, ReadAndDumpDICOMDIR.cxx, ReadExplicitLengthSQIVR.cxx, ReadGEMSSDO.cxx, csa2img.cxx, gdcmrtionplan.cxx, gdcmrtplan.cxx, iU22tomultisc.cxx, pmsct_rgb1.cxx, and rle2img.cxx.

References GetDEEnd().

Referenced by FindDataElement(), operator()(), operator[](), gdcm::Attribute< Group, Element, TVR, TVM >::Set(), gdcm::Attribute< Group, Element, TVR, VM::VM1 >::Set(), gdcm::Attribute< Group, Element, TVR, VM::VM1_n >::Set(), gdcm::Attribute< Group, Element, TVR, TVM >::SetFromDataSet(), gdcm::Attribute< Group, Element, TVR, VM::VM1 >::SetFromDataSet(), and gdcm::Attribute< Group, Element, TVR, VM::VM1_n >::SetFromDataSet().

## GetDEEnd()

const DataElement & gdcm::DataSet::GetDEEnd | ( |  | ) | const

protected

Referenced by FindDataElement(), FindNextDataElement(), and GetDataElement().

## GetDES() [1/2]

DataElementSet & gdcm::DataSet::GetDES | ( |  | ) |

inline

## GetDES() [2/2]

const DataElementSet & gdcm::DataSet::GetDES | ( |  | ) | const

inline

Examples
  ReadAndDumpDICOMDIR.cxx.

## GetLength()

template<typename TDE>

VL gdcm::DataSet::GetLength | ( |  | ) | const

inline

Referenced by gdcm::FileMetaInformation::GetFullLength().

## GetMediaStorage()

MediaStorage gdcm::DataSet::GetMediaStorage | ( |  | ) | const

## GetPrivateCreator()

std::string gdcm::DataSet::GetPrivateCreator | ( | const Tag & | t | ) | const

Return the private creator of the private tag 't': or an empty string when not found

Examples
  DuplicatePCDE.cxx.

## GetPrivateTag()

PrivateTag gdcm::DataSet::GetPrivateTag | ( | const Tag & | t | ) | const

Return the private tag of the private tag 't', private creator will be set to empty if not found.

## Insert()

void gdcm::DataSet::Insert | ( | const DataElement & | de | ) |

inline

Insert a DataElement in the DataSet.

Warning
  : Tag need to be >= 0x8 to be considered valid data element

Examples
  CreateJPIPDataSet.cxx, DumpSiemensBase64.cxx, DuplicatePCDE.cxx, Extracting_All_Resolution.cxx, Fake_Image_Using_Stream_Image_Writer.cxx, FileChangeTS.cs, FileChangeTSLossy.cs, GenAllVR.cxx, GenFakeIdentifyFile.cxx, GenLongSeqs.cxx, GenSeqs.cxx, NewSequence.cs, StreamImageReaderTest.cxx, and TemplateEmptyImage.cxx.

References gdcmErrorMacro, gdcm::Tag::GetGroup(), gdcm::DataElement::GetTag(), and InsertDataElement().

## InsertDataElement()

void gdcm::DataSet::InsertDataElement | ( | const DataElement & | de | ) |

inline protected

References gdcmWarningMacro, gdcm::Value::GetLength(), gdcm::DataElement::GetValue(), gdcm::DataElement::GetVL(), and gdcm::DataElement::IsEmpty().

Referenced by gdcm::CommandDataSet::Insert(), Insert(), and gdcm::FileMetaInformation::Insert().

## IsEmpty()

bool gdcm::DataSet::IsEmpty | ( |  | ) | const

inline

Returns if the dataset is empty.

Referenced by gdcm::Item::Read().

## operator()()

const DataElement & gdcm::DataSet::operator() | ( | uint16_t | group,
|  | uint16_t | element ) const

inline

References GetDataElement().

## operator=()

DataSet & gdcm::DataSet::operator= | ( | DataSet const & |  | ) |

default

## operator[]()

const DataElement & gdcm::DataSet::operator[] | ( | const Tag & | t | ) | const

inline

References GetDataElement().

## Print()

void gdcm::DataSet::Print | ( | std::ostream & | os,
|  | std::string const & | indent = "" ) const

inline

Referenced by gdcm::CommandDataSet::operator<<, operator<<, gdcm::FileMetaInformation::operator<<, and gdcm::Item::operator<<.

## Read()

template<typename TDE, typename TSwap>

std::istream & gdcm::DataSet::Read | ( | std::istream & | is | ) |

Examples
  DumpToshibaDTI.cxx, and DumpToshibaDTI2.cxx.

## ReadNested()

template<typename TDE, typename TSwap>

std::istream & gdcm::DataSet::ReadNested | ( | std::istream & | is | ) |

## ReadSelectedPrivateTags()

template<typename TDE, typename TSwap>

std::istream & gdcm::DataSet::ReadSelectedPrivateTags | ( | std::istream & | is,
|  | const std::set< PrivateTag > & | tags,
|  | bool | readvalues = true )

## ReadSelectedPrivateTagsWithLength()

template<typename TDE, typename TSwap>

std::istream & gdcm::DataSet::ReadSelectedPrivateTagsWithLength | ( | std::istream & | is,
|  | const std::set< PrivateTag > & | tags,
|  | VL & | length,
|  | bool | readvalues = true )

## ReadSelectedTags()

template<typename TDE, typename TSwap>

std::istream & gdcm::DataSet::ReadSelectedTags | ( | std::istream & | is,
|  | const std::set< Tag > & | tags,
|  | bool | readvalues = true )

## ReadSelectedTagsWithLength()

template<typename TDE, typename TSwap>

std::istream & gdcm::DataSet::ReadSelectedTagsWithLength | ( | std::istream & | is,
|  | const std::set< Tag > & | tags,
|  | VL & | length,
|  | bool | readvalues = true )

## ReadUpToTag()

template<typename TDE, typename TSwap>

std::istream & gdcm::DataSet::ReadUpToTag | ( | std::istream & | is,
|  | const Tag & | t,
|  | std::set< Tag > const & | skiptags )

## ReadUpToTagWithLength()

template<typename TDE, typename TSwap>

std::istream & gdcm::DataSet::ReadUpToTagWithLength | ( | std::istream & | is,
|  | const Tag & | t,
|  | std::set< Tag > const & | skiptags,
|  | VL & | length )

## ReadWithLength()

template<typename TDE, typename TSwap>

std::istream & gdcm::DataSet::ReadWithLength | ( | std::istream & | is,
|  | VL & | length )

## Remove()

SizeType gdcm::DataSet::Remove | ( | const Tag & | tag | ) |

inline

Completely remove a dataelement from the dataset.

Examples
  ClinicalTrialIdentificationWorkflow.cs, GenFakeIdentifyFile.cxx, LargeVRDSExplicit.cxx, MergeTwoFiles.cxx, ReformatFile.cs, StandardizeFiles.cs, pmsct_rgb1.cxx, and rle2img.cxx.

Referenced by gdcm::CommandDataSet::Replace(), and gdcm::FileMetaInformation::Replace().

## Replace()

void gdcm::DataSet::Replace | ( | const DataElement & | de | ) |

inline

Replace a dataelement with another one.

Examples
  ChangePrivateTags.cxx, ChangeSequenceUltrasound.cxx, CreateFakeRTDOSE.cxx, DeriveSeries.cxx, FixBrokenJ2K.cxx, FixJAIBugJPEGLS.cxx, FixOrientation.cxx, GenFakeIdentifyFile.cxx, GetSubSequenceData.cxx, HelloWorld.cxx, LargeVRDSExplicit.cxx, PatchFile.cxx, iU22tomultisc.cxx, pmsct_rgb1.cxx, and rle2img.cxx.

References gdcmAssertAlwaysMacro.

## ReplaceEmpty()

void gdcm::DataSet::ReplaceEmpty | ( | const DataElement & | de | ) |

inline

Only replace a DICOM attribute when it is missing or empty.

Examples
  rle2img.cxx.

References gdcmAssertAlwaysMacro.

## Size()

SizeType gdcm::DataSet::Size | ( |  | ) | const

inline

Examples
  DumpGEMSMovieGroup.cxx.

Referenced by gdcm::SequenceOfItems::Read().

## Write()

template<typename TDE, typename TSwap>

std::ostream const & gdcm::DataSet::Write | ( | std::ostream & | os | ) | const

## Friends And Related Symbol Documentation

## CSAHeader

friend class CSAHeader

friend

References CSAHeader.

Referenced by CSAHeader.

## operator<<

std::ostream & operator<< | ( | std::ostream & | _os,
|  | const DataSet & | val )

friend

References operator<<, and Print().

Referenced by ComputeDataElement(), and operator<<.

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

- gdcmDataSet.h