From 96d8cc949133a952123f6ffc9fe75d63f4df57bd Mon Sep 17 00:00:00 2001 From: Alireza Date: Thu, 12 Oct 2023 16:47:54 -0400 Subject: [PATCH 1/5] update docs --- platform/docs/docs/migration-guide.md | 2 +- platform/docs/docs/release-notes.md | 199 +------------------------- platform/docs/docusaurus.config.js | 2 +- 3 files changed, 3 insertions(+), 200 deletions(-) diff --git a/platform/docs/docs/migration-guide.md b/platform/docs/docs/migration-guide.md index fcf45aadd3a..c252d23c899 100644 --- a/platform/docs/docs/migration-guide.md +++ b/platform/docs/docs/migration-guide.md @@ -1,6 +1,6 @@ --- sidebar_position: 10 -sidebar_label: Migration Guide (NEW) +sidebar_label: Migration Guide --- # Migration Guide diff --git a/platform/docs/docs/release-notes.md b/platform/docs/docs/release-notes.md index 146f567b1d6..48491be16db 100644 --- a/platform/docs/docs/release-notes.md +++ b/platform/docs/docs/release-notes.md @@ -6,202 +6,5 @@ sidebar_label: Release Notes # Release Notes -## Current Release (master branch) -### OHIF Viewer v3.6 - Official Version 3 Release (June 2023) - -Check out the complete press announcement [here](https://ohif.org/newsletters/2023-06-08-ohif%20viewer%20v3%20official%20release%20&%20new%20nci%20funding--release). - -- Official OHIF v3 release: An important milestone achieved with OHIF v3 now at feature parity with v2 but with a more extensible and powerful framework. - -New Features: - -- DICOM Radiotherapy Structure Sets: Enhancement of DICOM RTSTRUCT rendering pipeline to better integrate with other segmentation types. -- Slide Microscopy: Slide microscopy code updated with the latest technologies from the DICOM Microscopy Library and SLIM Viewer. -- DICOM Uploader: New feature to easily upload DICOM files directly from the viewer to their PACS systems over DICOMWeb. -- Cornerstone DICOM Image Loader Migrated to TypeScript: Transition to the new TypeScript-based DICOM Image Loader library. -- Cornerstone3D 1.0 Release: Announcement of Cornerstone3D reaching version 1.0, indicating its readiness for production use. - -## Previous V3 Releases (on `v3-stable` branch, before merge to `master`) - -### OHIF Viewer v3.5 - Docker Build - -This update represents a minor release that is primarily focused on enhancing the development environment of the OHIF Viewer. It achieves this by integrating Docker build support, which is essential for streamlining the deployment process and ensuring consistent environments. Additionally, in an effort to optimize the development workflow, this release takes care of pushing changes to the master branch. Furthermore, it strategically splits the master branch from the release branch. This separation is crucial as it allows the developers to work more efficiently on the ongoing developments in the master branch, while simultaneously ensuring that the release branch remains stable and well-maintained. Such an approach underlines the commitment to both innovation and reliability. - - -### OHIF Viewer v3.4 - Segmentation Support (April 2023) -Check out the complete press announcement [here](https://ohif.org/newsletters/2023-04-03-new%20product%20features,%20grant%20updates%20and%20collaborations). - -- New Viewport State Preservation: Enhancements in state synchronization in OHIF Viewer for a seamless experience when switching between Multiplanar Reformatting (MPR) and other views. - -- Enhanced Hanging Protocol Matching: Improved hanging protocols for a faster, more user-friendly experience. - -- Customizable Context Menu: Expansion of context menu options allowing for greater customization and addition of sub-menus. - -- UI/UX Improvements: Revamped viewport header design and the addition of double-click functionality to maximize viewport. - -### OHIF Viewer v3.3 - Segmentation Support (November 2022) - -Check out the complete press announcement [here](https://ohif.org/newsletters/2022-11-21-ohif%20viewer:%20dicom%20segmentation%20support). - -- 3D Segmentation: Segmentations are natively loaded and rendered in 3D. The UI includes various interaction tools and rendering display preferences. Segmentation creation and editing tools are in development. - -- Fast and Optimized Multiplanar Reconstruction (MPR): The viewer now supports MPR visualization of volumes and segmentations, leading to significantly reduced memory footprint and improved performance. - -- New Collapsible Side Panels: The OHIF Viewer has redesigned side panels to be more compact and user friendly. - -- Context-aware Drag and Drop via Hanging Protocols: The viewer now allows a more seamless experience when dragging and dropping thumbnails. - -- New Tools: Two new tools have been added: Reference Lines and Stack Synchronizations. - - - -### OHIF Viewer v3.2 - Mode Gallery & TMTV Mode (August 2022) - -Check out the complete press announcement [here](https://ohif.org/newsletters/2022-08-18-mode%20gallery%20and%20tmtv%20mode). - -- New Total Metabolic Tumor Volume (TMTV) Workflow: This new mode includes high-performance rendering of volumetric data in ten distinct viewports, fusion of two series with adjustable colormaps, synchronization of the viewports for both camera and VOI settings, jump-to-click capability to synchronize navigation in all viewports, and support for exporting results. - -- OHIF Workflow Mode Gallery: This new feature is a one-stop shop for users to find, install, and use OHIF modes and share functionality with the community. The gallery is continuously updated with community-submitted modes. - - -### OHIF Viewer v3.1 - Cornerstone3D Integration (July 2022) - -Check out the complete press announcement [here](https://ohif.org/newsletters/2022-07-28-ohif%20&%20cornerstone3d%20integratione). - -- Cornerstone3D Integration: OHIF v3.1 has deprecated the legacy Cornerstone.js extension and replaced all functionality with Cornerstone3D. This includes updating the Measurement Tracking workflow mode. - -- GPU Accelerated 2D Rendering: The Cornerstone3D rendering engine now supports WebGL 2D textures for large images, increasing the interaction speed significantly compared to the legacy Cornerstone.js engine. - -- Upgraded Hanging Protocol Engine: The OHIF Hanging Protocol Engine has been updated for increased flexibility and ease of writing protocols. This includes the ability to position viewports in any non-grid layout and specify viewport configurations such as colormap, initial VOI, initial image to render, orientation, and more. - - -### OHIF Viewer v3.0 Public Beta Launch (September 2021) - -Check out the complete press announcement [here](https://ohif.org/newsletters/2021-09-14-ohif%20update:%20v3%20public%20beta%20launch--release). - -- UI has been completely redesigned with modularity and workflow modes in mind. -- New UI components have been built with Tailwind CSS -- Addition of workflow modes - - Often, medical imaging use cases involves lots of specific workflows that - reuse functionalities. We have added the capability of workflow modes, that - enable people to customize user interface and configure application for - specific workflow. - - The idea is to reuse the functionalities that extensions provide and create - a workflow. Brain segmentation workflow is different from prostate - segmentation in UI for sure; however, they share the segmentation tools that - can be re-used. - - Our vision is that technical people focus of developing extensions which - provides core functionalities, and experts to build modes by picking the - appropriate functionalities from each extension. - - - - - +You can find the detailed release notes on the OHIF website. Please visit [https://ohif.org/release-notes](https://ohif.org/release-notes) diff --git a/platform/docs/docusaurus.config.js b/platform/docs/docusaurus.config.js index bdcaa205b19..2c3022471e4 100644 --- a/platform/docs/docusaurus.config.js +++ b/platform/docs/docusaurus.config.js @@ -270,7 +270,7 @@ module.exports = { announcementBar: { id: 'healthimaging', content: - '🚀 AWS has announced the general availability of HealthImaging! Easily connect your OHIF to it. Learn more Here!! 🌟', + '🚀 The latest version of OHIF, v3.7, has been released. You can find the release notes by following this Link! 🌟', }, prism: { theme: require('prism-react-renderer/themes/github'), From 1d8af040e0e0334795f0715689a2d05dbb169965 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 6 Nov 2023 22:21:22 -0500 Subject: [PATCH 2/5] feat(hp callbacks: add on viewport initialized hook --- extensions/cornerstone/src/commandsModule.ts | 21 ++++++- extensions/cornerstone/src/init.tsx | 4 +- .../CornerstoneViewportService.ts | 43 ++++++++----- extensions/default/src/commandsModule.ts | 11 ---- .../HangingProtocolService.ts | 18 +++++- .../_shared/pubSubServiceInterface.ts | 2 +- platform/core/src/types/HangingProtocol.ts | 6 +- .../platform/extensions/modules/hpModule.md | 61 +++++++++++++++++++ .../services/data/HangingProtocolService.md | 18 +++--- 9 files changed, 140 insertions(+), 44 deletions(-) diff --git a/extensions/cornerstone/src/commandsModule.ts b/extensions/cornerstone/src/commandsModule.ts index 4c443c243f2..fcee213d8d3 100644 --- a/extensions/cornerstone/src/commandsModule.ts +++ b/extensions/cornerstone/src/commandsModule.ts @@ -580,6 +580,23 @@ function commandsModule({ storePresentation: ({ viewportId }) => { cornerstoneViewportService.storePresentation({ viewportId }); }, + + attachProtocolViewportDataListener: ({ protocol, stageIndex }) => { + const EVENT = cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED; + const command = protocol.callbacks.onViewportDataInitialized; + const numPanes = protocol.stages?.[stageIndex]?.viewports.length; + let numPanesWithData = 0; + cornerstoneViewportService.subscribe(EVENT, evt => { + numPanesWithData++; + + if (numPanesWithData === numPanes) { + commandsManager.run(...command); + + // Unsubscribe from the event + cornerstoneViewportService.unsubscribe(EVENT); + } + }); + }, }; const definitions = { @@ -606,7 +623,6 @@ function commandsModule({ storeContexts: [], options: {}, }, - deleteMeasurement: { commandFn: actions.deleteMeasurement, }, @@ -714,6 +730,9 @@ function commandsModule({ cleanUpCrosshairs: { commandFn: actions.cleanUpCrosshairs, }, + attachProtocolViewportDataListener: { + commandFn: actions.attachProtocolViewportDataListener, + }, }; return { diff --git a/extensions/cornerstone/src/init.tsx b/extensions/cornerstone/src/init.tsx index 99755fa73a5..6879cbab778 100644 --- a/extensions/cornerstone/src/init.tsx +++ b/extensions/cornerstone/src/init.tsx @@ -308,8 +308,8 @@ export default async function init({ viewportGridService.subscribe( viewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED, activeViewportEventListener - ); - } + ); +} function CPUModal() { return ( diff --git a/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts b/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts index 497df2d544d..71b33ffd4fb 100644 --- a/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts +++ b/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts @@ -283,14 +283,21 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi this.viewportsById.set(viewportId, viewportInfo); const viewport = renderingEngine.getViewport(viewportId); - this._setDisplaySets(viewport, viewportData, viewportInfo, presentations); + const displaySetPromise = this._setDisplaySets( + viewport, + viewportData, + viewportInfo, + presentations + ); // The broadcast event here ensures that listeners have a valid, up to date // viewport to access. Doing it too early can result in exceptions or // invalid data. - this._broadcastEvent(this.EVENTS.VIEWPORT_DATA_CHANGED, { - viewportData, - viewportId, + displaySetPromise.then(() => { + this._broadcastEvent(this.EVENTS.VIEWPORT_DATA_CHANGED, { + viewportData, + viewportId, + }); }); } @@ -312,12 +319,12 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi return this.viewportsById.get(viewportId); } - _setStackViewport( + private async _setStackViewport( viewport: Types.IStackViewport, viewportData: StackViewportData, viewportInfo: ViewportInfo, presentations: Presentations - ): void { + ): Promise { const displaySetOptions = viewportInfo.getDisplaySetOptions(); const { imageIds, initialImageIndex, displaySetInstanceUID } = viewportData.data; @@ -347,7 +354,7 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi } } - viewport.setStack(imageIds, initialImageIndexToUse).then(() => { + return viewport.setStack(imageIds, initialImageIndexToUse).then(() => { viewport.setProperties({ ...properties }); const camera = presentations.positionPresentation?.camera; if (camera) { @@ -654,21 +661,27 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi const viewport = this.getCornerstoneViewport(viewportId); const viewportCamera = viewport.getCamera(); + let displaySetPromise; + if (viewport instanceof VolumeViewport || viewport instanceof VolumeViewport3D) { - this._setVolumeViewport(viewport, viewportData, viewportInfo).then(() => { + displaySetPromise = this._setVolumeViewport(viewport, viewportData, viewportInfo).then(() => { if (keepCamera) { viewport.setCamera(viewportCamera); viewport.render(); } }); - - return; } if (viewport instanceof StackViewport) { - this._setStackViewport(viewport, viewportData, viewportInfo); - return; + displaySetPromise = this._setStackViewport(viewport, viewportData, viewportInfo); } + + displaySetPromise.then(() => { + this._broadcastEvent(this.EVENTS.VIEWPORT_DATA_CHANGED, { + viewportData, + viewportId, + }); + }); } _setDisplaySets( @@ -676,16 +689,16 @@ class CornerstoneViewportService extends PubSubService implements IViewportServi viewportData: StackViewportData | VolumeViewportData, viewportInfo: ViewportInfo, presentations: Presentations = {} - ): void { + ): Promise { if (viewport instanceof StackViewport) { - this._setStackViewport( + return this._setStackViewport( viewport, viewportData as StackViewportData, viewportInfo, presentations ); } else if (viewport instanceof VolumeViewport || viewport instanceof VolumeViewport3D) { - this._setVolumeViewport( + return this._setVolumeViewport( viewport, viewportData as VolumeViewportData, viewportInfo, diff --git a/extensions/default/src/commandsModule.ts b/extensions/default/src/commandsModule.ts index 3f22e35895b..bcc0cab591b 100644 --- a/extensions/default/src/commandsModule.ts +++ b/extensions/default/src/commandsModule.ts @@ -241,7 +241,6 @@ const commandsModule = ({ ]; stateSyncService.store(stateSyncReduce); // This is a default action applied - const { protocol } = hangingProtocolService.getActiveProtocol(); actions.toggleHpTools(); // try to use the same tool in the new hanging protocol stage @@ -264,16 +263,6 @@ const commandsModule = ({ }); } } - - // Send the notification about updating the state - if (protocolId !== hpInfo.protocolId) { - // The old protocol callbacks are used for turning off things - // like crosshairs when moving to the new HP - commandsManager.run(oldProtocol.callbacks?.onProtocolExit); - // The new protocol callback is used for things like - // activating modes etc. - } - commandsManager.run(protocol.callbacks?.onProtocolEnter); return true; } catch (e) { console.error(e); diff --git a/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts b/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts index 01fdd8f6ef0..34708a84e6e 100644 --- a/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts +++ b/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts @@ -849,6 +849,8 @@ export default class HangingProtocolService extends PubSubService { throw new Error(error); } + + this._commandsManager.run(this.protocol.callbacks?.onProtocolEnter); } protected matchActivation( @@ -956,6 +958,12 @@ export default class HangingProtocolService extends PubSubService { if (!this.protocol || this.protocol.id !== protocol.id) { this.stageIndex = options?.stageIndex || 0; this._originalProtocol = this._copyProtocol(protocol); + + // before reassigning the protocol, we need to check if there is a callback + // on the old protocol that needs to be called + // Send the notification about updating the state + this._commandsManager.run(this.protocol?.callbacks?.onProtocolExit); + this.protocol = protocol; const { imageLoadStrategy } = protocol; @@ -1120,6 +1128,13 @@ export default class HangingProtocolService extends PubSubService { const { columns: numCols, rows: numRows, layoutOptions = [] } = layoutProps; + if (this.protocol.callbacks?.onViewportDataInitialized) { + this._commandsManager.runCommand('attachProtocolViewportDataListener', { + protocol: this.protocol, + stageIndex: this.stageIndex, + }); + } + this._broadcastEvent(this.EVENTS.NEW_LAYOUT, { layoutType, numRows, @@ -1143,9 +1158,6 @@ export default class HangingProtocolService extends PubSubService { } { let matchedViewports = 0; stageModel.viewports.forEach(viewport => { - // Todo: we should probably assign a random viewportId if not defined - // below, but it feels odd since viewportGrid should handle this kind - // of thing const viewportId = viewport.viewportOptions.viewportId; const matchDetails = this._matchViewport( viewport, diff --git a/platform/core/src/services/_shared/pubSubServiceInterface.ts b/platform/core/src/services/_shared/pubSubServiceInterface.ts index 822f969af59..7b66ceff9f6 100644 --- a/platform/core/src/services/_shared/pubSubServiceInterface.ts +++ b/platform/core/src/services/_shared/pubSubServiceInterface.ts @@ -90,7 +90,7 @@ function _broadcastEvent(eventName, callbackProps) { /** Export a PubSubService class to be used instead of the individual items */ export class PubSubService { EVENTS: any; - subscribe: (eventName: string, callback: Function) => { unsubscribe: () => any; }; + subscribe: (eventName: string, callback: Function) => { unsubscribe: () => any }; _broadcastEvent: (eventName: string, callbackProps: any) => void; _unsubscribe: (eventName: string, listenerId: string) => void; _isValidEvent: (eventName: string) => boolean; diff --git a/platform/core/src/types/HangingProtocol.ts b/platform/core/src/types/HangingProtocol.ts index 797028f3815..6db467b4807 100644 --- a/platform/core/src/types/HangingProtocol.ts +++ b/platform/core/src/types/HangingProtocol.ts @@ -241,15 +241,17 @@ export type ProtocolStage = { export type ProtocolNotifications = { // This set of commands is executed after the protocol is exited and the new one applied onProtocolExit?: Command[]; - // This set of commands is executed after the protocol is entered and applied onProtocolEnter?: Command[]; - // This set of commands is executed before the layout change is started. // If it returns false, the layout change will be aborted. // The numRows and numCols is included in the command params, so it is possible // to apply a specific hanging protocol onLayoutChange?: Command[]; + // This set of commands is executed after the initial viewport grid data is set + // and all viewport data includes a designated display set. This command + // will run on every stages initial layout. + onViewportDataInitialized?: Command[]; }; /** diff --git a/platform/docs/docs/platform/extensions/modules/hpModule.md b/platform/docs/docs/platform/extensions/modules/hpModule.md index 922d9e04ed1..eeb418e20f2 100644 --- a/platform/docs/docs/platform/extensions/modules/hpModule.md +++ b/platform/docs/docs/platform/extensions/modules/hpModule.md @@ -559,3 +559,64 @@ Additional series level criteria, such as modality rules must be included at the }, ], ``` + + +## Callbacks + + +Hanging protocols in `OHIF-v3` provide the flexibility to define various callbacks that allow you to customize the behavior of your viewer when specific events occur during protocol execution. These callbacks are defined in the `ProtocolNotifications` type and can be added to your hanging protocol configuration. + +Each callback is an array of commands or actions that are executed when the event occurs. + +```js +[ + { + commandName: 'showDownloadViewportModal', + commandOptions: {} + } +] +``` + + +Here, we'll explain the available callbacks and their purposes: + +### `onProtocolExit` + +The `onProtocolExit` callback is executed after the protocol is exited and the new one is applied. This callback is useful for performing actions or executing commands when switching between hanging protocols. + +### `onProtocolEnter` + +The `onProtocolEnter` callback is executed after the protocol is entered and applied. You can use this callback to define actions or commands that should run when entering a specific hanging protocol. + +### `onLayoutChange` + +The `onLayoutChange` callback is executed before the layout change is started. You can use it to apply a specific hanging protocol based on the current layout or other criteria. + +### `onViewportDataInitialized` + +The `onViewportDataInitialized` callback is executed after the initial viewport grid data is set and all viewport data includes a designated display set. This callback runs during the initial layout setup for each stage. You can use it to perform actions or apply settings to the viewports at the start. + +Here is an example of how you can add these callbacks to your hanging protocol configuration: + +```javascript +const protocol = { + id: 'myProtocol', + name: 'My Protocol', + // rest of the protocol configuration + callbacks: { + onProtocolExit: [ + // Array of commands or actions to execute on protocol exit + ], + onProtocolEnter: [ + // Array of commands or actions to execute on protocol enter + ], + onLayoutChange: [ + // Array of commands or actions to execute on layout change + ], + onViewportDataInitialized: [ + // Array of commands or actions to execute on viewport data initialization + ], + }, + // protocolMatchingRules + // the rest +}; diff --git a/platform/docs/docs/platform/services/data/HangingProtocolService.md b/platform/docs/docs/platform/services/data/HangingProtocolService.md index f2e156b6336..58caa82c303 100644 --- a/platform/docs/docs/platform/services/data/HangingProtocolService.md +++ b/platform/docs/docs/platform/services/data/HangingProtocolService.md @@ -350,13 +350,13 @@ The below example modifies the included hanging protocol (extensions/tmtv/src/ge ```javascript ptDisplaySet: { - ... - seriesMatchingRules: [ - { - attribute: 'sameAs', - sameAttribute: 'FrameOfReferenceUID', - sameDisplaySetId: 'ctDisplaySet', - required: true, - }, - ... + ... + seriesMatchingRules: [ + { + attribute: 'sameAs', + sameAttribute: 'FrameOfReferenceUID', + sameDisplaySetId: 'ctDisplaySet', + required: true, + }, + ... ``` From 6aed737c8aedcea9e3590ccbafb2e6838b79bc82 Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 6 Nov 2023 22:50:38 -0500 Subject: [PATCH 3/5] fix tests --- .../HangingProtocolService/HangingProtocolService.test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/core/src/services/HangingProtocolService/HangingProtocolService.test.js b/platform/core/src/services/HangingProtocolService/HangingProtocolService.test.js index aa9dfa169f0..cbc726ca450 100644 --- a/platform/core/src/services/HangingProtocolService/HangingProtocolService.test.js +++ b/platform/core/src/services/HangingProtocolService/HangingProtocolService.test.js @@ -141,7 +141,9 @@ function checkHpsBestMatch(hps) { describe('HangingProtocolService', () => { const mockedFunction = jest.fn(); - const commandsManager = {}; + const commandsManager = { + run: mockedFunction, + }; const servicesManager = { services: { TestService: { From 90143f42f04d8352dafc85493ace5acdc5981a6c Mon Sep 17 00:00:00 2001 From: Alireza Date: Mon, 6 Nov 2023 22:55:26 -0500 Subject: [PATCH 4/5] add Ouwen Co-authored-by: Ouwen Huang --- platform/docs/docs/platform/extensions/modules/hpModule.md | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/docs/docs/platform/extensions/modules/hpModule.md b/platform/docs/docs/platform/extensions/modules/hpModule.md index eeb418e20f2..40d627f2a74 100644 --- a/platform/docs/docs/platform/extensions/modules/hpModule.md +++ b/platform/docs/docs/platform/extensions/modules/hpModule.md @@ -403,6 +403,7 @@ viewportStructure: { ], }, }, + ``` From 2b44f9f05dfb959c2f41c51af4f5cdad5892c4df Mon Sep 17 00:00:00 2001 From: Alireza Date: Tue, 7 Nov 2023 12:23:17 -0500 Subject: [PATCH 5/5] apply review comments --- extensions/cornerstone-dicom-sr/package.json | 2 +- extensions/cornerstone/package.json | 2 +- extensions/cornerstone/src/commandsModule.ts | 6 +++--- extensions/default/package.json | 2 +- extensions/dicom-pdf/package.json | 2 +- extensions/dicom-video/package.json | 2 +- extensions/measurement-tracking/package.json | 2 +- extensions/tmtv/package.json | 2 +- platform/app/package.json | 2 +- platform/core/package.json | 2 +- .../HangingProtocolService/HangingProtocolService.ts | 4 ++-- platform/core/src/types/HangingProtocol.ts | 2 +- yarn.lock | 8 ++++---- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/extensions/cornerstone-dicom-sr/package.json b/extensions/cornerstone-dicom-sr/package.json index 3808c2443e4..c5487402bbf 100644 --- a/extensions/cornerstone-dicom-sr/package.json +++ b/extensions/cornerstone-dicom-sr/package.json @@ -36,7 +36,7 @@ "@ohif/extension-cornerstone": "3.8.0-beta.9", "@ohif/extension-measurement-tracking": "3.8.0-beta.9", "@ohif/ui": "3.8.0-beta.9", - "dcmjs": "^0.29.11", + "dcmjs": "^0.29.12", "dicom-parser": "^1.8.9", "hammerjs": "^2.0.8", "prop-types": "^15.6.2", diff --git a/extensions/cornerstone/package.json b/extensions/cornerstone/package.json index 445022e760c..5bc3589fef2 100644 --- a/extensions/cornerstone/package.json +++ b/extensions/cornerstone/package.json @@ -39,7 +39,7 @@ "@cornerstonejs/dicom-image-loader": "^1.20.3", "@ohif/core": "3.8.0-beta.9", "@ohif/ui": "3.8.0-beta.9", - "dcmjs": "^0.29.11", + "dcmjs": "^0.29.12", "dicom-parser": "^1.8.21", "hammerjs": "^2.0.8", "prop-types": "^15.6.2", diff --git a/extensions/cornerstone/src/commandsModule.ts b/extensions/cornerstone/src/commandsModule.ts index fcee213d8d3..29d24491968 100644 --- a/extensions/cornerstone/src/commandsModule.ts +++ b/extensions/cornerstone/src/commandsModule.ts @@ -584,16 +584,16 @@ function commandsModule({ attachProtocolViewportDataListener: ({ protocol, stageIndex }) => { const EVENT = cornerstoneViewportService.EVENTS.VIEWPORT_DATA_CHANGED; const command = protocol.callbacks.onViewportDataInitialized; - const numPanes = protocol.stages?.[stageIndex]?.viewports.length; + const numPanes = protocol.stages?.[stageIndex]?.viewports.length ?? 1; let numPanesWithData = 0; - cornerstoneViewportService.subscribe(EVENT, evt => { + const { unsubscribe } = cornerstoneViewportService.subscribe(EVENT, evt => { numPanesWithData++; if (numPanesWithData === numPanes) { commandsManager.run(...command); // Unsubscribe from the event - cornerstoneViewportService.unsubscribe(EVENT); + unsubscribe(EVENT); } }); }, diff --git a/extensions/default/package.json b/extensions/default/package.json index 1bd772a61bd..3f81a641bd4 100644 --- a/extensions/default/package.json +++ b/extensions/default/package.json @@ -32,7 +32,7 @@ "peerDependencies": { "@ohif/core": "3.8.0-beta.9", "@ohif/i18n": "3.8.0-beta.9", - "dcmjs": "^0.29.11", + "dcmjs": "^0.29.12", "dicomweb-client": "^0.10.2", "prop-types": "^15.6.2", "react": "^17.0.2", diff --git a/extensions/dicom-pdf/package.json b/extensions/dicom-pdf/package.json index 063656eeba7..add7e06ec44 100644 --- a/extensions/dicom-pdf/package.json +++ b/extensions/dicom-pdf/package.json @@ -30,7 +30,7 @@ "peerDependencies": { "@ohif/core": "3.8.0-beta.9", "@ohif/ui": "3.8.0-beta.9", - "dcmjs": "^0.29.11", + "dcmjs": "^0.29.12", "dicom-parser": "^1.8.9", "hammerjs": "^2.0.8", "prop-types": "^15.6.2", diff --git a/extensions/dicom-video/package.json b/extensions/dicom-video/package.json index 9f3371dfda9..bde6d76aeeb 100644 --- a/extensions/dicom-video/package.json +++ b/extensions/dicom-video/package.json @@ -30,7 +30,7 @@ "peerDependencies": { "@ohif/core": "3.8.0-beta.9", "@ohif/ui": "3.8.0-beta.9", - "dcmjs": "^0.29.11", + "dcmjs": "^0.29.12", "dicom-parser": "^1.8.9", "hammerjs": "^2.0.8", "prop-types": "^15.6.2", diff --git a/extensions/measurement-tracking/package.json b/extensions/measurement-tracking/package.json index 63a66e9547b..401f95c909e 100644 --- a/extensions/measurement-tracking/package.json +++ b/extensions/measurement-tracking/package.json @@ -36,7 +36,7 @@ "@ohif/extension-cornerstone-dicom-sr": "3.8.0-beta.9", "@ohif/ui": "3.8.0-beta.9", "classnames": "^2.3.2", - "dcmjs": "^0.29.11", + "dcmjs": "^0.29.12", "lodash.debounce": "^4.17.21", "prop-types": "^15.6.2", "react": "^17.0.2", diff --git a/extensions/tmtv/package.json b/extensions/tmtv/package.json index 01c7c0b5803..9d7b34adcd2 100644 --- a/extensions/tmtv/package.json +++ b/extensions/tmtv/package.json @@ -30,7 +30,7 @@ "peerDependencies": { "@ohif/core": "3.8.0-beta.9", "@ohif/ui": "3.8.0-beta.9", - "dcmjs": "^0.29.11", + "dcmjs": "^0.29.12", "dicom-parser": "^1.8.9", "hammerjs": "^2.0.8", "prop-types": "^15.6.2", diff --git a/platform/app/package.json b/platform/app/package.json index 6a667000aef..f6cfaf85f5c 100644 --- a/platform/app/package.json +++ b/platform/app/package.json @@ -72,7 +72,7 @@ "classnames": "^2.3.2", "core-js": "^3.16.1", "cornerstone-math": "^0.1.9", - "dcmjs": "^0.29.11", + "dcmjs": "^0.29.12", "detect-gpu": "^4.0.16", "dicom-parser": "^1.8.9", "dotenv-webpack": "^1.7.0", diff --git a/platform/core/package.json b/platform/core/package.json index 7de7abe290b..ec046e37988 100644 --- a/platform/core/package.json +++ b/platform/core/package.json @@ -42,7 +42,7 @@ }, "dependencies": { "@babel/runtime": "^7.20.13", - "dcmjs": "^0.29.11", + "dcmjs": "^0.29.12", "dicomweb-client": "^0.10.2", "gl-matrix": "^3.4.3", "isomorphic-base64": "^1.0.2", diff --git a/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts b/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts index 34708a84e6e..104c4be346d 100644 --- a/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts +++ b/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts @@ -850,7 +850,7 @@ export default class HangingProtocolService extends PubSubService { throw new Error(error); } - this._commandsManager.run(this.protocol.callbacks?.onProtocolEnter); + this._commandsManager.run(this.protocol?.callbacks?.onProtocolEnter); } protected matchActivation( @@ -1128,7 +1128,7 @@ export default class HangingProtocolService extends PubSubService { const { columns: numCols, rows: numRows, layoutOptions = [] } = layoutProps; - if (this.protocol.callbacks?.onViewportDataInitialized) { + if (this.protocol?.callbacks?.onViewportDataInitialized) { this._commandsManager.runCommand('attachProtocolViewportDataListener', { protocol: this.protocol, stageIndex: this.stageIndex, diff --git a/platform/core/src/types/HangingProtocol.ts b/platform/core/src/types/HangingProtocol.ts index 6db467b4807..8059b5675c8 100644 --- a/platform/core/src/types/HangingProtocol.ts +++ b/platform/core/src/types/HangingProtocol.ts @@ -250,7 +250,7 @@ export type ProtocolNotifications = { onLayoutChange?: Command[]; // This set of commands is executed after the initial viewport grid data is set // and all viewport data includes a designated display set. This command - // will run on every stages initial layout. + // will run on every stage's initial layout. onViewportDataInitialized?: Command[]; }; diff --git a/yarn.lock b/yarn.lock index a52cf2fb73c..daf63342258 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8458,10 +8458,10 @@ dcmjs@^0.27: loglevelnext "^3.0.1" ndarray "^1.0.19" -dcmjs@^0.29.11: - version "0.29.11" - resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.29.11.tgz#82e19d7c5212218c3225f8022ce97b0102ed3cc8" - integrity sha512-B5fO5D+USzfnuUG7ephnaKMluqBOP4qcckV2LgROXvn0hmWc53Gs2YzlokjcYcDeBAXNfssOOhDekUc+AduwkQ== +dcmjs@^0.29.12: + version "0.29.12" + resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.29.12.tgz#94f484f6ee4901e44d17113f005a917500544cd3" + integrity sha512-LQBxinj4CZQU2J61hf0/QXHe/OA+EM0ie+JbZ4eMaQAYfMOaDDkYG25zP3bNNDBFlY5ytgwsfWLvmvanQ9ixYg== dependencies: "@babel/runtime-corejs3" "^7.22.5" adm-zip "^0.5.10"