Skip to content

fix(dicom): keep series with same orientation separate#874

Merged
PaulHax merged 1 commit intoKitware:mainfrom
PaulHax:issue-861-repro
May 8, 2026
Merged

fix(dicom): keep series with same orientation separate#874
PaulHax merged 1 commit intoKitware:mainfrom
PaulHax:issue-861-repro

Conversation

@PaulHax
Copy link
Copy Markdown
Collaborator

@PaulHax PaulHax commented May 8, 2026

Summary

  • SeparateOnImageOrientation shared cosinesToID across input volumes, so two series with the same ImageOrientationPatient collapsed into one.
  • areCosinesAlmostEqual walked the wrong indices for the Y cosine row and ignored its epsilon parameter; both fixed.
  • New e2e test generates two synthetic DICOM series with identical IOP and asserts two volume cards.

Closes #861.

Test plan

  • npx wdio run ./wdio.chrome.conf.ts --spec tests/specs/multi-series-load.e2e.ts — passes (4 s)
  • Sparse/remote manifest, layers-and-rendering, automatic-layering, different-direction-labelmap specs — pass

@netlify
Copy link
Copy Markdown

netlify Bot commented May 8, 2026

Deploy Preview for volview-dev ready!

Name Link
🔨 Latest commit 5dda28b
🔍 Latest deploy log https://app.netlify.com/projects/volview-dev/deploys/69fe37865e41e200083f8c34
😎 Deploy Preview https://deploy-preview-874--volview-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

SeparateOnImageOrientation kept a single cosinesToID lookup across all
input volumes. When two series shared an ImageOrientationPatient (e.g.
T1 MP-RAGE and a sagittal T2 CUBE acquired in the same session) the
second volume's files were reassigned to the first volume's bucket,
collapsing them into one scan. Scope cosinesToID per input volume so
the orientation-based split only happens within a series.

Also fixes the Y-cosine row indexing in areCosinesAlmostEqual: the
second loop iteration walked indices 1,2,3 — a sliding window
straddling the X and Y rows — instead of 3,4,5, the actual Y cosine
row. For axial IOP [1,0,0,0,1,0] this happened to dot to 0 and made
same-orientation volumes look mismatched, which masked the cosinesToID
leak for axial acquisitions. With the leak fixed the windowed
comparison no longer affects outputs, but it's still wrong. While
there, honor the epsilon argument instead of always using the EPSILON
constant.

Adds an e2e regression test that synthesizes two minimal DICOM series
with distinct SeriesInstanceUIDs and identical oblique IOP, loads them
through two manifest URLs, and asserts two volume cards.

Closes Kitware#861.
@PaulHax PaulHax force-pushed the issue-861-repro branch from 30b2240 to 5dda28b Compare May 8, 2026 19:20
@PaulHax PaulHax added this pull request to the merge queue May 8, 2026
Merged via the queue into Kitware:main with commit 5d96ae9 May 8, 2026
8 checks passed
@PaulHax PaulHax deleted the issue-861-repro branch May 8, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loading multiple directories from manifest.js

1 participant