[OHIF-295] - Esc button should stop the creation of a measurement or annotation (#1883)

* WIP, need to fix arrow making measurement

* Update cornerstoneTools to fix cst arrow annotate event bug.
This commit is contained in:
James Petts authored and GitHub committed 2020-07-10 15:00:10 -04:00
1 parent 89cbe5bf2e
commit ce40f04f2e
11 files changed
+38 -13

No files matched your search

+1 -1
View File
@@ -33,7 +33,7 @@
"@ohif/ui": "^0.50.0",
"cornerstone-core": "^2.3.0",
"cornerstone-math": "^0.1.8",
"cornerstone-tools": "4.18.0",
"cornerstone-tools": "4.18.1",
"cornerstone-wado-image-loader": "^3.1.2",
"dcmjs": "0.14.2",
"dicom-parser": "^1.8.3",
@@ -79,6 +79,21 @@ const commandsModule = ({ servicesManager }) => {
cornerstone.setViewport(enabledElement, viewport);
}
},
cancelMeasurement: () => {
const enabledElement = _getActiveViewportsEnabledElement();
if (enabledElement) {
debugger;
const cancelActiveManipulatorsForElement = cornerstoneTools.getModule(
'manipulatorState'
).setters.cancelActiveManipulatorsForElement;
cancelActiveManipulatorsForElement(enabledElement);
cornerstone.updateImage(enabledElement);
}
},
// TODO: this is receiving `evt` from `ToolbarRow`. We could use it to have
// better mouseButtonMask sets.
setToolActive: ({ toolName }) => {
@@ -349,6 +364,11 @@ const commandsModule = ({ servicesManager }) => {
storeContexts: [],
options: {},
},
cancelMeasurement: {
commandFn: actions.cancelMeasurement,
storeContexts: [],
options: {},
},
flipViewportVertical: {
commandFn: actions.flipViewportVertical,
storeContexts: [],