gdcm::Attribute< Group, Element, TVR, TVM > Class Template Reference

Attribute class This class use template metaprograming tricks to let the user know when the template instantiation does not match the public dictionary. More...

`#include <gdcmAttribute.h>`

Inheritance diagram for gdcm::Attribute< Group, Element, TVR, TVM >:
[legend]
Collaboration diagram for gdcm::Attribute< Group, Element, TVR, TVM >:
[legend]

## Public Types

enum | { VMType = VMToLength<TVM>::Length }
typedef VRToType< TVR >::Type | ArrayType

## Public Member Functions

| GDCM_STATIC_ASSERT (((((VR::VRType) TVR &VR::VR_VM1) &&((VM::VMType) TVM==VM::VM1))||!((VR::VRType) TVR &VR::VR_VM1)))
| GDCM_STATIC_ASSERT (((VM::VMType) TVM &(VM::VMType)(TagToType< Group, Element >::VMType)))
| GDCM_STATIC_ASSERT (((VR::VRType) TVR &(VR::VRType)(TagToType< Group, Element >::VRType)))
DataElement | GetAsDataElement () const
unsigned int | GetNumberOfValues () const
ArrayType & | GetValue (unsigned int idx=0)
ArrayType const & | GetValue (unsigned int idx=0) const
const ArrayType * | GetValues () const
bool | operator!= (const Attribute &att) const
bool | operator< (const Attribute &att) const
bool | operator== (const Attribute &att) const
ArrayType & | operator[] (unsigned int idx)
ArrayType const & | operator[] (unsigned int idx) const
void | Print (std::ostream &os) const
void | Set (DataSet const &ds)
void | SetFromDataElement (DataElement const &de)
void | SetFromDataSet (DataSet const &ds)
void | SetValue (ArrayType v, unsigned int idx=0)
void | SetValues (const ArrayType *array, unsigned int numel=VMType)

## Static Public Member Functions

static VM | GetDictVM ()
static VR | GetDictVR ()
static Tag | GetTag ()
static VM | GetVM ()
static VR | GetVR ()

## Public Attributes

ArrayType | Internal [VMToLength< TVM >::Length]

## Protected Member Functions

void | SetByteValue (const ByteValue *bv)
void | SetByteValueNoSwap (const ByteValue *bv)

## Detailed Description

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>
class gdcm::Attribute< Group, Element, TVR, TVM >

Attribute class This class use template metaprograming tricks to let the user know when the template instantiation does not match the public dictionary.

Typical example that compile is: Attribute<0x0008,0x9007> a = {"ORIGINAL","PRIMARY","T1","NONE"};

Examples that will NOT compile are:

Attribute<0x0018,0x1182, VR::IS, VM::VM1> fd1 = {}; // not enough parameters Attribute<0x0018,0x1182, VR::IS, VM::VM2> fd2 = {0,1,2}; // too many initializers Attribute<0x0018,0x1182, VR::IS, VM::VM3> fd3 = {0,1,2}; // VM3 is not valid Attribute<0x0018,0x1182, VR::UL, VM::VM2> fd3 = {0,1}; // UL is not valid VR

Examples
  CreateFakeRTDOSE.cxx, CreateJPIPDataSet.cxx, DeriveSeries.cxx, Extracting_All_Resolution.cxx, Fake_Image_Using_Stream_Image_Writer.cxx, FixOrientation.cxx, GenFakeIdentifyFile.cxx, GetSequenceUltrasound.cxx, HelloWorld.cxx, LargeVRDSExplicit.cxx, PatchFile.cxx, ReadAndDumpDICOMDIR2.cxx, ReadAndPrintAttributes.cxx, SortImage.cxx, StreamImageReaderTest.cxx, VolumeSorter.cxx, gdcmrtionplan.cxx, gdcmrtplan.cxx, pmsct_rgb1.cxx, and rle2img.cxx.

## Member Typedef Documentation

## ArrayType

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

typedef VRToType<TVR>::Type gdcm::Attribute< Group, Element, TVR, TVM >::ArrayType

Examples
  ReadAndPrintAttributes.cxx.

## Member Enumeration Documentation

## anonymous enum

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

anonymous enum

Enumerator
VMType |

## Member Function Documentation

## GDCM_STATIC_ASSERT() [1/3]

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

gdcm::Attribute< Group, Element, TVR, TVM >::GDCM_STATIC_ASSERT | ( | ((((VR::VRType) TVR &VR::VR_VM1) &&((VM::VMType) TVM==VM::VM1))||!((VR::VRType) TVR &VR::VR_VM1)) |  | ) |

References gdcm::VM::VM1, and gdcm::VR::VR_VM1.

## GDCM_STATIC_ASSERT() [2/3]

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

gdcm::Attribute< Group, Element, TVR, TVM >::GDCM_STATIC_ASSERT | ( | ((VM::VMType) TVM &(VM::VMType)(TagToType< Group, Element >::VMType)) |  | ) |

## GDCM_STATIC_ASSERT() [3/3]

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

gdcm::Attribute< Group, Element, TVR, TVM >::GDCM_STATIC_ASSERT | ( | ((VR::VRType) TVR &(VR::VRType)(TagToType< Group, Element >::VRType)) |  | ) |

## GetAsDataElement()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

DataElement gdcm::Attribute< Group, Element, TVR, TVM >::GetAsDataElement | ( |  | ) | const

inline

Examples
  CreateFakeRTDOSE.cxx, CreateJPIPDataSet.cxx, Extracting_All_Resolution.cxx, Fake_Image_Using_Stream_Image_Writer.cxx, FixOrientation.cxx, GenFakeIdentifyFile.cxx, HelloWorld.cxx, LargeVRDSExplicit.cxx, PatchFile.cxx, and StreamImageReaderTest.cxx.

References GetNumberOfValues(), GetTag(), GetVR(), gdcm::DataElement::GetVR(), Internal, gdcm::DataElement::SetByteValue(), gdcm::DataElement::SetVR(), gdcm::VR::SQ, gdcm::VR::UI, and gdcm::VR::VRASCII.

## GetDictVM()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

VM gdcm::Attribute< Group, Element, TVR, TVM >::GetDictVM | ( |  | ) |

inline static

## GetDictVR()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

VR gdcm::Attribute< Group, Element, TVR, TVM >::GetDictVR | ( |  | ) |

inline static

## GetNumberOfValues()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

unsigned int gdcm::Attribute< Group, Element, TVR, TVM >::GetNumberOfValues | ( |  | ) | const

inline

Examples
  LargeVRDSExplicit.cxx.

Referenced by GetAsDataElement(), GetValue(), GetValue(), operator!=(), operator<(), gdcm::Attribute< Group, Element, TVR, VM::VM1 >::operator<(), operator==(), Print(), SetByteValue(), SetByteValueNoSwap(), SetValue(), and SetValues().

## GetTag()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

Tag gdcm::Attribute< Group, Element, TVR, TVM >::GetTag | ( |  | ) |

inline static

Examples
  PatchFile.cxx, ReadAndPrintAttributes.cxx, gdcmrtionplan.cxx, and gdcmrtplan.cxx.

Referenced by GetAsDataElement(), and Print().

## GetValue() [1/2]

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

ArrayType & gdcm::Attribute< Group, Element, TVR, TVM >::GetValue | ( | unsigned int | idx = 0 | ) |

inline

Examples
  DeriveSeries.cxx, FixOrientation.cxx, GetSequenceUltrasound.cxx, PatchFile.cxx, ReadAndDumpDICOMDIR2.cxx, ReadAndPrintAttributes.cxx, gdcmrtionplan.cxx, gdcmrtplan.cxx, pmsct_rgb1.cxx, and rle2img.cxx.

References GetNumberOfValues(), and Internal.

Referenced by operator[](), and operator[]().

## GetValue() [2/2]

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

ArrayType const & gdcm::Attribute< Group, Element, TVR, TVM >::GetValue | ( | unsigned int | idx = 0 | ) | const

inline

References GetNumberOfValues(), and Internal.

## GetValues()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

const ArrayType * gdcm::Attribute< Group, Element, TVR, TVM >::GetValues | ( |  | ) | const

inline

Examples
  FixOrientation.cxx, LargeVRDSExplicit.cxx, gdcmrtionplan.cxx, and gdcmrtplan.cxx.

References Internal.

Referenced by operator!=(), gdcm::Attribute< Group, Element, TVR, VM::VM1 >::operator!=(), operator<(), gdcm::Attribute< Group, Element, TVR, VM::VM1 >::operator<(), operator==(), and gdcm::Attribute< Group, Element, TVR, VM::VM1 >::operator==().

## GetVM()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

VM gdcm::Attribute< Group, Element, TVR, TVM >::GetVM | ( |  | ) |

inline static

## GetVR()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

VR gdcm::Attribute< Group, Element, TVR, TVM >::GetVR | ( |  | ) |

inline static

Examples
  LargeVRDSExplicit.cxx.

Referenced by GetAsDataElement(), and SetFromDataElement().

## operator!=()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

bool gdcm::Attribute< Group, Element, TVR, TVM >::operator!= | ( | const Attribute< Group, Element, TVR, TVM > & | att | ) | const

inline

References GetNumberOfValues(), GetValues(), and Internal.

