9#ifndef _8424446e_1153_4acc_9f57_e86faa7246e3
10#define _8424446e_1153_4acc_9f57_e86faa7246e3
14#include <initializer_list>
33 explicit DataSet(std::string
const & transfer_syntax=
"");
54#define ODIL_DATASET_ADD(type) \
56 Tag const & tag, Value::type const & value, VR vr=VR::UNKNOWN);\
58 Tag const & tag, Value::type && value, VR vr=VR::UNKNOWN); \
61 std::initializer_list<Value::type::value_type> const & value, \
73#undef ODIL_DATASET_ADD
77 Tag const & tag, std::initializer_list<int>
const & value,
83 std::initializer_list<std::initializer_list<uint8_t>>
const & value,
183 std::shared_ptr<DataSet>
const &
196 Value::Binary::value_type
const &
230 typedef std::map<Tag, Element> ElementMap;
232 ElementMap _elements;
235 std::string _transfer_syntax;
#define ODIL_DATASET_ADD(type)
Definition DataSet.h:54
DICOM Data set.
Definition DataSet.h:30
Value::Strings & as_string(Tag const &tag)
Return the strings contained in an existing element (read-write).
Value::DataSets const & as_data_set(Tag const &tag) const
Return the data sets contained in an existing element (read-only).
bool operator!=(DataSet const &other) const
Difference test.
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.
void add(Tag const &tag, VR vr=VR::UNKNOWN)
Add an empty element to the dataset.
void add(Tag const &tag, Element &&element)
Add an element to the dataset.
VR get_vr(Tag const &tag) const
Return the VR of an element in the data set.
Element & operator[](Tag const &tag)
Access the given element.
Value::Real const & as_real(Tag const &tag, unsigned int position) const
Return an real contained in an existing element (read-only).
bool is_real(Tag const &tag) const
Test whether an existing element has real type.
void add(Tag const &tag, std::initializer_list< int > const &value, VR vr=VR::UNKNOWN)
Add an element to the dataset.
Value::Binary const & as_binary(Tag const &tag) const
Return the binary items contained in an existing element (read-only).
bool operator==(DataSet const &other) const
Equality test.
bool is_int(Tag const &tag) const
Test whether an existing element has integer type.
const_iterator begin() const
Return an iterator to the start of the elements.
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).
Element const & operator[](Tag const &tag) const
Access the given element.
void clear(Tag const &tag)
Clear the element (data_set.empty(tag) will be true).
bool empty(Tag const &tag) const
Test whether an element of the data set is empty.
void clear()
Clear the data set (data_set.empty() will be true). All iterators and all references to elements will...
void set_transfer_syntax(std::string const &transfer_syntax)
Set the current transfer syntax.
void remove(Tag const &tag)
Remove an element from the data set.
Value::Binary & as_binary(Tag const &tag)
Return the binary items 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_binary(Tag const &tag) const
Test whether an existing element has binary type.
const_iterator end() const
Return an iterator to the end of the elements.
Value::Reals const & as_real(Tag const &tag) const
Return the reals contained in an existing element (read-only).
bool has(Tag const &tag) const
Test whether an element is in the data set.
Value::Integers const & as_int(Tag const &tag) const
Return the integers contained in an existing element (read-only).
DataSet(std::string const &transfer_syntax="")
Create an empty data set.
Value::Strings const & as_string(Tag const &tag) const
Return the strings contained in an existing element (read-only).
void add(Tag const &tag, Element const &element)
Add an element to the dataset.
std::map< Tag, Element >::const_iterator const_iterator
Iterator to the elements.
Definition DataSet.h:200
Value::Reals & as_real(Tag const &tag)
Return the reals contained in an existing element (read-write).
Value::DataSets & as_data_set(Tag const &tag)
Return the data sets contained in an existing element (read-write).
std::string const & get_transfer_syntax() const
Return the current transfer syntax.
std::shared_ptr< DataSet > const & as_data_set(Tag const &tag, unsigned int position) const
Return a data set contained in an existing element (read-only).
std::size_t size() const
Return the number of elements in the data set.
bool empty() const
Test whether the data set is empty.
Value::String const & as_string(Tag const &tag, unsigned int position) const
Return a string contained in an existing element (read-only).
Value::Integers & as_int(Tag const &tag)
Return the integers contained in an existing element (read-write).
std::size_t size(Tag const &tag) const
Return the number of values in an element of the data set.
bool is_data_set(Tag const &tag) const
Test whether an existing element has data set type.
bool is_string(Tag const &tag) const
Test whether an existing element has string type.
Element of a DICOM data set.
Definition Element.h:27
A DICOM element tag.
Definition Tag.h:26
std::vector< String > Strings
String container.
Definition Value.h:57
int64_t Integer
Integer type.
Definition Value.h:42
std::vector< Integer > Integers
Integer container.
Definition Value.h:51
std::vector< std::vector< uint8_t > > Binary
Binary data container.
Definition Value.h:63
std::string String
String type.
Definition Value.h:48
std::vector< Real > Reals
Real container.
Definition Value.h:54
std::vector< std::shared_ptr< DataSet > > DataSets
Data sets container.
Definition Value.h:60
double Real
Real type.
Definition Value.h:45
DataSet(DataSet const &)=default
DataSet & operator=(DataSet const &)=default
DataSet(DataSet &&)=default
DataSet & operator=(DataSet &&)=default
Definition Association.h:25
VR
Value representations of DICOM.
Definition VR.h:23
#define ODIL_API
Definition odil.h:28