Skip to content

Commit

Permalink
Synced segmentation tools hotkeys with segmentation panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Adithyan-Dinesh-Trenser committed Mar 26, 2024
1 parent cc13c72 commit 68c1170
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions extensions/cornerstone/src/commandsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,19 @@ function commandsModule({
],
});
},
recordSetToolActive: ({ toolName }) => {
toolbarService.recordInteraction({
interactionType: 'tool',
commands: [
{
commandName: 'setToolActive',
commandOptions: {
toolName,
},
},
],
});
},
showDownloadViewportModal: () => {
const { activeViewportId } = viewportGridService.getState();

Expand Down Expand Up @@ -653,6 +666,9 @@ function commandsModule({
setToolActive: {
commandFn: actions.setToolActive,
},
recordSetToolActive: {
commandFn: actions.recordSetToolActive,
},
rotateViewportCW: {
commandFn: actions.rotateViewport,
options: { rotation: 90 },
Expand Down
4 changes: 2 additions & 2 deletions platform/core/src/defaults/hotkeyBindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 68c1170

Please sign in to comment.