From 68c1170546b64153a04f30df0646130c47f1f470 Mon Sep 17 00:00:00 2001 From: Adithyan Dinesh Date: Tue, 26 Mar 2024 18:34:07 +0530 Subject: [PATCH] Synced segmentation tools hotkeys with segmentation panel --- extensions/cornerstone/src/commandsModule.ts | 16 ++++++++++++++++ platform/core/src/defaults/hotkeyBindings.js | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/extensions/cornerstone/src/commandsModule.ts b/extensions/cornerstone/src/commandsModule.ts index 52645938125..5da90b32990 100644 --- a/extensions/cornerstone/src/commandsModule.ts +++ b/extensions/cornerstone/src/commandsModule.ts @@ -359,6 +359,19 @@ function commandsModule({ ], }); }, + recordSetToolActive: ({ toolName }) => { + toolbarService.recordInteraction({ + interactionType: 'tool', + commands: [ + { + commandName: 'setToolActive', + commandOptions: { + toolName, + }, + }, + ], + }); + }, showDownloadViewportModal: () => { const { activeViewportId } = viewportGridService.getState(); @@ -653,6 +666,9 @@ function commandsModule({ setToolActive: { commandFn: actions.setToolActive, }, + recordSetToolActive: { + commandFn: actions.recordSetToolActive, + }, rotateViewportCW: { commandFn: actions.rotateViewport, options: { rotation: 90 }, diff --git a/platform/core/src/defaults/hotkeyBindings.js b/platform/core/src/defaults/hotkeyBindings.js index 1292df0dbc3..c4b572b7049 100644 --- a/platform/core/src/defaults/hotkeyBindings.js +++ b/platform/core/src/defaults/hotkeyBindings.js @@ -174,14 +174,14 @@ const bindings = [ keys: ['5'], }, { - commandName: 'setToolActive', + commandName: 'recordSetToolActive', commandOptions: { toolName: 'CircularBrush' }, label: 'Segmentation Brush', keys: ['b'], isEditable: true, }, { - commandName: 'setToolActive', + commandName: 'recordSetToolActive', commandOptions: { toolName: 'CircularEraser' }, label: 'Segmentation Eraser', keys: ['e'],