Odil
A C++11 library for the DICOM standard
|
Go to the documentation of this file.
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;
240 #endif // _8424446e_1153_4acc_9f57_e86faa7246e3
Element of a DICOM data set.
Definition: Element.h:27
void clear(Tag const &tag)
Clear the element (data_set.empty(tag) will be true).
Value::Reals const & as_real(Tag const &tag) const
Return the reals contained in an existing element (read-only).
DataSet & operator=(DataSet const &)=default
DataSet & operator=(DataSet &&)=default
VR get_vr(Tag const &tag) const
Return the VR of an element in the data set.
void add(Tag const &tag, std::initializer_list< int > const &value, VR vr=VR::UNKNOWN)
Add an element to the dataset.
std::vector< String > Strings
String container.
Definition: Value.h:57
DataSet(DataSet const &)=default
Value::String const & as_string(Tag const &tag, unsigned int position) const
Return a string contained in an existing element (read-only).
#define ODIL_DATASET_ADD(type)
Definition: DataSet.h:54
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).
Value::DataSets const & as_data_set(Tag const &tag) const
Return the data sets contained in an existing element (read-only).
Definition: Association.h:25
bool operator==(DataSet const &other) const
Equality test.
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).
#define ODIL_API
Definition: odil.h:28
void add(Tag const &tag, Element &&element)
Add an element to the dataset.
const_iterator begin() const
Return an iterator to the start of the elements.
Value::Reals & as_real(Tag const &tag)
Return the reals contained in an existing element (read-write).
Value::Strings const & as_string(Tag const &tag) const
Return the strings contained in an existing element (read-only).
std::vector< std::vector< uint8_t > > Binary
Binary data container.
Definition: Value.h:63
void set_transfer_syntax(std::string const &transfer_syntax)
Set the current transfer syntax.
std::string String
String type.
Definition: Value.h:48
bool empty(Tag const &tag) const
Test whether an element of the data set is empty.
Value::Integers & as_int(Tag const &tag)
Return the integers contained in an existing element (read-write).
double Real
Real type.
Definition: Value.h:45
A DICOM element tag.
Definition: Tag.h:25
bool is_int(Tag const &tag) const
Test whether an existing element has integer type.
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.
Value::Strings & as_string(Tag const &tag)
Return the strings contained in an existing element (read-write).
DataSet(DataSet &&)=default
Value::DataSets & as_data_set(Tag const &tag)
Return the data sets contained in an existing element (read-write).
bool is_real(Tag const &tag) const
Test whether an existing element has real type.
void remove(Tag const &tag)
Remove an element from the data set.
DataSet(std::string const &transfer_syntax="")
Create an empty data set.
void add(Tag const &tag, VR vr=VR::UNKNOWN)
Add an empty element to the dataset.
const_iterator end() const
Return an iterator to the end of the elements.
Value::Integers const & as_int(Tag const &tag) const
Return the integers contained in an existing element (read-only).
VR
Value representations of DICOM.
Definition: VR.h:23
std::vector< std::shared_ptr< DataSet > > DataSets
Data sets container.
Definition: Value.h:60
Value::Integer const & as_int(Tag const &tag, unsigned int position) const
Return an integer contained in an existing element (read-only).
std::map< Tag, Element >::const_iterator const_iterator
Iterator to the elements.
Definition: DataSet.h:200
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.
int64_t Integer
Integer type.
Definition: Value.h:42
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.
bool is_string(Tag const &tag) const
Test whether an existing element has string type.
std::vector< Real > Reals
Real container.
Definition: Value.h:54
bool empty() const
Test whether 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...
Element const & operator[](Tag const &tag) const
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).
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
Difference test.
std::vector< Integer > Integers
Integer container.
Definition: Value.h:51
bool is_binary(Tag const &tag) const
Test whether an existing element has binary type.
std::string const & get_transfer_syntax() const
Return the current transfer syntax.
Value::Binary & as_binary(Tag const &tag)
Return the binary items contained in an existing element (read-write).
Element & operator[](Tag const &tag)
Access the given element.
DICOM Data set.
Definition: DataSet.h:30
void add(Tag const &tag, Element const &element)
Add an element to the dataset.