Fixing handles displaying on arrow target tools

This commit is contained in:
Bruno Alves de Faria committed 2017-11-22 10:09:11 -02:00
1 parent cbc87aebf8
commit b42214d8ee
2 files changed
+16 -10

No files matched your search

@@ -19,7 +19,7 @@ var configuration = {
getMeasurementLocationCallback,
changeMeasurementLocationCallback,
drawHandles: false,
drawHandlesOnHover: false,
drawHandlesOnHover: true,
arrowFirst: true,
textBox: textBoxConfig
};
@@ -33,15 +33,21 @@ OHIF.lesiontracker.configureTargetToolsHandles = () => {
changeMeasurementLocationCallback: toggleLabel,
};
// TODO: Reconcile this with the configuration in toolManager
// it would be better to have this all in one place.
const bidirectionalConfig = cornerstoneTools.bidirectional.getConfiguration();
const config = Object.assign({}, bidirectionalConfig, callbackConfig);
// TODO: Reconcile this with the configuration in toolManager it would be better to have this
// all in one place.
const appendConfig = toolType => {
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
cornerstoneTools.targetCR.setConfiguration(config);
cornerstoneTools.targetUN.setConfiguration(config);
cornerstoneTools.targetEX.setConfiguration(config);
// Append the callback configuration to bidirectional tool
appendConfig('bidirectional');
// Append the callback configuration to CR, UN and EX tools
appendConfig('targetCR');
appendConfig('targetUN');
appendConfig('targetEX');
};