Skip to content

Commit 68c1170

Browse files
Synced segmentation tools hotkeys with segmentation panel
1 parent cc13c72 commit 68c1170

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

extensions/cornerstone/src/commandsModule.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,19 @@ function commandsModule({
359359
],
360360
});
361361
},
362+
recordSetToolActive: ({ toolName }) => {
363+
toolbarService.recordInteraction({
364+
interactionType: 'tool',
365+
commands: [
366+
{
367+
commandName: 'setToolActive',
368+
commandOptions: {
369+
toolName,
370+
},
371+
},
372+
],
373+
});
374+
},
362375
showDownloadViewportModal: () => {
363376
const { activeViewportId } = viewportGridService.getState();
364377

@@ -653,6 +666,9 @@ function commandsModule({
653666
setToolActive: {
654667
commandFn: actions.setToolActive,
655668
},
669+
recordSetToolActive: {
670+
commandFn: actions.recordSetToolActive,
671+
},
656672
rotateViewportCW: {
657673
commandFn: actions.rotateViewport,
658674
options: { rotation: 90 },

platform/core/src/defaults/hotkeyBindings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@ const bindings = [
174174
keys: ['5'],
175175
},
176176
{
177-
commandName: 'setToolActive',
177+
commandName: 'recordSetToolActive',
178178
commandOptions: { toolName: 'CircularBrush' },
179179
label: 'Segmentation Brush',
180180
keys: ['b'],
181181
isEditable: true,
182182
},
183183
{
184-
commandName: 'setToolActive',
184+
commandName: 'recordSetToolActive',
185185
commandOptions: { toolName: 'CircularEraser' },
186186
label: 'Segmentation Eraser',
187187
keys: ['e'],

0 commit comments

Comments
 (0)