Fix some naming and updating to the correct cornerstone-tools version

This commit is contained in:
Gustavo Lelis committed 2018-09-24 02:38:23 -03:00
1 parent e3bf0f2852
commit 44cb47f64a
5 files changed
+21 -19

No files matched your search

@@ -36,10 +36,15 @@ export const toolManager = {
tools = [
'length',
'angle',
'angle',
'arrowAnnotate',
'wwwc',
'zoom',
'pan',
'probe',
'magnify',
'crosshairs',
'stackScrollMouseWheel',
'zoomTouchPinch',
'zoomMouseWheel',
'ellipticalRoi',
@@ -86,24 +91,22 @@ export const toolManager = {
return tools;
},
setActiveToolForElement(toolId, element) {
this.setAllToolsPassive(element);
this.cTools.setToolActive(element, toolId, { mouseButtonMask: 1 });
setActiveToolForElement(toolName) {
this.setAllToolsPassive();
this.cTools.setToolActive(toolName, { mouseButtonMask: 1 });
},
setAllToolsPassive(element) {
setAllToolsPassive() {
this.cTools.store.state.tools.forEach((tool) => {
this.cTools.setToolPassive(element, tool.name)
this.cTools.setToolPassive(tool.name)
})
},
instantiateTools(element) {
instantiateTools() {
Array.from(tools).forEach(toolName => {
// Add the tool
const apiTool = cornerstoneTools[`${toolName}Tool`];
if (apiTool) {
const tool = new apiTool();
this.cTools.addTool(element, tool);
this.cTools.addTool(apiTool);
}
});
},