feat: delete active annotation using backspace/delete key (#4722)
Co-authored-by: scouser <sharukh@Sharukhs-MacBook-Pro.local>
This commit is contained in:
parent
01fa5d83a6
commit
d6f0092a32
@ -13,6 +13,7 @@ import {
|
|||||||
ReferenceLinesTool,
|
ReferenceLinesTool,
|
||||||
annotation,
|
annotation,
|
||||||
} from '@cornerstonejs/tools';
|
} from '@cornerstonejs/tools';
|
||||||
|
import * as cornerstoneTools from '@cornerstonejs/tools';
|
||||||
|
|
||||||
import { Types as OhifTypes, utils } from '@ohif/core';
|
import { Types as OhifTypes, utils } from '@ohif/core';
|
||||||
import i18n from '@ohif/i18n';
|
import i18n from '@ohif/i18n';
|
||||||
@ -1298,6 +1299,12 @@ function commandsModule({
|
|||||||
viewportGridService.getActiveViewportId()
|
viewportGridService.getActiveViewportId()
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
deleteActiveAnnotation: () => {
|
||||||
|
const activeAnnotationsUID = cornerstoneTools.annotation.selection.getAnnotationsSelected();
|
||||||
|
activeAnnotationsUID.forEach(activeAnnotationUID => {
|
||||||
|
measurementService.remove(activeAnnotationUID);
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const definitions = {
|
const definitions = {
|
||||||
@ -1558,6 +1565,9 @@ function commandsModule({
|
|||||||
getRenderInactiveSegmentations: {
|
getRenderInactiveSegmentations: {
|
||||||
commandFn: actions.getRenderInactiveSegmentations,
|
commandFn: actions.getRenderInactiveSegmentations,
|
||||||
},
|
},
|
||||||
|
deleteActiveAnnotation: {
|
||||||
|
commandFn: actions.deleteActiveAnnotation,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -173,6 +173,10 @@ const bindings = [
|
|||||||
label: 'W/L Preset 5',
|
label: 'W/L Preset 5',
|
||||||
keys: ['5'],
|
keys: ['5'],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
commandName: 'deleteActiveAnnotation',
|
||||||
|
keys: ['backspace'],
|
||||||
|
},
|
||||||
// These don't exist, so don't try applying them....
|
// These don't exist, so don't try applying them....
|
||||||
// {
|
// {
|
||||||
// commandName: 'setWindowLevel',
|
// commandName: 'setWindowLevel',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user