2017-01-16 21:34:06 +01:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
|
import { Viewerbase } from 'meteor/ohif:viewerbase';
|
|
|
|
|
|
2015-10-20 16:23:32 +02:00
|
|
|
Meteor.startup(function() {
|
2017-01-16 21:34:06 +01:00
|
|
|
const toolManager = Viewerbase.toolManager;
|
|
|
|
|
|
2016-03-05 01:03:16 +01:00
|
|
|
toolManager.addTool('bidirectional', {
|
|
|
|
|
mouse: cornerstoneTools.bidirectional,
|
|
|
|
|
touch: cornerstoneTools.bidirectionalTouch
|
2015-10-20 16:23:32 +02:00
|
|
|
});
|
2016-07-23 20:11:01 +02:00
|
|
|
|
2015-11-09 14:08:50 +01:00
|
|
|
toolManager.addTool('nonTarget', {
|
|
|
|
|
mouse: cornerstoneTools.nonTarget,
|
|
|
|
|
touch: cornerstoneTools.nonTargetTouch
|
|
|
|
|
});
|
2015-11-22 12:20:19 +01:00
|
|
|
|
2016-01-06 22:45:52 +01:00
|
|
|
toolManager.addTool('scaleOverlayTool', {
|
2016-01-08 19:56:50 +01:00
|
|
|
mouse: cornerstoneTools.scaleOverlayTool,
|
|
|
|
|
touch: cornerstoneTools.scaleOverlayTool
|
2016-01-06 22:45:52 +01:00
|
|
|
});
|
|
|
|
|
|
2015-12-19 04:24:00 +01:00
|
|
|
toolManager.addTool('deleteLesionKeyboardTool', {
|
|
|
|
|
mouse: cornerstoneTools.deleteLesionKeyboardTool,
|
|
|
|
|
touch: cornerstoneTools.deleteLesionKeyboardTool
|
|
|
|
|
});
|
|
|
|
|
|
2016-12-16 19:07:03 +01:00
|
|
|
toolManager.addTool('targetCR', {
|
|
|
|
|
mouse: cornerstoneTools.targetCR,
|
|
|
|
|
touch: cornerstoneTools.targetCRTouch
|
2016-03-02 18:09:05 +01:00
|
|
|
});
|
|
|
|
|
|
2016-12-16 19:07:03 +01:00
|
|
|
toolManager.addTool('targetUN', {
|
|
|
|
|
mouse: cornerstoneTools.targetUN,
|
|
|
|
|
touch: cornerstoneTools.targetUNTouch
|
2016-03-02 18:09:05 +01:00
|
|
|
});
|
|
|
|
|
|
2016-11-12 01:22:57 +01:00
|
|
|
// Update default state for tools making sure each tool is only inserted once
|
|
|
|
|
let currentDefaultStates = toolManager.getToolDefaultStates();
|
|
|
|
|
let newDefaultStates = {
|
2016-12-29 22:01:30 +01:00
|
|
|
enable: [ 'scaleOverlayTool' ],
|
2017-11-10 10:41:18 +01:00
|
|
|
deactivate: ['bidirectional', 'nonTarget', 'length', 'targetCR', 'targetUN'],
|
2017-01-12 04:53:09 +01:00
|
|
|
activate: ['deleteLesionKeyboardTool']
|
2016-11-12 01:22:57 +01:00
|
|
|
};
|
|
|
|
|
|
2017-11-10 10:41:18 +01:00
|
|
|
Object.keys(newDefaultStates).forEach(state => {
|
|
|
|
|
newDefaultStates[state].forEach(tool => {
|
2016-11-12 01:22:57 +01:00
|
|
|
let tools = currentDefaultStates[state];
|
|
|
|
|
// make sure each tool is only inserted once
|
|
|
|
|
if (tools && tools.indexOf(tool) < 0) {
|
|
|
|
|
tools.push(tool);
|
|
|
|
|
}
|
|
|
|
|
});
|
2017-11-10 10:41:18 +01:00
|
|
|
});
|
2016-11-12 01:22:57 +01:00
|
|
|
|
|
|
|
|
toolManager.setToolDefaultStates(currentDefaultStates);
|
2016-12-16 19:07:03 +01:00
|
|
|
});
|