Odil
A C++11 library for the DICOM standard
Public Member Functions | Public Attributes | List of all members
odil::Element Class Reference

Element of a DICOM data set. More...

#include <Element.h>

Public Member Functions

 Element (VR const &vr)
 Constructor using the VR to create an according empty container. More...
 
 Element (Value const &value, VR const &vr)
 Constructor. More...
 
 Element (Value &&value, VR const &vr)
 Constructor. More...
 
 ODIL_ELEMENT_CONSTRUCTORS (Integers)
 
 ODIL_ELEMENT_CONSTRUCTORS (Reals)
 
 ODIL_ELEMENT_CONSTRUCTORS (Strings)
 
 ODIL_ELEMENT_CONSTRUCTORS (DataSets)
 
 ODIL_ELEMENT_CONSTRUCTORS (Binary)
 
 Element (std::initializer_list< int > const &value, VR const &vr=VR::INVALID)
 
 Element (std::initializer_list< std::initializer_list< uint8_t >> const &value, VR const &vr=VR::INVALID)
 
 ~Element ()=default
 
 Element (Element const &)=default
 
 Element (Element &&)=default
 
Elementoperator= (Element const &)=default
 
Elementoperator= (Element &&)=default
 
bool empty () const
 Test whether the element is empty. More...
 
std::size_t size () const
 Return the number of items in the value. More...
 
Value const & get_value () const
 Return the raw value. More...
 
bool is_int () const
 Test whether the value contains integers. More...
 
Value::Integers const & as_int () const
 Return the integers contained in the element. More...
 
Value::Integersas_int ()
 Return the integers contained in the element. More...
 
bool is_real () const
 Test whether the value contains reals. More...
 
Value::Reals const & as_real () const
 Return the reals contained in the element. More...
 
Value::Realsas_real ()
 Return the reals contained in the element. More...
 
bool is_string () const
 Test whether the value contains strings. More...
 
Value::Strings const & as_string () const
 Return the strings contained in the element. More...
 
Value::Stringsas_string ()
 Return the strings contained in the element. More...
 
bool is_data_set () const
 Test whether the value contains data sets. More...
 
Value::DataSets const & as_data_set () const
 Return the data sets contained in the element. More...
 
Value::DataSetsas_data_set ()
 Return the data sets contained in the element. More...
 
bool is_binary () const
 Test whether the value contains data sets. More...
 
Value::Binary const & as_binary () const
 Return the binary data contained in the element. More...
 
Value::Binaryas_binary ()
 Return the binary data contained in the element. More...
 
bool operator== (Element const &other) const
 Equality test. More...
 
bool operator!= (Element const &other) const
 Difference test. More...
 
void clear ()
 Clear the element (element.empty() will be true). More...
 

Public Attributes

VR vr
 VR of the element. More...
 

Detailed Description

Element of a DICOM data set.

Constructor & Destructor Documentation

◆ Element() [1/5]

odil::Element::Element ( VR const &  vr)

Constructor using the VR to create an according empty container.

◆ Element() [2/5]

odil::Element::Element ( Value const &  value,
VR const &  vr 
)

Constructor.

◆ Element() [3/5]

odil::Element::Element ( Value &&  value,
VR const &  vr 
)

Constructor.

◆ Element() [4/5]

odil::Element::Element ( std::initializer_list< int > const &  value,
VR const &  vr = VR::INVALID 
)

◆ Element() [5/5]

odil::Element::Element ( std::initializer_list< std::initializer_list< uint8_t >> const &  value,
VR const &  vr = VR::INVALID 
)

Member Function Documentation

◆ as_binary() [1/2]

Value::Binary const& odil::Element::as_binary ( ) const

Return the binary data contained in the element.

If the element does not contain binary data, a odil::Exception is raised.

◆ as_binary() [2/2]

Value::Binary& odil::Element::as_binary ( )

Return the binary data contained in the element.

If the element does not contain binary data, a odil::Exception is raised.

◆ as_data_set() [1/2]

Value::DataSets const& odil::Element::as_data_set ( ) const

Return the data sets contained in the element.

If the element does not contain data sets, a odil::Exception is raised.

◆ as_data_set() [2/2]

Value::DataSets& odil::Element::as_data_set ( )

Return the data sets contained in the element.

If the element does not contain data sets, a odil::Exception is raised.

◆ as_int() [1/2]

Value::Integers const& odil::Element::as_int ( ) const

Return the integers contained in the element.

If the element does not contain integers, a odil::Exception is raised.

◆ as_int() [2/2]

Value::Integers& odil::Element::as_int ( )

Return the integers contained in the element.

If the element does not contain integers, a odil::Exception is raised.

◆ as_real() [1/2]

Value::Reals const& odil::Element::as_real ( ) const

Return the reals contained in the element.

If the element does not contain reals, a odil::Exception is raised.

◆ as_real() [2/2]

Value::Reals& odil::Element::as_real ( )

Return the reals contained in the element.

If the element does not contain reals, a odil::Exception is raised.

◆ as_string() [1/2]

Value::Strings const& odil::Element::as_string ( ) const

Return the strings contained in the element.

If the element does not contain strings, a odil::Exception is raised.

◆ as_string() [2/2]

Value::Strings& odil::Element::as_string ( )

Return the strings contained in the element.

If the element does not contain strings, a odil::Exception is raised.

◆ clear()

void odil::Element::clear ( )

Clear the element (element.empty() will be true).

◆ empty()

bool odil::Element::empty ( ) const

Test whether the element is empty.

◆ get_value()

Value const& odil::Element::get_value ( ) const

Return the raw value.

◆ is_binary()

bool odil::Element::is_binary ( ) const

Test whether the value contains data sets.

◆ is_data_set()

bool odil::Element::is_data_set ( ) const

Test whether the value contains data sets.

◆ is_int()

bool odil::Element::is_int ( ) const

Test whether the value contains integers.

◆ is_real()

bool odil::Element::is_real ( ) const

Test whether the value contains reals.

◆ is_string()

bool odil::Element::is_string ( ) const

Test whether the value contains strings.

◆ ODIL_ELEMENT_CONSTRUCTORS() [1/5]

odil::Element::ODIL_ELEMENT_CONSTRUCTORS ( Integers  )

◆ ODIL_ELEMENT_CONSTRUCTORS() [2/5]

odil::Element::ODIL_ELEMENT_CONSTRUCTORS ( Reals  )

◆ ODIL_ELEMENT_CONSTRUCTORS() [3/5]

odil::Element::ODIL_ELEMENT_CONSTRUCTORS ( Strings  )

◆ ODIL_ELEMENT_CONSTRUCTORS() [4/5]

odil::Element::ODIL_ELEMENT_CONSTRUCTORS ( DataSets  )

◆ ODIL_ELEMENT_CONSTRUCTORS() [5/5]

odil::Element::ODIL_ELEMENT_CONSTRUCTORS ( Binary  )

◆ operator!=()

bool odil::Element::operator!= ( Element const &  other) const

Difference test.

◆ operator==()

bool odil::Element::operator== ( Element const &  other) const

Equality test.

◆ size()

std::size_t odil::Element::size ( ) const

Return the number of items in the value.

Member Data Documentation

◆ vr

VR odil::Element::vr

VR of the element.


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