Skip to content

chore: update to OHIF 3.13.12 - #140

Merged
igoroctaviano merged 335 commits into
masterfrom
chore/update-to-ohif-3.13.0
Oct 4, 2026
Merged

igoroctaviano merged 335 commits into
masterfrom
chore/update-to-ohif-3.13.0

Conversation

@igoroctaviano

@igoroctaviano igoroctaviano commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Update ViewersV3 to OHIF Viewers v3.13.10 (from v3.12.14).

Addresses #83 (Standing: update IDC OHIF v3 from upstream)

Version Selection

  • v3.13.10 is the latest in the 3.13.x line with all security patches
  • Includes 10 security fixes released after v3.13.0 (adm-zip, browserslist, fast-uri, brace-expansion, postcss, etc.)

Major Changes in OHIF 3.13.x

  • Cornerstone v5 - Complete rendering engine rewrite
  • Smart Scrollbar
  • Study List improvements
  • Theming system updates
  • UI-next component library

Changes in this PR

  • Merge upstream OHIF v3.13.0 + v3.13.10 tags
  • Keep IDC-specific configurations (CircleCI, dependabot, npmrc)
  • Add @cornerstonejs:registry=https://registry.npmjs.org/ to project .npmrc
  • Update IDC dependencies to OHIF 3.13.10 compatible versions

Upstream PRs Opened During Migration

These PRs were contributed upstream during this migration. Once merged and released, related patches/workarounds can be removed.

OHIF/Viewers

PR Status Description Remove When Merged
#6331 🟡 Open fix(MergeDataSource): improve series-to-datasource routing Commits already in this branch
#5987 🟡 Open feat(Mode): Add mode selector Used by gcp-extension

cornerstonejs/cornerstone3D

PR Status Description Remove When Merged
#2882 ✅ Merged fix(adapters): LABELMAP SegmentNumber indexing Remove @cornerstonejs+adapters patch after next CS release

Patches Included

@cornerstonejs/adapters@5.6.8 - LABELMAP SegmentNumber indexing

@cornerstonejs/core@5.6.8 - VOI LUT function validation

  • Issue: "Invalid VOI LUT function" error when loading certain DICOM images
  • Fix: Validate voiLUTFunction in _getVOIRangeForCurrentImage() before passing to getVOIRangeFromWindowLevel()
  • Upstream: PR to be submitted to cornerstonejs/cornerstone3D
  • 🗑️ Remove when: Upstream fix is merged and released

Note: Patches must be applied manually after pnpm install:

patch -p1 < patches/@cornerstonejs+core+5.6.8.patch

Dependencies

This PR requires the following PRs to be merged first:

Once those are merged, update the git references in platform/app/package.json back to #main.

Test plan

  • Merge gcp-extension and gcp-mode PRs first
  • Update package.json references to main branch
  • Verify viewer loads correctly
  • Test segmentation display with LABELMAP SEGs (SegmentNumber=0)
  • Verify GCP mode functionality with ?gcp= query param
  • Test microscopy mode

