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

DICOM Data set. More...

#include <DataSet.h>

Public Types

typedef std::map< Tag, Element >::const_iterator const_iterator
 Iterator to the elements. More...
 

Public Member Functions

 DataSet (std::string const &transfer_syntax="")
 Create an empty data set. More...
 
 ~DataSet ()=default
 
 DataSet (DataSet const &)=default
 
 DataSet (DataSet &&)=default
 
DataSetoperator= (DataSet const &)=default
 
DataSetoperator= (DataSet &&)=default
 
void add (Tag const &tag, Element const &element)
 Add an element to the dataset. More...
 
void add (Tag const &tag, Element &&element)
 Add an element to the dataset. More...
 
void add (Tag const &tag, VR vr=VR::UNKNOWN)
 Add an empty element to the dataset. More...
 
void add (Tag const &tag, Value::Integers const &value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, Value::Integers &&value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, std::initializer_list< Value::Integers ::value_type > const &value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, Value::Reals const &value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, Value::Reals &&value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, std::initializer_list< Value::Reals ::value_type > const &value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, Value::Strings const &value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, Value::Strings &&value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, std::initializer_list< Value::Strings ::value_type > const &value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, Value::DataSets const &value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, Value::DataSets &&value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, std::initializer_list< Value::DataSets ::value_type > const &value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, Value::Binary const &value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, Value::Binary &&value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, std::initializer_list< Value::Binary ::value_type > const &value, VR vr=VR::UNKNOWN)
 
void add (Tag const &tag, std::initializer_list< int > const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset. More...
 
void add (Tag const &tag, std::initializer_list< std::initializer_list< uint8_t >> const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset. More...
 
void remove (Tag const &tag)
 Remove an element from the data set. More...
 
bool empty () const
 Test whether the data set is empty. More...
 
std::size_t size () const
 Return the number of elements in the data set. More...
 
bool has (Tag const &tag) const
 Test whether an element is in the data set. More...
 
VR get_vr (Tag const &tag) const
 Return the VR of an element in the data set. More...
 
bool empty (Tag const &tag) const
 Test whether an element of the data set is empty. More...
 
std::size_t size (Tag const &tag) const
 Return the number of values in an element of the data set. More...
 
Element const & operator[] (Tag const &tag) const
 Access the given element. More...
 
Elementoperator[] (Tag const &tag)
 Access the given element. More...
 
bool is_int (Tag const &tag) const
 Test whether an existing element has integer type. More...
 
Value::Integers const & as_int (Tag const &tag) const
 Return the integers contained in an existing element (read-only). More...
 
Value::Integersas_int (Tag const &tag)
 Return the integers contained in an existing element (read-write). More...
 
Value::Integer const & as_int (Tag const &tag, unsigned int position) const
 Return an integer contained in an existing element (read-only). More...
 
bool is_real (Tag const &tag) const
 Test whether an existing element has real type. More...
 
Value::Reals const & as_real (Tag const &tag) const
 Return the reals contained in an existing element (read-only). More...
 
Value::Realsas_real (Tag const &tag)
 Return the reals contained in an existing element (read-write). More...
 
Value::Real const & as_real (Tag const &tag, unsigned int position) const
 Return an real contained in an existing element (read-only). More...
 
bool is_string (Tag const &tag) const
 Test whether an existing element has string type. More...
 
Value::Strings const & as_string (Tag const &tag) const
 Return the strings contained in an existing element (read-only). More...
 
Value::Stringsas_string (Tag const &tag)
 Return the strings contained in an existing element (read-write). More...
 
Value::String const & as_string (Tag const &tag, unsigned int position) const
 Return a string contained in an existing element (read-only). More...
 
bool is_data_set (Tag const &tag) const
 Test whether an existing element has data set type. More...
 
Value::DataSets const & as_data_set (Tag const &tag) const
 Return the data sets contained in an existing element (read-only). More...
 
Value::DataSetsas_data_set (Tag const &tag)
 Return the data sets contained in an existing element (read-write). More...
 
DataSet const & as_data_set (Tag const &tag, unsigned int position) const
 Return a data set contained in an existing element (read-only). More...
 
bool is_binary (Tag const &tag) const
 Test whether an existing element has binary type. More...
 
Value::Binary const & as_binary (Tag const &tag) const
 Return the binary items contained in an existing element (read-only). More...
 
Value::Binaryas_binary (Tag const &tag)
 Return the binary items contained in an existing element (read-write). More...
 
Value::Binary::value_type const & as_binary (Tag const &tag, unsigned int position) const
 Return a binary item contained in an existing element (read-only). More...
 
const_iterator begin () const
 Return an iterator to the start of the elements. More...
 
const_iterator end () const
 Return an iterator to the end of the elements. More...
 
bool operator== (DataSet const &other) const
 Equality test. More...
 
bool operator!= (DataSet const &other) const
 Difference test. More...
 
void clear ()
 Clear the data set (data_set.empty() will be true). All iterators and all references to elements will be invalidated. More...
 
void clear (Tag const &tag)
 Clear the element (data_set.empty(tag) will be true). More...
 
std::string const & get_transfer_syntax () const
 Return the current transfer syntax. More...
 
void set_transfer_syntax (std::string const &transfer_syntax)
 Set the current transfer syntax. More...
 

Detailed Description

DICOM Data set.

Member Typedef Documentation

◆ const_iterator

Iterator to the elements.

Constructor & Destructor Documentation

◆ DataSet()

odil::DataSet::DataSet ( std::string const &  transfer_syntax = "")
explicit

Create an empty data set.

Member Function Documentation

◆ add() [1/20]

void odil::DataSet::add ( Tag const &  tag,
Element const &  element 
)

Add an element to the dataset.

◆ add() [2/20]

void odil::DataSet::add ( Tag const &  tag,
Element &&  element 
)

Add an element to the dataset.

◆ add() [3/20]

void odil::DataSet::add ( Tag const &  tag,
VR  vr = VR::UNKNOWN 
)

Add an empty element to the dataset.

◆ add() [4/20]

void odil::DataSet::add ( Tag const &  tag,
std::initializer_list< Value::Integers ::value_type > const &  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [5/20]

void odil::DataSet::add ( Tag const &  tag,
Value::Integers const &  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [6/20]

void odil::DataSet::add ( Tag const &  tag,
Value::Integers &&  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [7/20]

void odil::DataSet::add ( Tag const &  tag,
Value::Reals const &  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [8/20]

void odil::DataSet::add ( Tag const &  tag,
Value::Reals &&  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [9/20]

void odil::DataSet::add ( Tag const &  tag,
std::initializer_list< Value::Reals ::value_type > const &  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [10/20]

void odil::DataSet::add ( Tag const &  tag,
Value::Strings const &  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [11/20]

void odil::DataSet::add ( Tag const &  tag,
Value::Strings &&  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [12/20]

void odil::DataSet::add ( Tag const &  tag,
std::initializer_list< Value::Strings ::value_type > const &  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [13/20]

void odil::DataSet::add ( Tag const &  tag,
Value::DataSets &&  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [14/20]

void odil::DataSet::add ( Tag const &  tag,
std::initializer_list< Value::DataSets ::value_type > const &  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [15/20]

void odil::DataSet::add ( Tag const &  tag,
Value::DataSets const &  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [16/20]

void odil::DataSet::add ( Tag const &  tag,
Value::Binary const &  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [17/20]

void odil::DataSet::add ( Tag const &  tag,
Value::Binary &&  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [18/20]

void odil::DataSet::add ( Tag const &  tag,
std::initializer_list< Value::Binary ::value_type > const &  value,
VR  vr = VR::UNKNOWN 
)

◆ add() [19/20]

void odil::DataSet::add ( Tag const &  tag,
std::initializer_list< int > const &  value,
VR  vr = VR::UNKNOWN 
)

Add an element to the dataset.

◆ add() [20/20]

void odil::DataSet::add ( Tag const &  tag,
std::initializer_list< std::initializer_list< uint8_t >> const &  value,
VR  vr = VR::UNKNOWN 
)

Add an element to the dataset.

◆ as_binary() [1/3]

Value::Binary const& odil::DataSet::as_binary ( Tag const &  tag) const

Return the binary items contained in an existing element (read-only).

◆ as_binary() [2/3]

Value::Binary& odil::DataSet::as_binary ( Tag const &  tag)

Return the binary items contained in an existing element (read-write).

◆ as_binary() [3/3]

Value::Binary::value_type const& odil::DataSet::as_binary ( Tag const &  tag,
unsigned int  position 
) const

Return a binary item contained in an existing element (read-only).

◆ as_data_set() [1/3]

Value::DataSets const& odil::DataSet::as_data_set ( Tag const &  tag) const

Return the data sets contained in an existing element (read-only).

◆ as_data_set() [2/3]

Value::DataSets& odil::DataSet::as_data_set ( Tag const &  tag)

Return the data sets contained in an existing element (read-write).

◆ as_data_set() [3/3]

DataSet const& odil::DataSet::as_data_set ( Tag const &  tag,
unsigned int  position 
) const

Return a data set contained in an existing element (read-only).

◆ as_int() [1/3]

Value::Integers const& odil::DataSet::as_int ( Tag const &  tag) const

Return the integers contained in an existing element (read-only).

◆ as_int() [2/3]

Value::Integers& odil::DataSet::as_int ( Tag const &  tag)

Return the integers contained in an existing element (read-write).

◆ as_int() [3/3]

Value::Integer const& odil::DataSet::as_int ( Tag const &  tag,
unsigned int  position 
) const

Return an integer contained in an existing element (read-only).

◆ as_real() [1/3]

Value::Reals const& odil::DataSet::as_real ( Tag const &  tag) const

Return the reals contained in an existing element (read-only).

◆ as_real() [2/3]

Value::Reals& odil::DataSet::as_real ( Tag const &  tag)

Return the reals contained in an existing element (read-write).

◆ as_real() [3/3]

Value::Real const& odil::DataSet::as_real ( Tag const &  tag,
unsigned int  position 
) const

Return an real contained in an existing element (read-only).

◆ as_string() [1/3]

Value::Strings const& odil::DataSet::as_string ( Tag const &  tag) const

Return the strings contained in an existing element (read-only).

◆ as_string() [2/3]

Value::Strings& odil::DataSet::as_string ( Tag const &  tag)

Return the strings contained in an existing element (read-write).

◆ as_string() [3/3]

Value::String const& odil::DataSet::as_string ( Tag const &  tag,
unsigned int  position 
) const

Return a string contained in an existing element (read-only).

◆ begin()

const_iterator odil::DataSet::begin ( ) const

Return an iterator to the start of the elements.

◆ clear() [1/2]

void odil::DataSet::clear ( )

Clear the data set (data_set.empty() will be true). All iterators and all references to elements will be invalidated.

◆ clear() [2/2]

void odil::DataSet::clear ( Tag const &  tag)

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

◆ empty() [1/2]

bool odil::DataSet::empty ( ) const

Test whether the data set is empty.

◆ empty() [2/2]

bool odil::DataSet::empty ( Tag const &  tag) const

Test whether an element of the data set is empty.

If the element is not in the data set, a odil::Exception is raised.

◆ end()

const_iterator odil::DataSet::end ( ) const

Return an iterator to the end of the elements.

◆ get_transfer_syntax()

std::string const& odil::DataSet::get_transfer_syntax ( ) const

Return the current transfer syntax.

◆ get_vr()

VR odil::DataSet::get_vr ( Tag const &  tag) const

Return the VR of an element in the data set.

If the element is not in the data set, a odil::Exception is raised.

◆ has()

bool odil::DataSet::has ( Tag const &  tag) const

Test whether an element is in the data set.

◆ is_binary()

bool odil::DataSet::is_binary ( Tag const &  tag) const

Test whether an existing element has binary type.

◆ is_data_set()

bool odil::DataSet::is_data_set ( Tag const &  tag) const

Test whether an existing element has data set type.

◆ is_int()

bool odil::DataSet::is_int ( Tag const &  tag) const

Test whether an existing element has integer type.

◆ is_real()

bool odil::DataSet::is_real ( Tag const &  tag) const

Test whether an existing element has real type.

◆ is_string()

bool odil::DataSet::is_string ( Tag const &  tag) const

Test whether an existing element has string type.

◆ operator!=()

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

Difference test.

◆ operator==()

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

Equality test.

◆ operator[]() [1/2]

Element const& odil::DataSet::operator[] ( Tag const &  tag) const

Access the given element.

If the element is not in the data set, a odil::Exception is raised.

◆ operator[]() [2/2]

Element& odil::DataSet::operator[] ( Tag const &  tag)

Access the given element.

If the element is not in the data set, a odil::Exception is raised.

◆ remove()

void odil::DataSet::remove ( Tag const &  tag)

Remove an element from the data set.

If the element is not in the data set, a odil::Exception is raised.

◆ set_transfer_syntax()

void odil::DataSet::set_transfer_syntax ( std::string const &  transfer_syntax)

Set the current transfer syntax.

◆ size() [1/2]

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

Return the number of elements in the data set.

◆ size() [2/2]

std::size_t odil::DataSet::size ( Tag const &  tag) const

Return the number of values in an element of the data set.

If the element is not in the data set, a odil::Exception is raised.


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