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({
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',

View File

@ -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);
}

View File

@ -268,7 +268,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
@ -407,7 +407,7 @@ const loadDisplaySetIntoViewport = (data, templateData) => {
// If it was, no changes are necessary, so stop here.
const activeViewportIndex = Session.get('activeViewport');
if (viewportIndex === activeViewportIndex) return;
$element.focus();
OHIF.log.info('imageViewerViewport sendActivationTrigger');

View File

@ -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) {
//
//
}
};

View File

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