ohif-bot and others added 30 commits March 12, 2026 22:42
… on all the viewports when selecting common/custom layout and TMTV. (OHIF#5865)

* fix(window level): Set up listener for viewport availability such that the initial window level can be read and displayed.

* PR feedback.

* PR feedback.

---------

Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
…asurements (OHIF#5887)

Joe is away, so approving based on the code having the requested change, and otherwise looking good/passing tests.

* fix(sr-hydration): enable hydration and arrows navigation for 3D SR measurements

* test: add automated test for SR measurement navigation with arrows after hydration

* add cross-study warning in the 3D branch

* test: address reviewer feedback for the test

* fix: support 3D and 2D annotations for SR hydration

* test: improve navigation to first image

---------

Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
* Add combined build

* Link script location update

* Security and validation fixes

* Allow specifying target path in PR description

* fix: Version match

* Fix build detection issue

* fix: Playwright deploy

* Separate out the branch merge guard

* Update docs and link info

* test: Update the layout change to wait for network idle

* Move audit late so the rest of the build can be worked on

* Add text with network check to ensure we see this change is updated

* Attempt to fix the mpr loading on ohif-downstream

* PR review comments

* Update docs

* Update to CS3D 4.20.0

* PR comments

* Add log on ohif-integration builds

* Update build test

* Removed unused space to kickoff build
* fix(SR): Added support for spline and live wire SR items.

* Apply suggestion from @greptile-apps[bot]

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Add a script to checkout a worktree for test builds

* fix: Allow download for testing sr validator

* Remove script that wasn't intended to be included

* Bump CS3D version.

* PR comments - simplify code and use single codepath for download

* Allow both download and save buttons for SEG and RTSTRUCT

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
…f reference as viewport background display set (OHIF#5900)

- Add FrameOfReferenceUID to SEG and RTSTRUCT displaySet in SOP Class Handlers so the FOR is available for filtering
- Sync optimisticOverlayDisplaySets when background display set changes so the overlay menu reflects the correct state after a background switch
- Add FOR matching guard to the hydrate segmentation synchronizer to prevent the hydration synchronizer from blindly mirroring segmentations from a source viewport to a target viewport if their primary Frames of Reference do not align.
- fix segmentation overlay order reversal on viewport re-render
Co-authored-by: Joe Boccanfuso <joe.boccanfuso@radicalimaging.com>
…or deterministic viewport order (OHIF#5933)

fix: pass sorted display sets to hanging protocol for deterministic viewport order

The `applyHangingProtocol` function already sorts display sets by modality
priority and series number into `sortedDisplaySets`, but the unsorted
`displaySets` array was being passed to `hangingProtocolService.run()`.

This caused non-deterministic viewport ordering across page loads because
`displaySetService.getActiveDisplaySets()` returns display sets in creation
order, which depends on asynchronous network responses.

Made-with: Cursor
- Add GCP Extension to migration status table
- Document the datasource configuration fix (commit 8f79c25)
- Note that PR #6 now includes the datasource compatibility fix
- Add GCP Mode to migration status table
- Document the package.json fixes (Node version, missing peer dep)
- Note that PR #16 now includes the compatibility fixes
- Remove invalid Tailwind classes (w-15 is not standard, text-purple-600
  line-through made no sense for a logo link)
- Use h-[48px] w-auto for proper logo sizing
- Add flex items-center for proper vertical alignment
- Add alt attribute for accessibility
- Fix modesConfiguration to use $set syntax in deploy template
…h RetrieveAETitle

When using the merge data source, instances retrieved via
retrieve.series.metadata were not being tagged with RetrieveAETitle.
This caused getImageIdsForDisplaySet to not know which data source
to use when loading images, especially when query.series.search
was not called first.

Changes:
- Add retrieve.series.metadata to mergeMap with proper tagging
- Tag each instance and its series metadata with the source name
- Fix Promise.allSettled handling to check fulfilled/rejected status
- Add optional chaining for seriesMetadata in callByRetrieveAETitle
… sources

- Add global seriesSourceMap to track which data source each series came from
- Fix retrieve.series.metadata tagFunc to handle {metadata, start} objects
- Improve callByRetrieveAETitle to handle both displaySet and instance args
- Add prefetchInstanceFrames routing for SEG loading
- Fix getImageIdsForInstance to use correct path

This is a local copy of upstream PR OHIF#6331
- Update app config templates with latest settings
- Update migration TODO with completed tasks
- Add local workspace packages for gcp-mode and gcp-extension
- Update lockfile
Adds a patch for @cornerstonejs/core@5.6.8 that fixes "Invalid VOI LUT
function" error when loading certain DICOM images.

The bug occurs in StackViewport._getVOIRangeForCurrentImage() which
passes voiLUTFunction directly to getVOIRangeFromWindowLevel() without
validation. When the image metadata contains an invalid or undefined
voiLUTFunction, the toLowHighRange() function throws an error.

The fix validates voiLUTFunction using the existing _getValidVOILUTFunction()
method before passing it to getVOIRangeFromWindowLevel(), defaulting to
LINEAR for invalid values.

Note: This patch must be applied manually after pnpm install:
  patch -p1 < patches/@cornerstonejs+core+5.6.8.patch
Remove IDC-MERGE-DEBUG console statements that were added during
development/debugging of the merge data source routing fixes.
…evel calls

The initial patch only fixed _getVOIRangeForCurrentImage, but there are
multiple other places in StackViewport.js that call getVOIRangeFromWindowLevel
with unvalidated voiLUTFunction:

- Line 1075: viewport.voi initialization
- Line 1599: _updateToDisplayImageCPU
- Line 1709: _getInitialVOIRange

All these now use _getValidVOILUTFunction to ensure the voiLUTFunction
is valid before passing to getVOIRangeFromWindowLevel, defaulting to
LINEAR for invalid/undefined values.

This fixes the issue where viewports were showing mostly black due to
invalid VOI range calculations.
…HIF#2856

Updated the VOI LUT function validation patch to match the upstream
approach in cornerstone3D PR OHIF#2856. Instead of patching multiple call
sites in StackViewport.js, this validates at the utility level in
windowLevel.js via a new getValidVOILUTFunction() helper.

This approach:
- Centralizes validation in toLowHighRange() itself
- Falls back to LINEAR for invalid/undefined VOI LUT functions
- Logs a warning (once per unique value) for unsupported functions
- Handles string values like 'SIGMOID' mapping to SAMPLED_SIGMOID
- Makes the patch easier to remove once upstream fix is released

Ref: cornerstonejs/cornerstone3D#2856
Added required peer dependencies for @cornerstonejs/ai and
@cornerstonejs/labelmap-interpolation packages:

- onnxruntime-web: ONNX runtime for AI segmentation models
- axios: HTTP client required by itk-wasm
- wasm-feature-detect: WebAssembly feature detection

Also added explicit resolve alias for onnxruntime-web/webgpu subpath
export since rspack doesn't properly resolve package.json exports
for nested subpaths.
Updated @idc/gcp-extension and @idc/gcp-mode from local links to
GitHub refs pointing to merged main branches after PRs were merged:
- ohif-gcp-extension PR #6
- ohif-gcp-mode PR #16
@igoroctaviano
igoroctaviano merged commit 416ba97 into master Oct 4, 2026
2 of 3 checks passed
@fedorov fedorov changed the title chore: update to OHIF 3.13.10 chore: update to OHIF 3.13.12 Oct 5, 2026

This branch was successfully deployed

No deployments
fork-pr-approval — 6c9ac531 Deployed Oct 4, 2026 by igoroctaviano via playwright-tests (24.15.0) #118
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.