72 std::shared_ptr<const dictionary::Page> m_page;
74 std::weak_ptr<DataSet> m_parent;
75 std::vector<std::shared_ptr<DataSet>> m_data_sets;
77 std::shared_ptr<manipulators::ValueManipulator> m_manipulator;
121 const std::shared_ptr<const dictionary::Page>&
page()
const;
123 void set_page(std::shared_ptr<const dictionary::Page> page);
131 const VR&
vr()
const;
137 const std::weak_ptr<DataSet>&
parent()
const;
138 std::weak_ptr<DataSet>&
parent();
141 const std::vector<std::shared_ptr<DataSet>>&
data_sets()
const;
144 std::vector<std::shared_ptr<DataSet>>&
data_sets();
147 std::shared_ptr<manipulators::ValueManipulator> manipulator() {
return m_manipulator; }
148 std::shared_ptr<const manipulators::ValueManipulator> manipulator()
const {
157 template <
typename T>
159 if (!manipulator->is_valid_for(this->vr())) {
160 throw vega::Exception(std::string(
"DataElement::set_manipulator, received manipulator does not support VR ") + this->
vr().
str());
179 template <
typename T>
184 if (!m_manipulator) {
185 m_manipulator = std::make_shared<T>();
186 return std::static_pointer_cast<T>(m_manipulator);
190 std::shared_ptr<T> manipulator = std::dynamic_pointer_cast<T>(m_manipulator);
191 if (manipulator)
return manipulator;
194 m_manipulator = std::make_shared<T>(m_manipulator->raw_value());
195 return std::static_pointer_cast<T>(m_manipulator);
199 std::string
str()
const;
204 bool is_undefined_length()
const;
207 std::vector<std::shared_ptr<DataSet>>::iterator
begin() {
208 return m_data_sets.begin();
210 std::vector<std::shared_ptr<DataSet>>::const_iterator
begin()
const {
211 return m_data_sets.begin();
214 std::vector<std::shared_ptr<DataSet>>::iterator
end() {
215 return m_data_sets.end();
217 std::vector<std::shared_ptr<DataSet>>::const_iterator
end()
const {
218 return m_data_sets.end();
std::vector< std::shared_ptr< DataSet > >::const_iterator end() const
Definition: data_element.h:217
This class is used to contain the information in a single DataElement.
Definition: data_element.h:69
const std::weak_ptr< DataSet > & parent() const
std::shared_ptr< T > get_manipulator()
Definition: data_element.h:180
const DataElementHeader & header() const
bool operator!=(const DataElement &other) const
void set_page(std::shared_ptr< const dictionary::Page > page)
Sets the dictionary::Page for blank DataElements.
const std::shared_ptr< const dictionary::Page > & page() const
The base class for exceptions that are raised by the vega library.
Definition: vega.h:11
const std::vector< std::shared_ptr< DataSet > > & data_sets() const
std::vector< std::shared_ptr< DataSet > >::iterator begin()
Definition: data_element.h:207
const DataElementHeader::length_type & length() const
Stores a set of DataElements.
Definition: data_set.h:29
Definition: value_manipulator.h:29
DataElement(std::shared_ptr< DataSet > parent=nullptr)
bool operator==(const DataElement &other) const
std::vector< std::shared_ptr< DataSet > >::const_iterator begin() const
Definition: data_element.h:210
std::string str() const
Builds a string representation of the content of this DataElement.
std::vector< std::shared_ptr< DataSet > >::iterator end()
Definition: data_element.h:214
void log(Logger &logger) const
Class for working with DICOM data element tags.
Definition: tag.h:15
void validate_value_manipulator() const
Definition: vr.h:81
void set_manipulator(std::shared_ptr< T > manipulator)
Definition: data_element.h:158