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

@@ -268,8 +268,7 @@ const loadDisplaySetIntoViewport = (data, templateData) => {
}
// Enabling new eventDispatches form cornerstoneTools v3
toolManager.cTools.addCanvas(element);
toolManager.cTools.addEnabledElement(element);
toolManager.instantiateTools(element);
// Use the tool manager to enable the currently active tool for this
@@ -110,12 +110,12 @@ Meteor.startup(function() {
wwwc: 'W/L',
zoom: 'Zoom',
angle: 'Angle Measurement',
dragProbe: 'Pixel Probe',
probe: 'Pixel Probe',
ellipticalRoi: 'Elliptical ROI',
rectangleRoi: 'Rectangle ROI',
magnify: 'Magnify',
annotate: 'Annotate',
stackScroll: 'Scroll Stack',
arrowAnnotate: 'Annotate',
stackScrollMouseWheel: 'Scroll Stack',
pan: 'Pan',
length: 'Length Measurement',
wwwcRegion: 'W/L by Region',
@@ -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);
}
});
},