## operator<()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

bool gdcm::Attribute< Group, Element, TVR, TVM >::operator< | ( | const Attribute< Group, Element, TVR, TVM > & | att | ) | const

inline

References GetNumberOfValues(), GetValues(), and Internal.

## operator==()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

bool gdcm::Attribute< Group, Element, TVR, TVM >::operator== | ( | const Attribute< Group, Element, TVR, TVM > & | att | ) | const

inline

References GetNumberOfValues(), GetValues(), and Internal.

## operator[]() [1/2]

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

ArrayType & gdcm::Attribute< Group, Element, TVR, TVM >::operator[] | ( | unsigned int | idx | ) |

inline

References GetValue().

## operator[]() [2/2]

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

ArrayType const & gdcm::Attribute< Group, Element, TVR, TVM >::operator[] | ( | unsigned int | idx | ) | const

inline

References GetValue().

## Print()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

void gdcm::Attribute< Group, Element, TVR, TVM >::Print | ( | std::ostream & | os | ) | const

inline

References GetNumberOfValues(), GetTag(), and Internal.

## Set()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

void gdcm::Attribute< Group, Element, TVR, TVM >::Set | ( | DataSet const & | ds | ) |

inline

Examples
  LargeVRDSExplicit.cxx, SortImage.cxx, and VolumeSorter.cxx.

References gdcm::DataSet::GetDataElement(), and SetFromDataElement().

## SetByteValue()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

void gdcm::Attribute< Group, Element, TVR, TVM >::SetByteValue | ( | const ByteValue * | bv | ) |

inline protected

References gdcm::ByteValue::GetLength(), GetNumberOfValues(), gdcm::ByteValue::GetPointer(), and Internal.

Referenced by SetFromDataElement().

## SetByteValueNoSwap()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

void gdcm::Attribute< Group, Element, TVR, TVM >::SetByteValueNoSwap | ( | const ByteValue * | bv | ) |

inline protected

References gdcm::ByteValue::GetLength(), GetNumberOfValues(), gdcm::ByteValue::GetPointer(), and Internal.

Referenced by SetFromDataElement().

## SetFromDataElement()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

void gdcm::Attribute< Group, Element, TVR, TVM >::SetFromDataElement | ( | DataElement const & | de | ) |

inline

Examples
  GetSequenceUltrasound.cxx, LargeVRDSExplicit.cxx, PatchFile.cxx, ReadAndDumpDICOMDIR2.cxx, gdcmrtionplan.cxx, and gdcmrtplan.cxx.

References gdcm::DataElement::GetByteValue(), gdcm::DataElement::GetTag(), GetVR(), gdcm::DataElement::GetVR(), gdcm::VR::INVALID, gdcm::DataElement::IsEmpty(), SetByteValue(), SetByteValueNoSwap(), and gdcm::VR::UN.

Referenced by Set(), and SetFromDataSet().

## SetFromDataSet()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

void gdcm::Attribute< Group, Element, TVR, TVM >::SetFromDataSet | ( | DataSet const & | ds | ) |

inline

Examples
  DeriveSeries.cxx, FixOrientation.cxx, ReadAndPrintAttributes.cxx, pmsct_rgb1.cxx, and rle2img.cxx.

References gdcm::DataSet::FindDataElement(), gdcm::DataSet::GetDataElement(), and SetFromDataElement().

## SetValue()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

void gdcm::Attribute< Group, Element, TVR, TVM >::SetValue | ( | ArrayType | v,
|  | unsigned int | idx = 0 )

inline

Examples
  CreateFakeRTDOSE.cxx, CreateJPIPDataSet.cxx, FixOrientation.cxx, HelloWorld.cxx, LargeVRDSExplicit.cxx, and PatchFile.cxx.

References GetNumberOfValues(), and Internal.

## SetValues()

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

void gdcm::Attribute< Group, Element, TVR, TVM >::SetValues | ( | const ArrayType * | array,
|  | unsigned int | numel = VMType )

inline

Examples
  FixOrientation.cxx, and LargeVRDSExplicit.cxx.

References GetNumberOfValues(), Internal, and VMType.

## Member Data Documentation

## Internal

template<uint16_t Group, uint16_t Element, long long TVR = TagToType<Group, Element>::VRType, int TVM = TagToType<Group, Element>::VMType>

ArrayType gdcm::Attribute< Group, Element, TVR, TVM >::Internal[VMToLength< TVM >::Length]

Referenced by GetAsDataElement(), GetValue(), GetValue(), GetValues(), operator!=(), operator<(), operator==(), Print(), SetByteValue(), SetByteValueNoSwap(), SetValue(), and SetValues().

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

- gdcmAttribute.h