Fix some naming and updating to the correct cornerstone-tools version
This commit is contained in:
parent
500ca1ec07
commit
51c5c76eb9
@ -6,8 +6,8 @@ Package.describe({
|
|||||||
|
|
||||||
Npm.depends({
|
Npm.depends({
|
||||||
hammerjs: '2.0.8',
|
hammerjs: '2.0.8',
|
||||||
'cornerstone-core': '2.2.7',
|
'cornerstone-core': '2.2.4',
|
||||||
'cornerstone-tools': '2.4.0',
|
'cornerstone-tools': '3.0.0-b.442',
|
||||||
'cornerstone-math': '0.1.6',
|
'cornerstone-math': '0.1.6',
|
||||||
'dicom-parser': '1.8.0',
|
'dicom-parser': '1.8.0',
|
||||||
'cornerstone-wado-image-loader': '2.1.4',
|
'cornerstone-wado-image-loader': '2.1.4',
|
||||||
|
|||||||
@ -278,8 +278,7 @@ const loadDisplaySetIntoViewport = (data, templateData) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Enabling new eventDispatches form cornerstoneTools v3
|
// Enabling new eventDispatches form cornerstoneTools v3
|
||||||
toolManager.cTools.addCanvas(element);
|
toolManager.cTools.addEnabledElement(element);
|
||||||
|
|
||||||
toolManager.instantiateTools(element);
|
toolManager.instantiateTools(element);
|
||||||
|
|
||||||
// Use the tool manager to enable the currently active tool for this
|
// Use the tool manager to enable the currently active tool for this
|
||||||
|
|||||||
@ -110,12 +110,12 @@ Meteor.startup(function() {
|
|||||||
wwwc: 'W/L',
|
wwwc: 'W/L',
|
||||||
zoom: 'Zoom',
|
zoom: 'Zoom',
|
||||||
angle: 'Angle Measurement',
|
angle: 'Angle Measurement',
|
||||||
dragProbe: 'Pixel Probe',
|
probe: 'Pixel Probe',
|
||||||
ellipticalRoi: 'Elliptical ROI',
|
ellipticalRoi: 'Elliptical ROI',
|
||||||
rectangleRoi: 'Rectangle ROI',
|
rectangleRoi: 'Rectangle ROI',
|
||||||
magnify: 'Magnify',
|
magnify: 'Magnify',
|
||||||
annotate: 'Annotate',
|
arrowAnnotate: 'Annotate',
|
||||||
stackScroll: 'Scroll Stack',
|
stackScrollMouseWheel: 'Scroll Stack',
|
||||||
pan: 'Pan',
|
pan: 'Pan',
|
||||||
length: 'Length Measurement',
|
length: 'Length Measurement',
|
||||||
wwwcRegion: 'W/L by Region',
|
wwwcRegion: 'W/L by Region',
|
||||||
|
|||||||
@ -36,10 +36,15 @@ export const toolManager = {
|
|||||||
|
|
||||||
tools = [
|
tools = [
|
||||||
'length',
|
'length',
|
||||||
'angle',
|
'angle',
|
||||||
|
'arrowAnnotate',
|
||||||
'wwwc',
|
'wwwc',
|
||||||
'zoom',
|
'zoom',
|
||||||
'pan',
|
'pan',
|
||||||
|
'probe',
|
||||||
|
'magnify',
|
||||||
|
'crosshairs',
|
||||||
|
'stackScrollMouseWheel',
|
||||||
'zoomTouchPinch',
|
'zoomTouchPinch',
|
||||||
'zoomMouseWheel',
|
'zoomMouseWheel',
|
||||||
'ellipticalRoi',
|
'ellipticalRoi',
|
||||||
@ -86,24 +91,22 @@ export const toolManager = {
|
|||||||
return tools;
|
return tools;
|
||||||
},
|
},
|
||||||
|
|
||||||
setActiveToolForElement(toolId, element) {
|
setActiveToolForElement(toolName) {
|
||||||
this.setAllToolsPassive(element);
|
this.setAllToolsPassive();
|
||||||
this.cTools.setToolActive(element, toolId, { mouseButtonMask: 1 });
|
this.cTools.setToolActive(toolName, { mouseButtonMask: 1 });
|
||||||
},
|
},
|
||||||
|
|
||||||
setAllToolsPassive(element) {
|
setAllToolsPassive() {
|
||||||
this.cTools.store.state.tools.forEach((tool) => {
|
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 => {
|
Array.from(tools).forEach(toolName => {
|
||||||
// Add the tool
|
|
||||||
const apiTool = cornerstoneTools[`${toolName}Tool`];
|
const apiTool = cornerstoneTools[`${toolName}Tool`];
|
||||||
if (apiTool) {
|
if (apiTool) {
|
||||||
const tool = new apiTool();
|
this.cTools.addTool(apiTool);
|
||||||
this.cTools.addTool(element, tool);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -68,7 +68,7 @@ Template.toolbarSection.helpers({
|
|||||||
});
|
});
|
||||||
|
|
||||||
extraTools.push({
|
extraTools.push({
|
||||||
id: 'dragProbe',
|
id: 'probe',
|
||||||
title: 'Probe',
|
title: 'Probe',
|
||||||
classes: 'imageViewerTool',
|
classes: 'imageViewerTool',
|
||||||
iconClasses: 'fa fa-dot-circle-o'
|
iconClasses: 'fa fa-dot-circle-o'
|
||||||
@ -126,7 +126,7 @@ Template.toolbarSection.helpers({
|
|||||||
const buttonData = [];
|
const buttonData = [];
|
||||||
|
|
||||||
buttonData.push({
|
buttonData.push({
|
||||||
id: 'stackScroll',
|
id: 'stackScrollMouseWheel',
|
||||||
title: 'Stack Scroll',
|
title: 'Stack Scroll',
|
||||||
classes: 'imageViewerTool',
|
classes: 'imageViewerTool',
|
||||||
iconClasses: 'fa fa-bars'
|
iconClasses: 'fa fa-bars'
|
||||||
@ -161,7 +161,7 @@ Template.toolbarSection.helpers({
|
|||||||
});
|
});
|
||||||
|
|
||||||
buttonData.push({
|
buttonData.push({
|
||||||
id: 'annotate',
|
id: 'arrowAnnotate',
|
||||||
title: 'Annotate',
|
title: 'Annotate',
|
||||||
classes: 'imageViewerTool',
|
classes: 'imageViewerTool',
|
||||||
svgLink: 'packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-non-target'
|
svgLink: 'packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-non-target'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user