v2.2.5 — DICOMDIR navigation offsets (cross-reader interop)
·
63 commits
to main
since this release
DICOMDIRWriter now computes the DICOMDIR navigation offsets it previously left as 0, so file-sets it writes are navigable by strict offset-following readers (pydicom FileSet, dcmtk), not only DICOMKit's own offset-tolerant reader.
- Computes Offset of the First/Last Directory Record (0004,1200/1202) and each record's Offset of Next Directory Record (0004,1400) / Offset of Referenced Lower-Level Directory Entity (0004,1420) — absolute file offsets to each record's
(FFFE,E000)item tag (PS3.3 F.3.2.2). - Two-pass encode: measure item byte positions with zero offsets, then re-encode with the real values (each a fixed 4-byte UL → byte-identical layout). File meta is generated once and reused across both passes (its fresh SOP Instance UID length would otherwise shift item positions).
- Verified against
pydicom.fileset.FileSet(previouslyKeyError; now reads a DICOMKit multi-series DICOMDIR) + a self-contained byte-offset oracle.
Fixes the interoperability limitation noted for DICOMDIR media export.