fix(dicom-json): handle multiframe image ids#6121
Conversation
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughRefactors the DICOM JSON data source to introduce ChangesDICOM JSON Multiframe ImageId Refactor
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Viewer
participant DicomJSONDataSource
participant getDicomJSONImageIdsForDisplaySet
participant getDicomJSONImageId
participant MetadataProvider
Viewer->>DicomJSONDataSource: getImageIdsForDisplaySet(displaySet)
DicomJSONDataSource->>getDicomJSONImageIdsForDisplaySet: compute imageIds
getDicomJSONImageIdsForDisplaySet->>getDicomJSONImageId: derive imageId per instance/frame
getDicomJSONImageId-->>getDicomJSONImageIdsForDisplaySet: imageId with &frame= appended
getDicomJSONImageIdsForDisplaySet-->>DicomJSONDataSource: imageId array
DicomJSONDataSource->>MetadataProvider: addImageIdToUIDs(imageId)
DicomJSONDataSource-->>Viewer: imageIds for rendering
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Context
Fixes #5674.
DICOM JSON multiframe handling currently conflates two different JSON shapes:
NumberOfFrames > 1SOPInstanceUIDThe issue sample uses the second shape: the series has
NumberOfFrames: 2, but each item inseries.instancesalready points at a specific frame URL. During ingestion, the series-levelNumberOfFrameswas copied onto each instance, so each per-frame entry could be treated as its own multiframe object. Later,getImageIdsForDisplaySetgrouped instances bySOPInstanceUIDand could reuse the first URL for non-multiframe per-frame entries.Changes & Results
NumberOfFramesonto every instance when the JSON already contains multiple frame entries.NumberOfFramesfor the single-instance multiframe case.SOPInstanceUID.&frame=Nonly when a single multiframe instance URL needs expansion and the URL does not already specify a frame.Testing
corepack pnpm install --frozen-lockfilecorepack pnpm exec prettier --check extensions/default/src/DicomJSONDataSource/index.js extensions/default/src/DicomJSONDataSource/index.test.jsgit diff --checkcorepack pnpm exec jest extensions/default/src/DicomJSONDataSource/index.test.js --runInBand --no-coverageThe targeted Jest suite passes with 6 tests. Manual viewer validation against a real reachable XA DICOM object was not performed; the issue attachment uses sample/redacted URLs that are not directly retrievable.
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Summary by CodeRabbit