LT-275: Migrating ohif:lesiontracker to the new import structure

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2016-11-15 08:24:30 +01:00
1 parent a49fca71d2
commit 826bf9bf16
26 files changed
+142 -151

No files matched your search

@@ -0,0 +1,43 @@
import { OHIF } from 'meteor/ohif:core';
/**
* Show / hide lesion tracker tools
*/
let previousStates;
let previousActiveTool;
let toolsShown = true;
OHIF.lesiontracker.toggleLesionTrackerTools = () => {
if (toolsShown === true) {
// Save the current settings for later
previousStates = toolManager.getToolDefaultStates();
previousActiveTool = toolManager.getActiveTool();
// Hide the tools (set them all to disabled)
const toolDefaultStates = {
activate: [ 'deleteLesionKeyboardTool' ],
deactivate: [],
enable: [],
disable: [ 'bidirectional', 'nonTarget', 'length', 'crTool', 'unTool', 'exTool' ]
};
toolManager.setToolDefaultStates(toolDefaultStates);
// Using setActiveTool with no arguments activates the
// default tool on all available viewports
toolManager.setActiveTool();
toolsShown = false;
} else {
// Show the tools (reload previous states)
toolManager.setToolDefaultStates(previousStates);
// Using setActiveTool with no elements specified activates
// the specified tool on all available viewports
toolManager.setActiveTool(previousActiveTool);
toolsShown = true;
}
};