Repository navigation
Handle cross-study source references correctly - #560
Merged
Merged
Conversation
The Common Instance Reference module put every referenced instance into the Referenced Series Sequence, whose items implicitly belong to the study of the created object. Source images from a different study were therefore misfiled: consumers resolving references hierarchically looked for their series in the wrong study, and the type 1C condition of the Studies Containing Other Referenced Instances Sequence (PS3.3 C.12.2) was violated. Follow-up to the discussion in #554. SourceImageIndex now records the Study Instance UID of every source dataset, and populateCommonInstanceReference() takes the study of the created object: instances of that study go into the Referenced Series Sequence as before, instances of other studies are filed under their study in the Studies Containing Other Referenced Instances Sequence, grouped by series within. Instances without a Study Instance UID are treated as belonging to the object's study, with a warning. Both the SEG and the PM converter pass their document's study. CommonInstanceReferenceTest gains a derived instance from a foreign study and asserts it appears under its study and nowhere else; the assertion fails when the routing is disabled. Outputs for single-study inputs are unchanged, verified by dcmdump diff against a master build for binary, labelmap, multi-file, geometry-check-off and parametric map conversions; dciodvfy accepts the cross-study output. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Follow-up to the cross-study gap discussed in #554: the Common Instance
Reference module filed every referenced source instance in
ReferencedSeriesSequence, whose items implicitly belong to the study of thecreated object. References to images from another study were therefore
misfiled — hierarchical resolution (PACS prefetch, DICOMweb) looks in the
wrong study — and the type 1C condition of
StudiesContainingOtherReferencedInstancesSequencewas violated.SourceImageIndexnow records the Study Instance UID of every source dataset,and
populateCommonInstanceReference()takes the study of the created object:same-study instances go into
ReferencedSeriesSequenceas before, foreignones are filed under their study in the studies sequence, grouped by series
within. Instances without a Study Instance UID are treated as same-study, with
a warning. Both converters pass their document's study; no DCMTK changes
needed.
Out of scope (pre-existing): with mixed-study input, the study of the created
object itself still follows the first input dataset, and the geometric mapping
does not check Frame of Reference UIDs.
Tests:
CommonInstanceReferenceTestderives an in-memory instance with aforeign Study/Series/SOP Instance UID and asserts it is referenced per frame,
absent from
ReferencedSeriesSequence, and filed under exactly its study andseries; the assertion fails with the routing disabled. Single-study outputs
stay identical to a master build; dciodvfy accepts the cross-study output.
Note: this PR and #558 both touch
SourceImageIndex; whichever merges secondgets a small rebase.