Generic setToolActive command
This commit is contained in:
parent
4de5fa2d0e
commit
7971ac58a2
@ -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: {}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user