odil
C++11libraryfortheDICOMstandard
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.
 

Public Member Functions

 DataSet (std::string const &transfer_syntax="")
 Create an empty data set.
 
void add (Tag const &tag, Element const &element)
 Add an element to the dataset.
 
void add (Tag const &tag, VR vr=VR::UNKNOWN)
 Add an empty element to the dataset.
 
void add (Tag const &tag, Value::Integers const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset.
 
void add (Tag const &tag, Value::Reals const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset.
 
void add (Tag const &tag, Value::Strings const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset.
 
void add (Tag const &tag, Value::DataSets const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset.
 
void add (Tag const &tag, Value::Binary const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset.
 
void add (Tag const &tag, std::initializer_list< int > const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset.
 
void add (Tag const &tag, std::initializer_list< Value::Integer > const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset.
 
void add (Tag const &tag, std::initializer_list< Value::Real > const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset.
 
void add (Tag const &tag, std::initializer_list< Value::String > const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset.
 
void add (Tag const &tag, std::initializer_list< DataSet > const &value, VR vr=VR::UNKNOWN)
 Add an element to the dataset.
 
void remove (Tag const &tag)
 Remove an element from the data set. More...
 
bool empty () const
 Test whether the data set is empty.
 
std::size_t size () const
 Return the number of elements in the data set.
 
bool has (Tag const &tag) const
 Test whether an element is in the data set.
 
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.
 
Value::Integers const & as_int (Tag const &tag) const
 Return the integers contained in an existing element (read-only).
 
Value::Integersas_int (Tag const &tag)
 Return the integers contained in an existing element (read-write).
 
Value::Integer const & as_int (Tag const &tag, unsigned int position) const
 Return an integer contained in an existing element (read-only).
 
bool is_real (Tag const &tag) const
 Test whether an existing element has real type.
 
Value::Reals const & as_real (Tag const &tag) const
 Return the reals contained in an existing element (read-only).
 
Value::Realsas_real (Tag const &tag)
 Return the reals contained in an existing element (read-write).
 
Value::Real const & as_real (Tag const &tag, unsigned int position) const
 Return an real contained in an existing element (read-only).
 
bool is_string (Tag const &tag) const
 Test whether an existing element has string type.
 
Value::Strings const & as_string (Tag const &tag) const
 Return the strings contained in an existing element (read-only).
 
Value::Stringsas_string (Tag const &tag)
 Return the strings contained in an existing element (read-write).
 
Value::String const & as_string (Tag const &tag, unsigned int position) const
 Return a string contained in an existing element (read-only).
 
bool is_data_set (Tag const &tag) const
 Test whether an existing element has data set type.
 
Value::DataSets const & as_data_set (Tag const &tag) const
 Return the data sets contained in an existing element (read-only).
 
Value::DataSetsas_data_set (Tag const &tag)
 Return the data sets contained in an existing element (read-write).
 
DataSet const & as_data_set (Tag const &tag, unsigned int position) const
 Return a data set contained in an existing element (read-only).
 
bool is_binary (Tag const &tag) const
 Test whether an existing element has binary type.
 
Value::Binary const & as_binary (Tag const &tag) const
 Return the binary items contained in an existing element (read-only).
 
Value::Binaryas_binary (Tag const &tag)
 Return the binary items contained in an existing element (read-write).
 
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).
 
const_iterator begin () const
 Return an iterator to the start of the elements.
 
const_iterator end () const
 Return an iterator to the end of the elements.
 
bool operator== (DataSet const &other) const
 Equality test.
 
bool operator!= (DataSet const &other) const
 Difference test.
 
std::string const & get_transfer_syntax () const
 Return the current transfer syntax.
 
void set_transfer_syntax (std::string const &transfer_syntax)
 Set the current transfer syntax.
 

Detailed Description

DICOM Data set.

Member Function Documentation

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.

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.

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.

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.

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.

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 files: