fix(wsi): render WSIViewport via setDisplaySets by resolving the registered generic dataset#2774
fix(wsi): render WSIViewport via setDisplaySets by resolving the registered generic dataset#2774jbocce wants to merge 2 commits into
Conversation
…stered generic dataset
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesWSIViewport.setDisplaySets implementation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/core/src/RenderingEngine/WSIViewport.ts`:
- Around line 647-654: The WSIViewport path is bypassing the existing overlay
handling by calling setWSI directly instead of going through setDataIds. Update
the logic around getGenericViewportWSIDataSet and the subsequent call so the
WSIViewportLegacyAdapter flow preserves the stored miniNavigationOverlay
behavior, including the addWSIMiniNavigationOverlayCss() and
miniNavigationOverlay === false handling already implemented in setDataIds. Use
setDataIds as the integration point for the registered dataset/display set flow
rather than skipping straight to setWSI.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f28e2939-2a90-4a25-97da-de0782ae92fd
📒 Files selected for processing (1)
packages/core/src/RenderingEngine/WSIViewport.ts
| * This reads from the same registry as the GenericViewport WSI data provider, | ||
| * so the same caller code drives both the legacy and generic render paths. | ||
| */ | ||
| public async setDisplaySets( |
There was a problem hiding this comment.
This should come with the other set display sets big PR with documentation
|
Will be handled by #2738 |
Context
See OHIF/Viewers#6107
Changes & Results
Summary
Adds a setDisplaySets method to the legacy WSIViewport so whole-slide imaging can be mounted through the display-set API (the direction CS3D is moving
with #2738), instead of requiring callers to use the legacy setDataIds.
What it does
setDisplaySets({ displaySetId }) resolves the WSI dataset (imageIds + webClient) via getGenericViewportWSIDataSet(displaySetId) and renders it through
setWSI. The dataset must first be registered with utilities.genericViewportDataSetMetadataProvider, keyed by displaySetId.
Why
This reads from the same registry the GenericViewport WSI data provider uses, so one caller code path drives both the legacy and generic
(useGenericViewport) render paths. It throws clear errors when called without a displaySetId or with an unregistered dataset.
Scope
Testing
Load and display a WSI study in OHIF
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
System:
OS: Windows 11 10.0.26200
CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
Memory: 8.83 GB / 31.68 GB
Binaries:
Node: 24.15.0 - C:\Users\joebo\AppData\Local\fnm_multishells\50148_1782198425052\node.EXE
Yarn: 1.22.22 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 11.12.1 - C:\Users\joebo\AppData\Local\fnm_multishells\50148_1782198425052\npm.CMD
pnpm: 11.5.2 - C:\Users\joebo\AppData\Local\pnpm\bin\pnpm.CMD
bun: 1.2.23 - C:\Users\joebo.bun\bin\bun.EXE
Browsers:
Chrome: 149.0.7827.115
Edge: Chromium (149.0.4022.80)
Internet Explorer: 11.0.26100.8115
Summary by CodeRabbit
New Features
Bug Fixes