ohif-viewer/extensions/cornerstone/src/utils
Bill Wallace dbb8b1526e
feat: Add support for labelmap seg images in any supported tsuid (also for compressed bitmap) (#5806)
* feat: Update to use pnpm (#6031) [simulated squash-merge]

* feat: load DICOM SEG images via imageLoader

* feat: load DICOM SEG images via imageLoader

* PR review fixes

* Test fragment of compressed multiframes

* fix: Removed dependencies incorrectly

* Update frame as a targetted change to avoid stripping remaining params

* lock

* Update test to agree with the missing representation branch

* test(contour): contour color change coverage (#6042)

* test(contour): contour interactions delete segment (#6069)

---------

Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>

* chore(version): Update package versions to 3.13.0-beta.98 [skip ci]

* feat(testing): OHIF Test Agent Skills (#5993)

* chore(version): Update package versions to 3.13.0-beta.99 [skip ci]

* test(contour): Add the ContourSegmentToggleLock.spec.ts test file to test contour locking (#6072)

* chore(version): Update package versions to 3.13.0-beta.100 [skip ci]

* chore(testing): Flock lock for playwright tests; Pin node version for OHIF; add more workers (#6099)

* update Cypress apt deps for Ubuntu Noble (drop libgconf-2-4, libasound2→libasound2t64)

* chore(version): Update package versions to 3.13.0-beta.101 [skip ci]

* Debug fixes

* perf(seg): pass explicit frame decode concurrency (16) to SEG loader

Pass an explicit concurrency value (SEG_FRAME_DECODE_CONCURRENCY = 16) into
createFromDicomSegImageId rather than relying on the adapter default, so the
SEG frame fetch/decode parallelism is set at the call site and is ready to
become configurable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(behaviours): add behaviours section + multiframe Part 10 prefetch proposal

Start a "Behaviours" docs section for documenting how the system and UI behave
end-to-end (observed behaviours, design proposals, and failure modes), with an
index README and a Docusaurus category.

First entry is the proposal for loading a multiframe SEG as a single Part 10
instance: prefetch the whole instance (gated by loadMultiframeAsPart10RaceTimeMs),
parse it with dcmjs (handling multipart/related vs raw DICOM), and register the
per-frame compressed pixels into the Cornerstone3D core image cache (the single
uniform frame registry) so the per-frame load path is served locally while the
standard decode path is unchanged. Best-effort: falls back to per-frame fetches
on any failure.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Pre-cache the image data using a full part10 file for performance

* Add customizations to specify type of segmentation save

* Add clearcache of the cacheData

* Bump @cornerstonejs/* pins 5.1.3 -> 5.4.10 to match libs/@cornerstonejs base

libs/@cornerstonejs (fix/use-imageLoader-for-seg) is based on the released
cs3d 5.4.10 (merge-base with origin/main is the 5.4.10 version bump), so pin
OHIF to that release. The local branch changes still reach the app via the
cs3d:link symlinks; these pins keep the lockfile/npm fallback aligned.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fix seg OOM

* fix: file meta garbage element, bogus NumberOfFrames, unguarded source-map-loader

- dicomWriter: drop the naturalized meta.TransferSyntaxUID assignment that
  dcmjs wrote as a garbage (0000,0000) element into every saved file's meta
  group (download / clipboard / local wadouri blob / local store); keep the
  hex 00020010 assignment, which is required for string-form _meta fallbacks.
- registerNaturalizedDatasetForLocalWadouri: keep the computed frame count
  local so single-frame IODs (SR, RTSTRUCT) no longer gain a bogus
  NumberOfFrames element in their serialized form.
- rsbuild.config: resolve source-map-loader opportunistically (it is not a
  project dependency; the rule only serves the gitignored cs3d-link
  workflow) so fresh clones no longer crash at config load.
- Regression tests for both writer fixes (mutation-checked).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* PR review comment fixes

* Update versions

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: diattamo <mmddiatta@gmail.com>
Co-authored-by: ohif-bot <danny.ri.brown+ohif-bot@gmail.com>
Co-authored-by: Joe Boccanfuso <109477394+jbocce@users.noreply.github.com>
2026-07-09 20:54:23 -04:00
..
imageSliceSync feat(typings): Enhance typing support with withAppTypes and custom services throughout OHIF (#4090) 2024-05-08 12:12:49 -04:00
measurementServiceMappings fix(measurements): read displayName in SplineROI and PlanarFreehandROI reports (#5908) 2026-05-19 15:28:05 -04:00
mpr feat: state sync service and hanging protocol updates to preserve state (#3131) 2023-03-15 12:41:41 -04:00
presentations feat(data overlay): add foreground background control plus orientation change in the UI and add RTDOSE support (#5007) 2025-05-05 16:35:05 -04:00
ActiveViewportBehavior.tsx fix(core): Address 3D reconstruction and Android compatibility issues and clean up 4D data mode (#4762) 2025-02-04 12:25:10 -05:00
colormaps.js feat(data overlay): add foreground background control plus orientation change in the UI and add RTDOSE support (#5007) 2025-05-05 16:35:05 -04:00
CornerstoneViewportDownloadForm.tsx fix: ohif tests to run with cornerstone 3d 5.0 (#6043) 2026-06-09 20:25:14 -04:00
createSegmentationForViewport.ts fix: ohif tests to run with cornerstone 3d 5.0 (#6043) 2026-06-09 20:25:14 -04:00
DicomFileUploader.ts chore(prettier): full repo linting and code reformatting once and for all (#3627) 2023-09-01 16:19:39 -04:00
dicomLoaderService.js fix: prevent failure in DICOM loader for wadouri type (#5260) 2025-07-25 09:41:53 -04:00
ecgMetadata.test.ts feat(ecg): add DICOM ECG waveform extension (#5856) 2026-03-05 12:56:52 -05:00
ecgMetadata.ts feat(ecg): add DICOM ECG waveform extension (#5856) 2026-03-05 12:56:52 -05:00
findNearbyToolData.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
findNearbyToolData.ts feat(cst): Add new command to get nearby annotation tools (#3327) 2023-04-28 10:14:14 -04:00
generateSegmentationCSVReport.test.ts fix: ohif tests to run with cornerstone 3d 5.0 (#6043) 2026-06-09 20:25:14 -04:00
generateSegmentationCSVReport.ts Fix contour annotations RTSS saving (#5545) 2025-11-21 13:07:26 -05:00
getActiveViewportEnabledElement.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
getActiveViewportEnabledElement.ts feat(commandsModule): Enhanced flipViewport and rotateViewport commands (#5065) 2025-06-11 08:59:37 -04:00
getCenterExtent.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
getCenterExtent.ts feat: Jump to measurement moves the camera if it is not in the viewport (#5023) 2025-08-22 10:30:18 -04:00
getCornerstoneBlendMode.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
getCornerstoneBlendMode.ts fix(vewport): Add missing blendmodes from cornerstonejs (#4055) 2024-04-22 14:33:52 -04:00
getCornerstoneOrientation.test.ts Reformat in HP MPR (#5717) 2026-04-14 13:56:20 -04:00
getCornerstoneOrientation.ts Reformat in HP MPR (#5717) 2026-04-14 13:56:20 -04:00
getCornerstoneViewportType.test.ts feat(ecg): add DICOM ECG waveform extension (#5856) 2026-03-05 12:56:52 -05:00
getCornerstoneViewportType.ts feat(ecg): add DICOM ECG waveform extension (#5856) 2026-03-05 12:56:52 -05:00
getDataIdForViewport.ts fix(window level): The window level value is not displayed by default on all the viewports when selecting common/custom layout and TMTV. (#5865) 2026-03-13 10:12:07 -04:00
getInterleavedFrames.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
getInterleavedFrames.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
getLegacyViewportType.ts fix: ohif tests to run with cornerstone 3d 5.0 (#6043) 2026-06-09 20:25:14 -04:00
getNthFrames.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
getNthFrames.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
getViewportEnabledElement.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
getViewportEnabledElement.ts feat(commandsModule): Enhanced flipViewport and rotateViewport commands (#5065) 2025-06-11 08:59:37 -04:00
getViewportOrientationFromImageOrientationPatient.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
getViewportOrientationFromImageOrientationPatient.ts OHIF with Cornerstone3D 2.0 (#4347) 2024-11-06 07:15:27 -05:00
hydrationUtils.test.ts fix(seg): prevent segmentations from spreading to all viewports before hydration confirmation in 3D four-up (#5967) 2026-04-27 12:55:12 -04:00
hydrationUtils.ts fix(seg): prevent viewport orientation change when loading SEG in manual grid layout (#6021) 2026-05-19 15:59:42 -04:00
index.ts feature(segmentation): Add contour tools and utilities in a side panel (#5517) 2025-10-29 14:15:52 -04:00
initViewTiming.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
initViewTiming.ts fix(demo): Deploy issue (#3951) 2024-02-22 14:42:46 -05:00
initWebWorkerProgressHandler.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
initWebWorkerProgressHandler.ts chore: recovery 2 (#5014) merge to 3.11 (#5175) 2025-07-03 14:08:46 -04:00
interleave.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
interleave.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
interleaveCenterLoader.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
interleaveCenterLoader.ts fix(3DSegmentation): [Bug] The viewports become blank when loading the seg file in advanced layout after closing the seg file from any other advanced layout (#5505) 2025-10-28 08:52:12 -04:00
interleaveTopToBottom.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
interleaveTopToBottom.ts fix(3DSegmentation): [Bug] The viewports become blank when loading the seg file in advanced layout after closing the seg file from any other advanced layout (#5505) 2025-10-28 08:52:12 -04:00
isAnyDisplaySetCommon.ts fix: seg sync for data without FOR (#5565) 2025-12-15 08:49:43 -05:00
isMeasurementWithinViewport.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
isMeasurementWithinViewport.ts feat: Jump to measurement moves the camera if it is not in the viewport (#5023) 2025-08-22 10:30:18 -04:00
isReferenceViewable.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
isReferenceViewable.ts feat: add support to scoord3d (#5016) 2025-07-31 00:21:26 -04:00
JumpPresets.ts feat: cornerstone3D stack and volume viewports (#2787) 2022-07-27 12:39:04 -04:00
nthLoader.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
nthLoader.ts fix(segmentation): Changes to fix problems with non hydrated/loaded segmentations to be viewable when switching hanging protocols (e.g. MPR) (#5139) 2025-06-27 07:11:46 -04:00
promptHydrationDialog.test.ts chore(refactor): use public appConfig getter instead of private _appConfig field (#5923) 2026-03-27 13:14:13 -04:00
promptHydrationDialog.ts chore(refactor): use public appConfig getter instead of private _appConfig field (#5923) 2026-03-27 13:14:13 -04:00
removeViewportSegmentationRepresentations.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
removeViewportSegmentationRepresentations.ts OHIF with Cornerstone3D 2.0 (#4347) 2024-11-06 07:15:27 -05:00
segmentationExportUtils.ts Fix contour annotations RTSS saving (#5545) 2025-11-21 13:07:26 -05:00
segmentationHandlers.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
segmentationHandlers.ts feat: Add support for labelmap seg images in any supported tsuid (also for compressed bitmap) (#5806) 2026-07-09 20:54:23 -04:00
segmentUtils.test.ts fix(jump-to-label-map): Use undefined for viewportId for arrow navigation. (#5774) 2026-02-04 16:12:41 -05:00
segmentUtils.ts fix(jump-to-label-map): Use undefined for viewportId for arrow navigation. (#5774) 2026-02-04 16:12:41 -05:00
setUpAnnotationEventHandlers.ts fix(interpolation): Auto accept interpolation when the interpolation process is completed. (#5555) 2025-11-11 08:19:45 -05:00
setUpSegmentationEventHandlers.test.ts fix(segmentation overlay): update viewport ds list upon seg delete - OHIF-2425 (#5729) 2026-02-18 20:31:43 -05:00
setUpSegmentationEventHandlers.ts fix(segmentation overlay): update viewport ds list upon seg delete - OHIF-2425 (#5729) 2026-02-18 20:31:43 -05:00
toggleVOISliceSync.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
toggleVOISliceSync.ts fix: skip VOI sync for empty viewports (#5599) 2025-12-03 15:36:30 -05:00
transitions.test.ts fix(3DSegmentation): [Bug] The viewports become blank when loading the seg file in advanced layout after closing the seg file from any other advanced layout (#5505) 2025-10-28 08:52:12 -04:00
transitions.ts feat(Segmentation): Segmentation highlight animation function selection (#5401) 2025-09-21 22:48:35 -04:00
updateSegmentationStats.test.ts test(CornerstoneUtils): Adding unit tests for most of Cornerstone Extension utilities (#5454) 2025-10-07 11:42:47 -04:00
updateSegmentationStats.ts fix(HistoryMemo): Segmentation delete wasn't remembered (#5775) 2026-02-05 11:49:49 -05:00