WIP newest cTools v3.

This commit is contained in:
James Petts authored and Evren Ozkan committed 2018-11-09 13:24:47 -05:00
1 parent 9048dcbc1e
commit d8b60ec38a
8 files changed
+2275 -29

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ Package.describe({
Npm.depends({
hammerjs: '2.0.8',
'cornerstone-core': '2.2.4',
'cornerstone-tools': '3.0.0-b.656',
'cornerstone-tools': '3.0.0-b.959',
'cornerstone-math': '0.1.6',
'dicom-parser': '1.8.0',
'cornerstone-wado-image-loader': '2.1.4',
@@ -43,7 +43,7 @@ OHIF.measurements.getImageDataUrl = ({
});
cornerstoneTools.addToolState(element, measurement.toolType, state);
OHIF.viewerbase.toolManager.cTools.setToolEnabled(measurement.toolType);
cornerstoneTools.setToolEnabled(measurement.toolType);
}
// Set the viewport voi if present
@@ -59,7 +59,7 @@ OHIF.measurements.getImageDataUrl = ({
// Disable the tool and clear the measurement state if a measurement was given
if (measurement) {
OHIF.viewerbase.toolManager.cTools.setToolDisabled(measurement.toolType);
cornerstoneTools.setToolDisabled(measurement.toolType);
cornerstoneTools.clearToolState(element, measurement.toolType);
}
@@ -278,7 +278,7 @@ const loadDisplaySetIntoViewport = (data, templateData) => {
}
// Enabling new eventDispatches form cornerstoneTools v3
toolManager.cTools.addEnabledElement(element);
//cornerstoneTools.addEnabledElement(element);
toolManager.instantiateTools(element);
// Use the tool manager to enable the currently active tool for this
@@ -27,25 +27,25 @@ export const toolManager = {
toolManager.setDefaultTool(OHIF.viewer.defaultTool);
}
toolManager.cTools = cornerstoneTools.init();
cornerstoneTools.init();
tools = [
'Length',
'Angle',
'ArrowAnnotate',
'Wwwc',
'Zoom',
'Pan',
'DragProbe',
'Magnify',
'Crosshairs',
'StackScroll',
'StackScrollMouseWheel',
'ZoomTouchPinch',
'ZoomMouseWheel',
'EllipticalRoi',
'RectangleRoi',
'WwwcRegion'
'Length',
'Angle',
'ArrowAnnotate',
'Wwwc',
'Zoom',
'Pan',
'DragProbe',
'Magnify',
'Crosshairs',
'StackScroll',
'StackScrollMouseWheel',
'ZoomTouchPinch',
'ZoomMouseWheel',
'EllipticalRoi',
'RectangleRoi',
'WwwcRegion'
];
initialized = true;
@@ -101,7 +101,7 @@ export const toolManager = {
}
toolManager.setAllToolsPassive();
toolManager.cTools.setToolActive(toolName, options);
cornerstoneTools.setToolActive(toolName, options);
// TODO: add the active tool with the correct button
activeTool[button] = toolName;
@@ -111,16 +111,16 @@ export const toolManager = {
},
setAllToolsPassive() {
toolManager.cTools.store.state.tools.forEach((tool) => {
toolManager.cTools.setToolPassive(tool.name)
})
cornerstoneTools.store.state.tools.forEach((tool) => {
cornerstoneTools.setToolPassive(tool.name)
});
},
instantiateTools() {
Array.from(tools).forEach(toolName => {
const apiTool = cornerstoneTools[`${toolName}Tool`];
if (apiTool) {
toolManager.cTools.addTool(apiTool);
cornerstoneTools.addTool(apiTool);
}
});
toolManager.setAllToolsPassive();
@@ -152,10 +152,10 @@ export const toolManager = {
},
activateCommandButton(button) {
//
//
},
deactivateCommandButton(button) {
//
//
}
};