fix(nifti): pass through DICOM metadata for NIfTI-backed display sets#5970
Open
nutzlastfan wants to merge 3 commits into
Open
fix(nifti): pass through DICOM metadata for NIfTI-backed display sets#5970nutzlastfan wants to merge 3 commits into
nutzlastfan wants to merge 3 commits into
Conversation
✅ Deploy Preview for ohif-dev canceled.
|
Author
|
Tracked down the regression from downstream testing: the NIfTI datasource config was being resolved once at module initialization time. In our deployed app that could leave |
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
This is a small preparatory upstream PR for a downstream NIfTI workflow.
In the downstream integration, a NIfTI-backed display set can carry DICOM-derived metadata that should be preserved for VOI / series registration instead of falling back to generic defaults.
Changes
@cornerstonejs/nifti-volume-loaderto the default extension packageImportant Note
This PR is intentionally opened as a draft because the effect depends on paired loader-side support in Cornerstone3D /
@cornerstonejs/nifti-volume-loader.Today, upstream OHIF does not yet have a full built-in NIfTI path in this area, so this branch is best viewed as a minimal handoff hook for discussion rather than as a complete end-user feature.
Why Open It Anyway
The downstream fix request specifically needs an upstream anchor in
OHIF/Viewers, but I want to be explicit that the real behavior change also needs the corresponding Cornerstone3D-side implementation and review.Verification
Code-level port only in this environment. I could not run the full local test / build toolchain from this checkout.
Greptile Summary
This preparatory draft PR adds a NIfTI pass-through hook to the default extension's SOP-class handler: when a data source exposes a
niftiPrivateTagNameconfig, the resolved NIfTI URL and associated DICOM metadata are attached to the display set as a lazyloadImageIdscallback. The dynamic import and re-thrown errors reflect improvements from prior review rounds; the full behavior still depends on paired loader-side support in@cornerstonejs/nifti-volume-loader.Confidence Score: 4/5
Safe to iterate on as a draft; one minor correctness nit around
isReconstructableshould be addressed before promoting to a non-draft.All prior P1 concerns have been resolved (dynamic import, error propagation, config read from active data source). The one remaining finding is a P2 edge case where an empty NIfTI result incorrectly leaves
isReconstructable: true.extensions/default/src/getSopClassHandlerModule.js — specifically the
isReconstructableassignment insideloadImageIds.Important Files Changed
loadImageIdscallback; previous P1 concerns (static import, silent errors, stale config) are all addressed in this version. One remaining minor issue:isReconstructableis forced totrueeven when the loader returns an empty image-ID array.@cornerstonejs/nifti-volume-loaderat 4.21.7 as a hard dependency; version is consistent with other Cornerstone packages in the project and the package is already tracked bycs3d-set-version.mjs.Prompt To Fix All With AI
Reviews (3): Last reviewed commit: "fix(nifti): resolve datasource config at..." | Re-trigger Greptile