feat: delete active annotation using backspace/delete key (#4722)

Co-authored-by: scouser <sharukh@Sharukhs-MacBook-Pro.local>
This commit is contained in:
Gas Giantandscouser authored and GitHub committed 2025-01-24 08:42:00 -05:00
1 parent 01fa5d83a6
commit d6f0092a32
2 files changed
+14

No files matched your search

@@ -13,6 +13,7 @@ import {
ReferenceLinesTool,
annotation,
} from '@cornerstonejs/tools';
import * as cornerstoneTools from '@cornerstonejs/tools';
import { Types as OhifTypes, utils } from '@ohif/core';
import i18n from '@ohif/i18n';
@@ -1298,6 +1299,12 @@ function commandsModule({
viewportGridService.getActiveViewportId()
);
},
deleteActiveAnnotation: () => {
const activeAnnotationsUID = cornerstoneTools.annotation.selection.getAnnotationsSelected();
activeAnnotationsUID.forEach(activeAnnotationUID => {
measurementService.remove(activeAnnotationUID);
});
},
};
const definitions = {
@@ -1558,6 +1565,9 @@ function commandsModule({
getRenderInactiveSegmentations: {
commandFn: actions.getRenderInactiveSegmentations,
},
deleteActiveAnnotation: {
commandFn: actions.deleteActiveAnnotation,
},
};
return {