Enet4 / dicom-rs

Rust implementation of the DICOM standard
https://dicom-rs.github.io
Apache License 2.0
402 stars 75 forks source link

Enhance attribute operations to support sequential attribute selectors #383

Closed Enet4 closed 1 year ago

Enet4 commented 1 year ago

This extends the attribute operations API (dicom_core::ops) so that operation descriptors specify a full attribute selector instead of just a tag. This enables the consumer to specify any attribute at an arbitrary depth (even within nested data sets).

For example:

obj.apply(AttributeOp::new(
    (
        // navigate to Sequence of Ultrasound Regions
        tags::SEQUENCE_OF_ULTRASOUND_REGIONS,
        // enter the first item
        0,
        // select Region Spatial Format
        Tag(0x0018, 0x6012)
    ),
    AttributeAction::Remove),
)?;

Parsing from text is also supported:

let selector: AttributeSelector = StandardDataDictionary.parse_selector(
    "SequenceOfUltrasoundRegions[0].(0018,6012)"
).unwrap();

Summary