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" 32 explicit DataSet(std::string
const & transfer_syntax=
"");
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(); }
219 typedef std::map<Tag, Element> ElementMap;
221 ElementMap _elements;
224 std::string _transfer_syntax;
229 #endif // _8424446e_1153_4acc_9f57_e86faa7246e3 bool is_binary(Tag const &tag) const
Test whether an existing element has binary type.
Definition: DataSet.cpp:369
VR get_vr(Tag const &tag) const
Return the VR of an element in the data set.
Definition: DataSet.cpp:404
bool is_int(Tag const &tag) const
Test whether an existing element has integer type.
Definition: DataSet.cpp:257
std::vector< String > Strings
String container.
Definition: Value.h:55
Element const & operator[](Tag const &tag) const
Access the given element.
Definition: DataSet.cpp:220
std::vector< Real > Reals
Real container.
Definition: Value.h:52
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:264
bool has(Tag const &tag) const
Test whether an element is in the data set.
Definition: DataSet.cpp:397
Value::Strings const & as_string(Tag const &tag) const
Return the strings contained in an existing element (read-only).
Definition: DataSet.cpp:320
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:341
bool operator!=(DataSet const &other) const
Difference test.
Definition: DataSet.cpp:450
bool is_real(Tag const &tag) const
Test whether an existing element has real type.
Definition: DataSet.cpp:285
bool operator==(DataSet const &other) const
Equality test.
Definition: DataSet.cpp:443
Value::DataSets const & as_data_set(Tag const &tag) const
Return the data sets contained in an existing element (read-only).
Definition: DataSet.cpp:348
std::string String
String type.
Definition: Value.h:46
std::vector< Integer > Integers
Integer container.
Definition: Value.h:49
void set_transfer_syntax(std::string const &transfer_syntax)
Set the current transfer syntax.
Definition: DataSet.cpp:464
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:376
bool is_string(Tag const &tag) const
Test whether an existing element has string type.
Definition: DataSet.cpp:313
std::vector< std::vector< uint8_t > > Binary
Binary data container.
Definition: Value.h:61
DataSet(std::string const &transfer_syntax="")
Create an empty data set.
Definition: DataSet.cpp:25
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:292
std::size_t size() const
Return the number of elements in the data set.
Definition: DataSet.cpp:213
std::string const & get_transfer_syntax() const
Return the current transfer syntax.
Definition: DataSet.cpp:457
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:33
int64_t Integer
Integer type.
Definition: Value.h:40
bool empty() const
Test whether the data set is empty.
Definition: DataSet.cpp:206