9 #ifndef _8424446e_1153_4acc_9f57_e86faa7246e3 10 #define _8424446e_1153_4acc_9f57_e86faa7246e3 14 #include <initializer_list> 19 #include "odil/Element.h" 20 #include "odil/Value.h" 38 void add(
Tag const & tag, VR vr=VR::UNKNOWN);
62 Tag const & tag, std::initializer_list<int>
const & value,
67 Tag const & tag, std::initializer_list<Value::Integer>
const & value,
72 Tag const & tag, std::initializer_list<Value::Real>
const & value,
77 Tag const & tag, std::initializer_list<Value::String>
const & value,
82 Tag const & tag, std::initializer_list<DataSet>
const & value,
90 void remove(
Tag const & tag);
96 std::size_t
size()
const;
99 bool has(
Tag const & tag)
const;
120 std::size_t
size(
Tag const & tag)
const;
194 Value::Binary::value_type
const &
195 as_binary(
Tag const & tag,
unsigned int position)
const;
201 const_iterator
begin()
const {
return this->_elements.begin(); }
204 const_iterator
end()
const {
return this->_elements.end(); }
213 typedef std::map<Tag, Element> ElementMap;
215 ElementMap _elements;
220 #endif // _8424446e_1153_4acc_9f57_e86faa7246e3 bool is_binary(Tag const &tag) const
Test whether an existing element has binary type.
Definition: DataSet.cpp:368
VR get_vr(Tag const &tag) const
Return the VR of an element in the data set.
Definition: DataSet.cpp:403
bool is_int(Tag const &tag) const
Test whether an existing element has integer type.
Definition: DataSet.cpp:256
std::vector< String > Strings
String container.
Definition: Value.h:55
Element const & operator[](Tag const &tag) const
Access the given element.
Definition: DataSet.cpp:219
std::vector< Real > Reals
Real container.
Definition: Value.h:52
DataSet()
Create an empty data set.
Definition: DataSet.cpp:25
const_iterator end() const
Return an iterator to the end of the elements.
Definition: DataSet.h:204
double Real
Real type.
Definition: Value.h:43
Value::Integers const & as_int(Tag const &tag) const
Return the integers contained in an existing element (read-only).
Definition: DataSet.cpp:263
bool has(Tag const &tag) const
Test whether an element is in the data set.
Definition: DataSet.cpp:396
Value::Strings const & as_string(Tag const &tag) const
Return the strings contained in an existing element (read-only).
Definition: DataSet.cpp:319
Definition: Association.cpp:39
A DICOM element tag.
Definition: Tag.h:22
bool is_data_set(Tag const &tag) const
Test whether an existing element has data set type.
Definition: DataSet.cpp:340
bool operator!=(DataSet const &other) const
Difference test.
Definition: DataSet.cpp:449
bool is_real(Tag const &tag) const
Test whether an existing element has real type.
Definition: DataSet.cpp:284
bool operator==(DataSet const &other) const
Equality test.
Definition: DataSet.cpp:442
Value::DataSets const & as_data_set(Tag const &tag) const
Return the data sets contained in an existing element (read-only).
Definition: DataSet.cpp:347
std::string String
String type.
Definition: Value.h:46
std::vector< Integer > Integers
Integer container.
Definition: Value.h:49
std::vector< DataSet > DataSets
Data sets container.
Definition: Value.h:58
const_iterator begin() const
Return an iterator to the start of the elements.
Definition: DataSet.h:201
Value::Binary const & as_binary(Tag const &tag) const
Return the binary items contained in an existing element (read-only).
Definition: DataSet.cpp:375
bool is_string(Tag const &tag) const
Test whether an existing element has string type.
Definition: DataSet.cpp:312
std::vector< std::vector< uint8_t > > Binary
Binary data container.
Definition: Value.h:61
DICOM Data set.
Definition: DataSet.h:28
std::map< Tag, Element >::const_iterator const_iterator
Iterator to the elements.
Definition: DataSet.h:198
Value::Reals const & as_real(Tag const &tag) const
Return the reals contained in an existing element (read-only).
Definition: DataSet.cpp:291
std::size_t size() const
Return the number of elements in the data set.
Definition: DataSet.cpp:212
Element of a DICOM data set.
Definition: Element.h:25
void add(Tag const &tag, Element const &element)
Add an element to the dataset.
Definition: DataSet.cpp:32
int64_t Integer
Integer type.
Definition: Value.h:40
bool empty() const
Test whether the data set is empty.
Definition: DataSet.cpp:205