Odil
A C++11 library for the DICOM standard
|
Go to the documentation of this file.
9 #ifndef _9c3d8f32_0310_4e3a_b5d2_6d69f229a2cf
10 #define _9c3d8f32_0310_4e3a_b5d2_6d69f229a2cf
13 #include <initializer_list>
42 #define ODIL_ELEMENT_CONSTRUCTORS(type) \
43 Element(Value::type const & value, VR const & vr=VR::INVALID); \
44 Element(Value::type && value, VR const & vr=VR::INVALID); \
46 std::initializer_list<Value::type::value_type> const & value, \
47 VR const & vr=VR::INVALID);
58 #undef ODIL_ELEMENT_CONSTRUCTORS
61 std::initializer_list<int>
const & value,
VR const & vr=
VR::INVALID);
64 std::initializer_list<std::initializer_list<uint8_t>>
const & value,
190 template<
typename TVisitor>
191 typename TVisitor::result_type
197 #include "odil/Element.txx"
199 #endif // _9c3d8f32_0310_4e3a_b5d2_6d69f229a2cf
Element(std::initializer_list< int > const &value, VR const &vr=VR::INVALID)
Element of a DICOM data set.
Definition: Element.h:27
TVisitor::result_type apply_visitor(TVisitor const &visitor, Element const &element)
Visitor of elements.
Value::Reals & as_real()
Return the reals contained in the element.
bool operator==(Element const &other) const
Equality test.
Element & operator=(Element const &)=default
Value & get_value()
Return the raw value.
std::vector< String > Strings
String container.
Definition: Value.h:57
void clear()
Clear the element (element.empty() will be true).
Element(Value const &value, VR const &vr)
Constructor.
bool empty() const
Test whether the element is empty.
bool is_int() const
Test whether the value contains integers.
Definition: Association.h:25
Value::Binary const & as_binary() const
Return the binary data contained in the element.
#define ODIL_API
Definition: odil.h:28
Value::DataSets & as_data_set()
Return the data sets contained in the element.
Value const & get_value() const
Return the raw value.
Element(std::initializer_list< std::initializer_list< uint8_t >> const &value, VR const &vr=VR::INVALID)
std::vector< std::vector< uint8_t > > Binary
Binary data container.
Definition: Value.h:63
Value::Integers & as_int()
Return the integers contained in the element.
A value held in a DICOM element.
Definition: Value.h:29
bool is_binary() const
Test whether the value contains data sets.
bool operator!=(Element const &other) const
Difference test.
Value::Strings & as_string()
Return the strings contained in the element.
ODIL_ELEMENT_CONSTRUCTORS(Reals)
ODIL_ELEMENT_CONSTRUCTORS(DataSets)
bool is_real() const
Test whether the value contains reals.
std::size_t size() const
Return the number of items in the value.
ODIL_ELEMENT_CONSTRUCTORS(Integers)
Value::DataSets const & as_data_set() const
Return the data sets contained in the element.
Value::Strings const & as_string() const
Return the strings contained in the element.
VR
Value representations of DICOM.
Definition: VR.h:23
std::vector< std::shared_ptr< DataSet > > DataSets
Data sets container.
Definition: Value.h:60
Element(Value &&value, VR const &vr)
Constructor.
bool is_string() const
Test whether the value contains strings.
Value::Binary & as_binary()
Return the binary data contained in the element.
Element(Element const &)=default
ODIL_ELEMENT_CONSTRUCTORS(Binary)
Value::Integers const & as_int() const
Return the integers contained in the element.
bool is_data_set() const
Test whether the value contains data sets.
ODIL_ELEMENT_CONSTRUCTORS(Strings)
Value::Reals const & as_real() const
Return the reals contained in the element.
std::vector< Real > Reals
Real container.
Definition: Value.h:54
Element(Element &&)=default
Element & operator=(Element &&)=default
std::vector< Integer > Integers
Integer container.
Definition: Value.h:51
VR vr
VR of the element.
Definition: Element.h:31
Element(VR const &vr)
Constructor using the VR to create an according empty container.