ohif-viewer/Packages/lesiontracker/lib/toggleLesionTrackerTools.js
Evren Ozkan 8fb0695097 Bi-directional tool callout is reattached to the nearest control point,
Bi-directional tool is added to hide/show tool
2015-12-18 17:11:34 -05:00

41 lines
1.1 KiB
JavaScript

/**
* Show / hide lesion tracker tools
*/
var previousStates;
var previousActiveTool;
var toolsShown = true;
toggleLesionTrackerTools = function() {
if (toolsShown === true) {
// Save the current settings for later
previousStates = toolManager.getToolDefaultStates();
previousActiveTool = toolManager.getActiveTool();
// Hide the tools (set them all to disabled)
var toolDefaultStates = {
activate: [],
deactivate: [],
enable: [],
disable: ['lesion', 'nonTarget', 'biDirectional']
};
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;
}
};