Enet4 / dicom-rs

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

Adding private data elements (with creator) #431

Open matthiasg opened 8 months ago

matthiasg commented 8 months ago

Is there any support in handling adding private elements ?

Enet4 commented 8 months ago

At the moment, you can retrieve and insert elements with private tags, but they are treated like any other elements, and the private creator needs to be added or inspected manually. The data element dictionary can also be replaced with a custom implementation, which would enable the recognition of private tags by their alias at run-time.

With some work in this direction (and maybe some feedback on people's expectations when working with private elements), the ecosystem could support a more streamlined experience when working with these.

matthiasg commented 8 months ago

Thanks for the quick feedback.

naterichman commented 2 months ago

@Enet4 I'm interested in picking this up. Mostly for looking up private tags with a group, creator, and element mask, i.e.

If there was:

(0x0009, 0x0010)    LO     "MY CREATOR"
(0x0009, 0x1001)    SH     "My value"    

you could look it up like dcm.private_element(0x0009, "MY CREATOR", 0x01). And similarly something for adding a private element creating/reserving a block if necessary:

dcm.put_private_element(
    0x0009,
    "MY CREATOR",
    0x01,
    VR.SH, 
    Value::Primitive(
        PrimitiveValue::from("My Value".to_string())
    )
)

Just looking for your thoughts on design. LMK!

Enet4 commented 2 months ago

Thank you for the initiative, @naterichman! From what I know about private data elements, that API seems to go in the right direction, at least for the in-memory object implementation.

I've been thinking about how we would also incorporate this capability onto the Operations API (the attribute selectors only recognize tags and not private groups), and I would appreciate having more people thinking about this.

naterichman commented 1 month ago

@matthiasg Getting back to this if you have a chance to test this out with 0.7.0 and have feedback on the interface, let me know!