Skip to content

Revise DicomObject abstraction#524

Merged
Enet4 merged 24 commits intomasterfrom
change/object/dicom-object-revision-gats
Oct 2, 2025
Merged

Revise DicomObject abstraction#524
Enet4 merged 24 commits intomasterfrom
change/object/dicom-object-revision-gats

Conversation

@Enet4
Copy link
Copy Markdown
Owner

@Enet4 Enet4 commented Jun 23, 2024

Context

A new iteration of the trait-based DICOM object abstraction, which may help uniformize DICOM object handling regardless of the underlying implementation.

Summary

  • [object] Redesign DicomObject trait
  • [core] Add Value::shallow_clone
  • [object] Redesign DicomObject trait

Known caveats

  • Methods get are nice and short, but they conflict with InMemDicomObject::get and do not work the same way. I might need to rename them again. Renamed them to attr.
  • Does not yet support retrieval of private data elements

@Enet4 Enet4 added enhancement A-lib Area: library C-object Crate: dicom-object breaking change Hint that this may require a major version bump on release labels Jun 23, 2024
@Enet4 Enet4 force-pushed the change/object/dicom-object-revision-gats branch 2 times, most recently from 5236b94 to c757898 Compare June 29, 2024 17:25
@Enet4 Enet4 added this to the DICOM-rs 0.8 milestone Jul 25, 2024
@Enet4 Enet4 force-pushed the change/object/dicom-object-revision-gats branch from eae2801 to e044a47 Compare November 2, 2024 12:16
@Enet4 Enet4 removed this from the DICOM-rs 0.8 milestone Nov 2, 2024
@Enet4 Enet4 mentioned this pull request Dec 7, 2024
@Enet4 Enet4 force-pushed the change/object/dicom-object-revision-gats branch 2 times, most recently from 405045d to 0a8ccdc Compare December 7, 2024 13:29
@Enet4 Enet4 force-pushed the change/object/dicom-object-revision-gats branch from 0a8ccdc to 398a44b Compare February 15, 2025 14:45
@Enet4 Enet4 added this to the DICOM-rs 0.9 milestone Feb 21, 2025
@Enet4 Enet4 force-pushed the change/object/dicom-object-revision-gats branch from 398a44b to a016243 Compare May 17, 2025 08:40
@Enet4 Enet4 force-pushed the change/object/dicom-object-revision-gats branch from 9bd98b7 to e462f62 Compare June 6, 2025 07:31
@Enet4 Enet4 marked this pull request as ready for review June 8, 2025 08:12
@Enet4 Enet4 force-pushed the change/object/dicom-object-revision-gats branch 2 times, most recently from cf57cb2 to 451489d Compare July 27, 2025 12:30
@Enet4 Enet4 mentioned this pull request Aug 6, 2025
@Enet4 Enet4 force-pushed the change/object/dicom-object-revision-gats branch from 451489d to ef552a4 Compare September 13, 2025 18:40
Enet4 added 6 commits October 2, 2025 00:14
- use GAT on Element type
- add element_opt and element_by_name_opt
- 1-level deep copy of a DICOM value
- add DicomAttributeValue trait,
  use it as output of most methods in DicomObject
- rename methods and add new ones in DicomObject
   - use GATs for the attribute value, item and pixel data types
- reimplement DicomObject
- provide access to items and pixel data fragments
- require DicomAttributeValue to impl DicomValueType
- add a few tests
- rename from DicomAttributeValue
- add `to_i32` and `to_u16`
- instead, meta attributes can be retrieved
  like any other attribute
Enet4 added 16 commits October 2, 2025 00:14
- replace `to_dicom_value` with `to_primitive_value`
   - simplifies implementations
   and requires consumers to
   depend on other methods
   when working with sequences
- remove method `meta`
   - treat meta information attributes like any other attribute,
   retrievable through the same methods
- [core] add either crate
- impl many DICOM traits to `either::Either`
- implement DicomObject for FileMetaTable
- reimplement DICOM traits for FileDicomObject
  so that users can retrieve
  either meta info or main data set info
- elide lifetime
- fix formatting of doc comments
- elide lifetime parameter in impl DicomAttribute for FileMetaAttribute
- add methods `split_first` and `len`
- fix a few doc comments
- add associated type `LeafAttribute<'_>`
   - opens the possibility of the attribute type being different when doing a deeper look-up
- add method `DicomObject::at`
- extend documentation to advise when to use `DicomObject
- fix impl of DicomObject for &FileDicomObject<O>
  -  it was not consulting like the non-ref counterpart
- rename AttributeSelector::len to AttributeSelector::num_steps,
  since semantics are sufficiently different
  (is_empty would have been meaningless)
- deferefence first step instead of cloning it
- remove needless borrow
- show ellided lifetime in Cow
@Enet4 Enet4 force-pushed the change/object/dicom-object-revision-gats branch from 53d160e to 704056e Compare October 1, 2025 23:14
Enet4 added 2 commits October 2, 2025 00:17
- fix a few minor mistakes and repetitions
- use `attr` instead of `get`
  so that they do not collide with other methods
@Enet4 Enet4 merged commit 7391189 into master Oct 2, 2025
5 checks passed
@Enet4 Enet4 deleted the change/object/dicom-object-revision-gats branch October 2, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lib Area: library breaking change Hint that this may require a major version bump on release C-object Crate: dicom-object enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant