Removing targetEX tool references
This commit is contained in:
parent
5bc294f3a9
commit
c80b25aeef
@ -11,7 +11,6 @@ const toolTypes = [
|
|||||||
'bidirectional',
|
'bidirectional',
|
||||||
'targetCR',
|
'targetCR',
|
||||||
'targetUN',
|
'targetUN',
|
||||||
'targetEX',
|
|
||||||
'nonTarget',
|
'nonTarget',
|
||||||
'length',
|
'length',
|
||||||
'ellipticalRoi',
|
'ellipticalRoi',
|
||||||
@ -100,4 +99,6 @@ function keyDownCallback(event, eventData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// module/private exports
|
// module/private exports
|
||||||
cornerstoneTools.deleteLesionKeyboardTool = cornerstoneTools.keyboardTool(keyDownCallback);
|
const tool = cornerstoneTools.keyboardTool(keyDownCallback);
|
||||||
|
tool.toolTypes = toolTypes;
|
||||||
|
cornerstoneTools.deleteLesionKeyboardTool = tool;
|
||||||
|
|||||||
@ -1,18 +1,8 @@
|
|||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
import { Viewerbase } from 'meteor/ohif:viewerbase';
|
||||||
import { cornerstone, cornerstoneMath, cornerstoneTools } from 'meteor/ohif:cornerstone';
|
import { cornerstone, cornerstoneMath, cornerstoneTools } from 'meteor/ohif:cornerstone';
|
||||||
|
|
||||||
var responseByToolType = [{
|
const toolDefaultStates = Viewerbase.toolManager.getToolDefaultStates();
|
||||||
"toolType": "targetCR",
|
|
||||||
"toolResponse": "CR"
|
|
||||||
}, {
|
|
||||||
"toolType": "targetUN",
|
|
||||||
"toolResponse": "UN"
|
|
||||||
}, {
|
|
||||||
"toolType": "targetEX",
|
|
||||||
"toolResponse": "EX"
|
|
||||||
}];
|
|
||||||
|
|
||||||
const toolDefaultStates = OHIF.viewerbase.toolManager.getToolDefaultStates();
|
|
||||||
const textBoxConfig = toolDefaultStates.textBoxConfig;
|
const textBoxConfig = toolDefaultStates.textBoxConfig;
|
||||||
|
|
||||||
var configuration = {
|
var configuration = {
|
||||||
@ -40,18 +30,12 @@ function changeMeasurementLocationCallback(measurementData, eventData, doneCallb
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function createQualitativeTargetTool(toolType) {
|
function createQualitativeTargetTool(toolType, responseText='') {
|
||||||
var toolInterface = {
|
var toolInterface = {
|
||||||
toolType: toolType
|
toolType: toolType
|
||||||
};
|
};
|
||||||
|
|
||||||
var response;
|
var response = responseText;
|
||||||
|
|
||||||
responseByToolType.forEach(function(tool) {
|
|
||||||
if (tool.toolType === toolInterface.toolType) {
|
|
||||||
response = tool.toolResponse;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/// --- Mouse Tool --- ///
|
/// --- Mouse Tool --- ///
|
||||||
///////// BEGIN ACTIVE TOOL ///////
|
///////// BEGIN ACTIVE TOOL ///////
|
||||||
@ -497,17 +481,14 @@ function createQualitativeTargetTool(toolType) {
|
|||||||
return toolInterface;
|
return toolInterface;
|
||||||
}
|
}
|
||||||
|
|
||||||
var targetCRInterface = createQualitativeTargetTool('targetCR');
|
var targetCRInterface = createQualitativeTargetTool('targetCR', 'CR');
|
||||||
cornerstoneTools.targetCR = targetCRInterface.mouse;
|
cornerstoneTools.targetCR = targetCRInterface.mouse;
|
||||||
cornerstoneTools.targetCR.setConfiguration(configuration);
|
cornerstoneTools.targetCR.setConfiguration(configuration);
|
||||||
cornerstoneTools.targetCRTouch = targetCRInterface.touch;
|
cornerstoneTools.targetCRTouch = targetCRInterface.touch;
|
||||||
|
|
||||||
var targetUNInterface = createQualitativeTargetTool('targetUN');
|
var targetUNInterface = createQualitativeTargetTool('targetUN', 'UN');
|
||||||
cornerstoneTools.targetUN = targetUNInterface.mouse;
|
cornerstoneTools.targetUN = targetUNInterface.mouse;
|
||||||
cornerstoneTools.targetUN.setConfiguration(configuration);
|
cornerstoneTools.targetUN.setConfiguration(configuration);
|
||||||
cornerstoneTools.targetUNTouch = targetUNInterface.touch;
|
cornerstoneTools.targetUNTouch = targetUNInterface.touch;
|
||||||
|
|
||||||
var targetEXInterface = createQualitativeTargetTool('targetEX');
|
OHIF.lesiontracker.createQualitativeTargetTool = createQualitativeTargetTool;
|
||||||
cornerstoneTools.targetEX = targetEXInterface.mouse;
|
|
||||||
cornerstoneTools.targetEX.setConfiguration(configuration);
|
|
||||||
cornerstoneTools.targetEXTouch = targetEXInterface.touch;
|
|
||||||
|
|||||||
@ -46,8 +46,7 @@ OHIF.lesiontracker.configureTargetToolsHandles = () => {
|
|||||||
// Append the callback configuration to bidirectional tool
|
// Append the callback configuration to bidirectional tool
|
||||||
appendConfig('bidirectional');
|
appendConfig('bidirectional');
|
||||||
|
|
||||||
// Append the callback configuration to CR, UN and EX tools
|
// Append the callback configuration to CR and UN tools
|
||||||
appendConfig('targetCR');
|
appendConfig('targetCR');
|
||||||
appendConfig('targetUN');
|
appendConfig('targetUN');
|
||||||
appendConfig('targetEX');
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -23,7 +23,7 @@ OHIF.lesiontracker.toggleLesionTrackerTools = () => {
|
|||||||
activate: ['deleteLesionKeyboardTool'],
|
activate: ['deleteLesionKeyboardTool'],
|
||||||
deactivate: [],
|
deactivate: [],
|
||||||
enable: [],
|
enable: [],
|
||||||
disable: [ 'bidirectional', 'nonTarget', 'length', 'targetCR', 'targetUN', 'targetEX' ]
|
disable: ['bidirectional', 'nonTarget', 'length', 'targetCR', 'targetUN']
|
||||||
};
|
};
|
||||||
|
|
||||||
toolManager.setToolDefaultStates(toolDefaultStates);
|
toolManager.setToolDefaultStates(toolDefaultStates);
|
||||||
@ -53,8 +53,8 @@ OHIF.lesiontracker.toggleLesionTrackerToolsButtons = (isEnabled) => {
|
|||||||
toolStates.disabledToolButtons = [];
|
toolStates.disabledToolButtons = [];
|
||||||
OHIF.lesiontracker.toggleLesionTrackerToolsHotKeys(true);
|
OHIF.lesiontracker.toggleLesionTrackerToolsHotKeys(true);
|
||||||
} else {
|
} else {
|
||||||
toolStates.disabledToolButtons = [ 'bidirectional', 'nonTarget', 'targetCR', 'targetUN', 'targetEX',
|
toolStates.disabledToolButtons = ['bidirectional', 'nonTarget', 'targetCR', 'targetUN',
|
||||||
'toggleHUD', 'toggleTrial', 'toolbarSectionEntry', 'toggleMeasurements' ];
|
'toggleHUD', 'toggleTrial', 'toolbarSectionEntry', 'toggleMeasurements'];
|
||||||
OHIF.lesiontracker.toggleLesionTrackerToolsHotKeys(false);
|
OHIF.lesiontracker.toggleLesionTrackerToolsHotKeys(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -34,28 +34,23 @@ Meteor.startup(function() {
|
|||||||
touch: cornerstoneTools.targetUNTouch
|
touch: cornerstoneTools.targetUNTouch
|
||||||
});
|
});
|
||||||
|
|
||||||
toolManager.addTool('targetEX', {
|
|
||||||
mouse: cornerstoneTools.targetEX,
|
|
||||||
touch: cornerstoneTools.targetEXTouch
|
|
||||||
});
|
|
||||||
|
|
||||||
// Update default state for tools making sure each tool is only inserted once
|
// Update default state for tools making sure each tool is only inserted once
|
||||||
let currentDefaultStates = toolManager.getToolDefaultStates();
|
let currentDefaultStates = toolManager.getToolDefaultStates();
|
||||||
let newDefaultStates = {
|
let newDefaultStates = {
|
||||||
enable: [ 'scaleOverlayTool' ],
|
enable: [ 'scaleOverlayTool' ],
|
||||||
deactivate: ['bidirectional', 'nonTarget', 'length', 'targetCR', 'targetUN', 'targetEX'],
|
deactivate: ['bidirectional', 'nonTarget', 'length', 'targetCR', 'targetUN'],
|
||||||
activate: ['deleteLesionKeyboardTool']
|
activate: ['deleteLesionKeyboardTool']
|
||||||
};
|
};
|
||||||
|
|
||||||
for (let state in newDefaultStates) {
|
Object.keys(newDefaultStates).forEach(state => {
|
||||||
newDefaultStates[state].forEach(function(tool) {
|
newDefaultStates[state].forEach(tool => {
|
||||||
let tools = currentDefaultStates[state];
|
let tools = currentDefaultStates[state];
|
||||||
// make sure each tool is only inserted once
|
// make sure each tool is only inserted once
|
||||||
if (tools && tools.indexOf(tool) < 0) {
|
if (tools && tools.indexOf(tool) < 0) {
|
||||||
tools.push(tool);
|
tools.push(tool);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
|
|
||||||
toolManager.setToolDefaultStates(currentDefaultStates);
|
toolManager.setToolDefaultStates(currentDefaultStates);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user