Fix some naming and updating to the correct cornerstone-tools version
This commit is contained in:
parent
e3bf0f2852
commit
44cb47f64a
@ -7,7 +7,7 @@ Package.describe({
|
||||
Npm.depends({
|
||||
hammerjs: '2.0.8',
|
||||
'cornerstone-core': '2.2.4',
|
||||
'cornerstone-tools': '2.3.9',
|
||||
'cornerstone-tools': '3.0.0-b.442',
|
||||
'cornerstone-math': '0.1.6',
|
||||
'dicom-parser': '1.8.0',
|
||||
'cornerstone-wado-image-loader': '2.1.4',
|
||||
|
||||
@ -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);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@ -68,7 +68,7 @@ Template.toolbarSection.helpers({
|
||||
});
|
||||
|
||||
extraTools.push({
|
||||
id: 'dragProbe',
|
||||
id: 'probe',
|
||||
title: 'Probe',
|
||||
classes: 'imageViewerTool',
|
||||
iconClasses: 'fa fa-dot-circle-o'
|
||||
@ -126,7 +126,7 @@ Template.toolbarSection.helpers({
|
||||
const buttonData = [];
|
||||
|
||||
buttonData.push({
|
||||
id: 'stackScroll',
|
||||
id: 'stackScrollMouseWheel',
|
||||
title: 'Stack Scroll',
|
||||
classes: 'imageViewerTool',
|
||||
iconClasses: 'fa fa-bars'
|
||||
@ -161,7 +161,7 @@ Template.toolbarSection.helpers({
|
||||
});
|
||||
|
||||
buttonData.push({
|
||||
id: 'annotate',
|
||||
id: 'arrowAnnotate',
|
||||
title: 'Annotate',
|
||||
classes: 'imageViewerTool',
|
||||
svgLink: 'packages/ohif_viewerbase/assets/icons.svg#icon-tools-measure-non-target'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user