dicom-rs
dicom-rs copied to clipboard
Improve file information table consistency guarantees
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_iterandwritedo not validate the length, but perhaps they should.
- Propose
&mut selfmethods for setting and clearing file meta information properties while doing the necessary adjustments. - Also propose
&selfmethods for retrieving clean values of these properties