diff --git a/extensions/ohif-cornerstone-extension/src/commandsModule.js b/extensions/ohif-cornerstone-extension/src/commandsModule.js index 6aa582c9a..8eea5fe86 100644 --- a/extensions/ohif-cornerstone-extension/src/commandsModule.js +++ b/extensions/ohif-cornerstone-extension/src/commandsModule.js @@ -1,4 +1,5 @@ import cornerstone from 'cornerstone-core'; +import cornerstoneTools from 'cornerstone-tools'; // TODO: Just emit the tool's name? // TODO: Let local context handle the active tool propogation to redux? @@ -90,6 +91,7 @@ const actions = { // NOTE: It would be nice if `hotkeys` could set this, instead of creating a command per tool setCornerstoneToolActive: ({ toolName }) => { console.warn(toolName); + cornerstoneTools.setToolActive(toolName, { mouseButtonMask: 1 }); // store.dispatch(setToolActive(toolName)); }, updateViewportDisplaySet: ({ direction }) => { @@ -175,6 +177,11 @@ const definitions = { commandFn: actions.setCornerstoneToolActive, storeContexts: [], options: { toolName: 'Zoom' } + }, + setToolActive: { + commandFn: actions.setCornerstoneToolActive, + storeContexts: [], + options: {} } }; diff --git a/extensions/ohif-cornerstone-extension/src/handleSegmentationStorage.js b/extensions/ohif-cornerstone-extension/src/handleSegmentationStorage.js index e5a29ec5a..2ba009cdb 100644 --- a/extensions/ohif-cornerstone-extension/src/handleSegmentationStorage.js +++ b/extensions/ohif-cornerstone-extension/src/handleSegmentationStorage.js @@ -28,29 +28,6 @@ function getDisplaySetsBySeries(studies, studyInstanceUid, seriesInstanceUid) { }); } -// Unused? Delete me. -// function getCornerstoneStack(studies, studyInstanceUid, displaySetInstanceUid) { -// const study = studies.find( -// study => study.studyInstanceUid === studyInstanceUid -// ); - -// // Create shortcut to displaySet -// const displaySet = getDisplaySet( -// studies, -// studyInstanceUid, -// displaySetInstanceUid -// ); - -// // Get stack from Stack Manager -// const stack = StackManager.findOrCreateStack(study, displaySet); - -// // Clone the stack here so we don't mutate it later -// const stackClone = Object.assign({}, stack); -// stackClone.currentImageIdIndex = 0; - -// return stackClone; -// } - function parseSeg(arrayBuffer, imageIds) { return dcmjs.adapters.Cornerstone.Segmentation.generateToolState( imageIds,