WIP newest cTools v3.

This commit is contained in:
James Petts 2018-10-23 10:31:59 +01:00
parent e7042cafef
commit 548dddfc93
9 changed files with 2276 additions and 35 deletions

View File

@ -7,7 +7,7 @@ Package.describe({
Npm.depends({ Npm.depends({
hammerjs: '2.0.8', hammerjs: '2.0.8',
'cornerstone-core': '2.2.4', 'cornerstone-core': '2.2.4',
'cornerstone-tools': '3.0.0-b.656', 'cornerstone-tools': '3.0.0-b.959',
'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',

View File

@ -43,7 +43,7 @@ OHIF.measurements.getImageDataUrl = ({
}); });
cornerstoneTools.addToolState(element, measurement.toolType, state); cornerstoneTools.addToolState(element, measurement.toolType, state);
OHIF.viewerbase.toolManager.cTools.setToolEnabled(measurement.toolType); cornerstoneTools.setToolEnabled(measurement.toolType);
} }
// Set the viewport voi if present // 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 // Disable the tool and clear the measurement state if a measurement was given
if (measurement) { if (measurement) {
OHIF.viewerbase.toolManager.cTools.setToolDisabled(measurement.toolType); cornerstoneTools.setToolDisabled(measurement.toolType);
cornerstoneTools.clearToolState(element, measurement.toolType); cornerstoneTools.clearToolState(element, measurement.toolType);
} }

View File

@ -268,7 +268,7 @@ const loadDisplaySetIntoViewport = (data, templateData) => {
} }
// Enabling new eventDispatches form cornerstoneTools v3 // Enabling new eventDispatches form cornerstoneTools v3
toolManager.cTools.addEnabledElement(element); //cornerstoneTools.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

View File

@ -27,25 +27,25 @@ export const toolManager = {
toolManager.setDefaultTool(OHIF.viewer.defaultTool); toolManager.setDefaultTool(OHIF.viewer.defaultTool);
} }
toolManager.cTools = cornerstoneTools.init(); cornerstoneTools.init();
tools = [ tools = [
'Length', 'Length',
'Angle', 'Angle',
'ArrowAnnotate', 'ArrowAnnotate',
'Wwwc', 'Wwwc',
'Zoom', 'Zoom',
'Pan', 'Pan',
'DragProbe', 'DragProbe',
'Magnify', 'Magnify',
'Crosshairs', 'Crosshairs',
'StackScroll', 'StackScroll',
'StackScrollMouseWheel', 'StackScrollMouseWheel',
'ZoomTouchPinch', 'ZoomTouchPinch',
'ZoomMouseWheel', 'ZoomMouseWheel',
'EllipticalRoi', 'EllipticalRoi',
'RectangleRoi', 'RectangleRoi',
'WwwcRegion' 'WwwcRegion'
]; ];
initialized = true; initialized = true;
@ -101,7 +101,7 @@ export const toolManager = {
} }
toolManager.setAllToolsPassive(); toolManager.setAllToolsPassive();
toolManager.cTools.setToolActive(toolName, options); cornerstoneTools.setToolActive(toolName, options);
// TODO: add the active tool with the correct button // TODO: add the active tool with the correct button
activeTool[button] = toolName; activeTool[button] = toolName;
@ -111,16 +111,16 @@ export const toolManager = {
}, },
setAllToolsPassive() { setAllToolsPassive() {
toolManager.cTools.store.state.tools.forEach((tool) => { cornerstoneTools.store.state.tools.forEach((tool) => {
toolManager.cTools.setToolPassive(tool.name) cornerstoneTools.setToolPassive(tool.name)
}) });
}, },
instantiateTools() { instantiateTools() {
Array.from(tools).forEach(toolName => { Array.from(tools).forEach(toolName => {
const apiTool = cornerstoneTools[`${toolName}Tool`]; const apiTool = cornerstoneTools[`${toolName}Tool`];
if (apiTool) { if (apiTool) {
toolManager.cTools.addTool(apiTool); cornerstoneTools.addTool(apiTool);
} }
}); });
toolManager.setAllToolsPassive(); toolManager.setAllToolsPassive();

View File

@ -1,4 +1,3 @@
accounts-base@1.4.2
aldeed:collection2@2.10.0 aldeed:collection2@2.10.0
aldeed:collection2-core@1.2.0 aldeed:collection2-core@1.2.0
aldeed:schema-deny@1.1.0 aldeed:schema-deny@1.1.0
@ -28,7 +27,6 @@ cultofcoders:persistent-session@0.4.5
ddp@1.4.0 ddp@1.4.0
ddp-client@2.3.3 ddp-client@2.3.3
ddp-common@1.4.0 ddp-common@1.4.0
ddp-rate-limiter@1.0.7
ddp-server@2.2.0 ddp-server@2.2.0
deps@1.0.12 deps@1.0.12
diff-sequence@1.1.0 diff-sequence@1.1.0
@ -54,7 +52,6 @@ iron:layout@1.0.12
jquery@1.11.11 jquery@1.11.11
launch-screen@1.1.1 launch-screen@1.1.1
livedata@1.0.18 livedata@1.0.18
localstorage@1.2.0
logging@1.1.20 logging@1.1.20
mdg:validation-error@0.5.1 mdg:validation-error@0.5.1
meteor@1.9.2 meteor@1.9.2
@ -103,13 +100,11 @@ ordered-dict@1.1.0
promise@0.11.1 promise@0.11.1
raix:eventemitter@0.1.3 raix:eventemitter@0.1.3
random@1.1.0 random@1.1.0
rate-limit@1.0.9
reactive-dict@1.2.0 reactive-dict@1.2.0
reactive-var@1.0.11 reactive-var@1.0.11
reload@1.2.0 reload@1.2.0
retry@1.1.0 retry@1.1.0
routepolicy@1.0.13 routepolicy@1.0.13
service-configuration@1.0.11
session@1.1.7 session@1.1.7
shell-server@0.3.1 shell-server@0.3.1
silentcicero:jszip@0.0.4 silentcicero:jszip@0.0.4

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff