24#include <initializer_list>
146 std::string_view default_value = "") const
155 template <typename T>
156 requires std::is_arithmetic_v<T>
221 -> std::optional<std::
string>;
234 uint16_t group) const
255 uint8_t element_offset, encoding::vr_type
vr,
256 std::string_view value) -> std::optional<
dicom_tag>;
317 template <typename T>
318 requires std::is_arithmetic_v<T>
331 void clear() noexcept;
381 [[nodiscard]] auto
size() const noexcept ->
size_t;
387 [[nodiscard]] auto
empty() const noexcept ->
bool;
432 requires std::is_arithmetic_v<T>
434 const auto* elem =
get(tag);
435 if (elem ==
nullptr) {
439 auto result = elem->as_numeric<T>();
440 if (result.is_ok()) {
441 return result.value();
447 requires std::is_arithmetic_v<T>
std::map< dicom_tag, dicom_element > storage_type
Storage type for elements (ordered by tag)
auto cleanup_orphaned_creators() -> size_t
Remove orphaned Private Creator elements that have no data elements.
void set_numeric(dicom_tag tag, encoding::vr_type vr, T value)
Set a numeric value for the given tag.
auto has_sequence(dicom_tag tag) const noexcept -> bool
Check if the dataset contains a sequence element with the given tag.
auto get(dicom_tag tag) noexcept -> dicom_element *
Get a pointer to the element with the given tag.
auto remove(dicom_tag tag) -> bool
Remove an element from the dataset.
dicom_dataset()=default
Default constructor - creates an empty dataset.
auto set_private_element(std::string_view creator_id, uint16_t group, uint8_t element_offset, encoding::vr_type vr, std::string_view value) -> std::optional< dicom_tag >
Insert a private data element with automatic creator management.
dicom_dataset(dicom_dataset &&) noexcept=default
Move constructor.
void insert(dicom_element element)
Insert or replace an element in the dataset.
dicom_dataset(const dicom_dataset &)=default
Copy constructor.
auto empty() const noexcept -> bool
Check if the dataset is empty.
storage_type::iterator iterator
Iterator type.
auto size() const noexcept -> size_t
Get the number of elements in the dataset.
auto cend() const noexcept -> const_iterator
Get const iterator past the last element.
auto validate_private_tags() const -> std::vector< dicom_tag >
Validate private tag relationships in this dataset.
auto get_numeric(dicom_tag tag) const -> std::optional< T >
Get the numeric value of an element.
auto get_sequence(dicom_tag tag) const noexcept -> const std::vector< dicom_dataset > *
auto end() noexcept -> iterator
Get iterator past the last element.
auto cbegin() const noexcept -> const_iterator
Get const iterator to the first element.
void clear() noexcept
Remove all elements from the dataset.
auto begin() noexcept -> iterator
Get iterator to the first element.
void merge(const dicom_dataset &other)
Merge elements from another dataset.
auto copy_with_tags(std::initializer_list< dicom_tag > tags) const -> dicom_dataset
Create a copy containing only the specified tags.
void set_string(dicom_tag tag, encoding::vr_type vr, std::string_view value)
Set a string value for the given tag.
auto get_private_block(std::string_view creator_id, uint16_t group) const -> std::vector< const dicom_element * >
Get all private data elements belonging to a specific creator.
auto get_or_create_sequence(dicom_tag tag) -> std::vector< dicom_dataset > &
Insert or create a sequence element with the given tag.
auto contains(dicom_tag tag) const noexcept -> bool
Check if the dataset contains an element with the given tag.
storage_type::const_iterator const_iterator
Const iterator type.
auto remove_private_block(std::string_view creator_id, uint16_t group) -> size_t
Remove all private data elements and their creator for a given creator.
auto get_string(dicom_tag tag, std::string_view default_value="") const -> std::string
Get the string value of an element.
auto get_private_creator(dicom_tag private_data_tag) const -> std::optional< std::string >
Get the Private Creator identification string for a private data element.
static auto from_numeric(dicom_tag tag, encoding::vr_type vr, T value) -> dicom_element
Create an element from a numeric value.
DICOM Data Element representation (Tag, VR, Value)
DICOM Tag representation (Group, Element pairs)
vr_type
DICOM Value Representation (VR) types.