Files
ohif-viewer/Packages/ohif-lesiontracker/client/tools.js
T

56 lines
1.8 KiB
JavaScript
Raw Normal View History

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-04 19:03:16 -05:00
toolManager.addTool('bidirectional', {
mouse: cornerstoneTools.bidirectional,
touch: cornerstoneTools.bidirectionalTouch
2015-10-20 16:23:32 +02:00
});
2015-11-09 08:08:50 -05:00
toolManager.addTool('nonTarget', {
mouse: cornerstoneTools.nonTarget,
touch: cornerstoneTools.nonTargetTouch
});
toolManager.addTool('scaleOverlayTool', {
mouse: cornerstoneTools.scaleOverlayTool,
touch: cornerstoneTools.scaleOverlayTool
});
toolManager.addTool('deleteLesionKeyboardTool', {
mouse: cornerstoneTools.deleteLesionKeyboardTool,
touch: cornerstoneTools.deleteLesionKeyboardTool
});
toolManager.addTool('targetCR', {
mouse: cornerstoneTools.targetCR,
touch: cornerstoneTools.targetCRTouch
});
toolManager.addTool('targetUN', {
mouse: cornerstoneTools.targetUN,
touch: cornerstoneTools.targetUNTouch
});
// Update default state for tools making sure each tool is only inserted once
let currentDefaultStates = toolManager.getToolDefaultStates();
let newDefaultStates = {
2016-12-29 19:01:30 -02:00
enable: [ 'scaleOverlayTool' ],
2017-11-10 07:41:18 -02:00
deactivate: ['bidirectional', 'nonTarget', 'length', 'targetCR', 'targetUN'],
activate: ['deleteLesionKeyboardTool']
};
2017-11-10 07:41:18 -02:00
Object.keys(newDefaultStates).forEach(state => {
newDefaultStates[state].forEach(tool => {
let tools = currentDefaultStates[state];
// make sure each tool is only inserted once
if (tools && tools.indexOf(tool) < 0) {
tools.push(tool);
}
});
2017-11-10 07:41:18 -02:00
});
toolManager.setToolDefaultStates(currentDefaultStates);
});