From b750696cc746d2f989716c336efa8d3bfef2ddc9 Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Fri, 19 May 2023 16:26:45 -0400 Subject: [PATCH 1/4] Version updates --- modes/veterinary-mode/package.json | 2 +- ohif-configurable/config-mode/package.json | 4 ++-- ohif-configurable/findings-mode/package.json | 2 +- ohif-configurable/hp-extension/package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modes/veterinary-mode/package.json b/modes/veterinary-mode/package.json index 167d9e3..f77a528 100644 --- a/modes/veterinary-mode/package.json +++ b/modes/veterinary-mode/package.json @@ -31,7 +31,7 @@ "peerDependencies": { "@ohif/core": "^3.0.0", "@radicalimaging/config-mode": "^3.4.2", - "@radicalimaging/findings-mode": "^3.4.2" + "@radicalimaging/findings-mode": "^3.13.4" }, "dependencies": { "@babel/runtime": "7.17.9" diff --git a/ohif-configurable/config-mode/package.json b/ohif-configurable/config-mode/package.json index a88bc27..6276766 100644 --- a/ohif-configurable/config-mode/package.json +++ b/ohif-configurable/config-mode/package.json @@ -1,6 +1,6 @@ { "name": "@radicalimaging/config-mode", - "version": "3.13.2", + "version": "3.13.4", "description": "A configurable/themeable mode that allows runtime extensions to the mode.", "author": "Radical Imaging", "license": "MIT", @@ -33,7 +33,7 @@ "test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests" }, "peerDependencies": { - "@cornerstonejs/tools": "^0.63.3", + "@cornerstonejs/tools": "^0.67.7", "@ohif/core": "^3.0.0", "@ohif/ui": "^1.10.10", "gl-matrix": "^3.4.3", diff --git a/ohif-configurable/findings-mode/package.json b/ohif-configurable/findings-mode/package.json index e4a43ff..1afe365 100644 --- a/ohif-configurable/findings-mode/package.json +++ b/ohif-configurable/findings-mode/package.json @@ -1,6 +1,6 @@ { "name": "@radicalimaging/findings-mode", - "version": "3.13.3", + "version": "3.13.4", "description": "Support context menu/command key findings", "author": "Bill Wallace, Radical Imaging", "license": "MIT", diff --git a/ohif-configurable/hp-extension/package.json b/ohif-configurable/hp-extension/package.json index 0566def..e4282ce 100644 --- a/ohif-configurable/hp-extension/package.json +++ b/ohif-configurable/hp-extension/package.json @@ -30,7 +30,7 @@ "start": "yarn run dev" }, "peerDependencies": { - "@cornerstonejs/tools": "^0.63.3", + "@cornerstonejs/tools": "^0.67.7", "@ohif/core": "^3.0.0", "@ohif/extension-cornerstone": "^3.0.0", "@ohif/extension-default": "^3.0.0", From 164985294057bb3d8cf9d17345755a7485ddeb7a Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Fri, 26 May 2023 11:34:47 -0400 Subject: [PATCH 2/4] Compatibility with the new hanging protocol/toolbar buttons only --- ohif-configurable/config-mode/package.json | 2 +- .../config-mode/src/toolbarButtons.js | 22 +------------------ ohif-configurable/hp-extension/package.json | 2 +- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/ohif-configurable/config-mode/package.json b/ohif-configurable/config-mode/package.json index 6276766..2c558df 100644 --- a/ohif-configurable/config-mode/package.json +++ b/ohif-configurable/config-mode/package.json @@ -33,7 +33,7 @@ "test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests" }, "peerDependencies": { - "@cornerstonejs/tools": "^0.67.7", + "@cornerstonejs/tools": "^1.1.0", "@ohif/core": "^3.0.0", "@ohif/ui": "^1.10.10", "gl-matrix": "^3.4.3", diff --git a/ohif-configurable/config-mode/src/toolbarButtons.js b/ohif-configurable/config-mode/src/toolbarButtons.js index a99a196..9f6ebb7 100644 --- a/ohif-configurable/config-mode/src/toolbarButtons.js +++ b/ohif-configurable/config-mode/src/toolbarButtons.js @@ -28,18 +28,6 @@ function _createButton(type, id, icon, label, commands, tooltip) { }; } -function _createCommands(commandName, toolName, toolGroupIds) { - return toolGroupIds.map(toolGroupId => ({ - /* It's a command that is being run when the button is clicked. */ - commandName, - commandOptions: { - toolName, - toolGroupId, - }, - context: 'CORNERSTONE', - })); -} - const _createActionButton = _createButton.bind(null, 'action'); const _createToggleButton = _createButton.bind(null, 'toggle'); const _createToolButton = _createButton.bind(null, 'tool'); @@ -384,7 +372,6 @@ const toolbarButtons = [ // ************ New Layout Section // Measurement - isNewHP ? { id: 'Layout', type: 'ohif.splitButton', @@ -478,15 +465,7 @@ const toolbarButtons = [ }, ], }, - } : - { - id: 'Layout', - type: 'ohif.layoutSelector', - props: { - rows: 3, - columns: 3, }, - }, { id: 'MPR', @@ -698,4 +677,5 @@ const toolbarButtons = [ }, ]; +console.log("* config-mode toolbarButtons", toolbarButtons); export default toolbarButtons; diff --git a/ohif-configurable/hp-extension/package.json b/ohif-configurable/hp-extension/package.json index e4282ce..8af50fd 100644 --- a/ohif-configurable/hp-extension/package.json +++ b/ohif-configurable/hp-extension/package.json @@ -30,7 +30,7 @@ "start": "yarn run dev" }, "peerDependencies": { - "@cornerstonejs/tools": "^0.67.7", + "@cornerstonejs/tools": "^1.1.0", "@ohif/core": "^3.0.0", "@ohif/extension-cornerstone": "^3.0.0", "@ohif/extension-default": "^3.0.0", From ee72ea4a04b59e13546b6a5053b93aab28ef5949 Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Fri, 26 May 2023 11:41:31 -0400 Subject: [PATCH 3/4] v3.13.5 --- ohif-configurable/config-mode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ohif-configurable/config-mode/package.json b/ohif-configurable/config-mode/package.json index 2c558df..e39bca5 100644 --- a/ohif-configurable/config-mode/package.json +++ b/ohif-configurable/config-mode/package.json @@ -1,6 +1,6 @@ { "name": "@radicalimaging/config-mode", - "version": "3.13.4", + "version": "3.13.5", "description": "A configurable/themeable mode that allows runtime extensions to the mode.", "author": "Radical Imaging", "license": "MIT", From be8e59aff54b6535043f55c413a41efe5886a780 Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Thu, 2 Nov 2023 17:10:26 -0400 Subject: [PATCH 4/4] Version updates --- ohif-configurable/config-mode/package.json | 2 +- .../config-mode/src/onModeEnter.ts | 20 ++++++----- .../config-mode/src/toolbarButtons.js | 35 +++++++++++++++++-- ohif-configurable/hp-extension/package.json | 2 +- 4 files changed, 46 insertions(+), 13 deletions(-) diff --git a/ohif-configurable/config-mode/package.json b/ohif-configurable/config-mode/package.json index e39bca5..76db2af 100644 --- a/ohif-configurable/config-mode/package.json +++ b/ohif-configurable/config-mode/package.json @@ -33,7 +33,7 @@ "test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests" }, "peerDependencies": { - "@cornerstonejs/tools": "^1.1.0", + "@cornerstonejs/tools": "^1.11.2", "@ohif/core": "^3.0.0", "@ohif/ui": "^1.10.10", "gl-matrix": "^3.4.3", diff --git a/ohif-configurable/config-mode/src/onModeEnter.ts b/ohif-configurable/config-mode/src/onModeEnter.ts index db8086a..bf57e4e 100644 --- a/ohif-configurable/config-mode/src/onModeEnter.ts +++ b/ohif-configurable/config-mode/src/onModeEnter.ts @@ -1,8 +1,9 @@ -export default function onModeEnter({ servicesManager, extensionManager, commandsManager }) { +export default function onModeEnter(props) { + const { servicesManager, extensionManager, commandsManager } = props; const { measurementService, - ToolBarService, - ToolGroupService, + toolbarService, + toolGroupService, customizationService, } = servicesManager.services; @@ -15,7 +16,8 @@ export default function onModeEnter({ servicesManager, extensionManager, command let unsubscribe; const activateTool = () => { - ToolBarService.recordInteraction(this.defaultTool); + toolbarService.recordInteraction(this.defaultTool); + this.activateOtherTools?.(props); // We don't need to reset the active tool whenever a viewport is getting // added to the toolGroup. @@ -24,15 +26,15 @@ export default function onModeEnter({ servicesManager, extensionManager, command // Since we only have one viewport for the basic cs3d mode and it has // only one hanging protocol, we can just use the first viewport - ({ unsubscribe } = ToolGroupService.subscribe( - ToolGroupService.EVENTS.VIEWPORT_ADDED, + ({ unsubscribe } = toolGroupService.subscribe( + toolGroupService.EVENTS.VIEWPORT_ADDED, activateTool )); - ToolBarService.init(extensionManager); - ToolBarService.addButtons(this.toolbarButtons); + toolbarService.init(extensionManager); + toolbarService.addButtons(this.toolbarButtons); Object.keys(this.toolBarSections).forEach(section => { - ToolBarService.createButtonSection(section, this.toolBarSections[section]); + toolbarService.createButtonSection(section, this.toolBarSections[section]); }); customizationService?.addModeCustomizations?.(this.modeCustomizations); diff --git a/ohif-configurable/config-mode/src/toolbarButtons.js b/ohif-configurable/config-mode/src/toolbarButtons.js index 9f6ebb7..6c8e9ff 100644 --- a/ohif-configurable/config-mode/src/toolbarButtons.js +++ b/ohif-configurable/config-mode/src/toolbarButtons.js @@ -6,8 +6,9 @@ import { WindowLevelMenuItem, } from '@ohif/ui'; import { defaults } from '@ohif/core'; +import { EVENTS } from '@cornerstonejs/core'; -const isNewHP = window.config.isNewHP; +console.log("EVENTS=", EVENTS); const { windowLevelPresets } = defaults; /** @@ -17,7 +18,7 @@ const { windowLevelPresets } = defaults; * @param {*} icon * @param {*} label */ -function _createButton(type, id, icon, label, commands, tooltip) { +function _createButton(type, id, icon, label, commands, tooltip, extraOptions) { return { id, icon, @@ -25,6 +26,7 @@ function _createButton(type, id, icon, label, commands, tooltip) { type, commands, tooltip, + ...extraOptions, }; } @@ -32,6 +34,34 @@ const _createActionButton = _createButton.bind(null, 'action'); const _createToggleButton = _createButton.bind(null, 'toggle'); const _createToolButton = _createButton.bind(null, 'tool'); +const ReferenceLinesCommands = [ + { + commandName: 'setSourceViewportForReferenceLinesTool', + context: 'CORNERSTONE', + }, + { + commandName: 'setToolActive', + commandOptions: { + toolName: 'ReferenceLines', + }, + context: 'CORNERSTONE', + }, +]; + +const ReferenceLines = _createToggleButton( + 'ReferenceLines', + 'tool-referenceLines', // change this with the new icon + 'Reference Lines', + ReferenceLinesCommands, + 'Show reference lines', + { + listeners: { + activeViewportIdChanged: ReferenceLinesCommands, + [EVENTS.STACK_VIEWPORT_NEW_STACK]: ReferenceLinesCommands, + }, + } +); + /** * * @param {*} preset - preset number (from above import) @@ -575,6 +605,7 @@ const toolbarButtons = [ context: 'CORNERSTONE', }, ]), + ReferenceLines, _createToggleButton( 'ReferenceLines', 'tool-referenceLines', // change this with the new icon diff --git a/ohif-configurable/hp-extension/package.json b/ohif-configurable/hp-extension/package.json index 8af50fd..43833f8 100644 --- a/ohif-configurable/hp-extension/package.json +++ b/ohif-configurable/hp-extension/package.json @@ -30,7 +30,7 @@ "start": "yarn run dev" }, "peerDependencies": { - "@cornerstonejs/tools": "^1.1.0", + "@cornerstonejs/tools": "^1.11.2", "@ohif/core": "^3.0.0", "@ohif/extension-cornerstone": "^3.0.0", "@ohif/extension-default": "^3.0.0",