fix(MetadataProvider): Correctly assign imageId for multiframe images and remove unused frame information retrieval method#5965
Open
sedghi wants to merge 3 commits into
Open
fix(MetadataProvider): Correctly assign imageId for multiframe images and remove unused frame information retrieval method#5965sedghi wants to merge 3 commits into
sedghi wants to merge 3 commits into
Conversation
… and remove unused frame information retrieval method
✅ Deploy Preview for ohif-dev canceled.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the core metadata plumbing to better handle multiframe DICOM imageIds and simplifies frame-number handling by removing a URL-based frame parsing helper.
Changes:
- Reassign
imageIdon the returned instance fromMetadataProvider._getInstanceto avoid incorrectimageIdon combined multiframe frame instances. - Remove
getFrameInformationFromURLand switch frame derivation to rely on ingested UID mappings. - Expose the internal DICOM metadata store model on
window(new global side effect).
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| platform/core/src/services/DicomMetadataStore/DicomMetadataStore.ts | Adds a global window._model assignment (debug exposure) at module end. |
| platform/core/src/classes/MetadataProvider.ts | Adjusts multiframe instance handling and changes frameNumber derivation / removes URL frame parsing method. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Viewers
|
||||||||||||||||||||||||||||
| Project |
Viewers
|
| Branch Review |
fix/multiframe
|
| Run status |
|
| Run duration | 02m 35s |
| Commit |
|
| Committer | Alireza |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
37
|
| View all changes introduced in this branch ↗︎ | |
… when processing imageURI
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.
Context
add a console log after
const { PixelSpacing, type } = getPixelSpacingInformation(instance) || {};
in metadataprovider
see imageId in multiframe case is wrong even if you scroll always show the first one
try this case
https://viewer-dev.ohif.org/viewer?StudyInstanceUIDs=1.2.276.0.7230010.3.1.2.2723277605.10168.1676054414.178
Changes & Results
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Greptile Summary
This PR fixes a bug where all frames of a multiframe DICOM image always reported the first frame's
imageId. The root cause is thatDicomMetadataStorekeeps only one instance per SOPInstanceUID;combineFrameInstancereturns a new per-frame object but that object inheritsimageIdfrom the parent, which always pointed to frame 1. The fix explicitly stampsresult.imageId = imageIdaftercombineFrameInstancereturns. It also removes thegetFrameInformationFromURLhelper (no external callers remain) and replaces URL-scraping with readinguids.frameNumberstored at ingestion time, while adding an explicit null-guard that was missing in the previous code.Confidence Score: 5/5
Safe to merge — the fix is narrowly scoped, no regressions found across all existing data source call sites
No P0/P1 issues found. The imageId stamp is correct: for multiframe images combineFrameInstance returns a new per-frame Object.create() object so only that frame-specific cached instance is mutated, never the shared DicomMetadataStore instance. The new uids.frameNumber fallback is equivalent to the old URL-scraping for every current data source. The removed getFrameInformationFromURL has zero callers remaining in the repo.
No files require special attention
Important Files Changed
Comments Outside Diff (1)
platform/core/src/services/DicomMetadataStore/DicomMetadataStore.ts, line 323 (link)window._model=_modelis leftover debug code that leaks the internal_modelobject (which holds the full DICOM studies/series/instances tree) onto the globalwindowobject. This bypasses encapsulation, is a TypeScript type error (no semicolon, implicitanyonwindow), and must not ship.Reviews (3): Last reviewed commit: "fix(MetadataProvider): Add check for und..." | Re-trigger Greptile