dicom-rs icon indicating copy to clipboard operation
dicom-rs copied to clipboard

Improve file information table consistency guarantees

Open Enet4 opened this issue 5 years ago • 0 comments

The abstraction FileMetaTable, which contains the processed properties of a DICOM file's meta information group, is defined as a plain data struct. It is easy for a user to construct a table in such a way that always results in a corrupted DICOM file. And once modifying the attributes of an existing this file meta group becomes a feature of the crate, better facilities should be provided to ensure that the file remains consistent.

This issue serves to:

  • Evaluate measures of consistency to be applied to the FileMetaTable, or another type which would take the same responsibilities.
    • Should all modifications be guarded by setters so that the group length is automatically updated? Or should receivers of a file meta object validate the given length and recalculate it only if necessary?
    • The current status is that the methods into_element_iter and write do not validate the length, but perhaps they should.
  • Propose &mut self methods for setting and clearing file meta information properties while doing the necessary adjustments.
  • Also propose &self methods for retrieving clean values of these properties

Enet4 avatar Nov 12 '20 14:11 Enet4