Fixing handles displaying on arrow target tools

This commit is contained in:
Bruno Alves de Faria 2017-11-22 10:09:11 -02:00
parent cbc87aebf8
commit b42214d8ee
2 changed files with 16 additions and 10 deletions

View File

@ -19,7 +19,7 @@ var configuration = {
getMeasurementLocationCallback, getMeasurementLocationCallback,
changeMeasurementLocationCallback, changeMeasurementLocationCallback,
drawHandles: false, drawHandles: false,
drawHandlesOnHover: false, drawHandlesOnHover: true,
arrowFirst: true, arrowFirst: true,
textBox: textBoxConfig textBox: textBoxConfig
}; };

View File

@ -33,15 +33,21 @@ OHIF.lesiontracker.configureTargetToolsHandles = () => {
changeMeasurementLocationCallback: toggleLabel, changeMeasurementLocationCallback: toggleLabel,
}; };
// TODO: Reconcile this with the configuration in toolManager // TODO: Reconcile this with the configuration in toolManager it would be better to have this
// it would be better to have this all in one place. // all in one place.
const bidirectionalConfig = cornerstoneTools.bidirectional.getConfiguration(); const appendConfig = toolType => {
const config = Object.assign({}, bidirectionalConfig, callbackConfig); const tool = cornerstoneTools[toolType];
const toolConfig = tool.getConfiguration();
const config = Object.assign({}, toolConfig, callbackConfig);
cornerstoneTools.bidirectional.setConfiguration(config); tool.setConfiguration(config);
};
// Set CR-Tool, UN-Tool, EX-Tool configurations // Append the callback configuration to bidirectional tool
cornerstoneTools.targetCR.setConfiguration(config); appendConfig('bidirectional');
cornerstoneTools.targetUN.setConfiguration(config);
cornerstoneTools.targetEX.setConfiguration(config); // Append the callback configuration to CR, UN and EX tools
appendConfig('targetCR');
appendConfig('targetUN');
appendConfig('targetEX');
}; };