2016-09-20 22:47:44 +02:00
|
|
|
import { OHIF } from 'meteor/ohif:core';
|
|
|
|
|
|
2015-12-19 04:24:00 +01:00
|
|
|
/**
|
|
|
|
|
* Sets all tool data entries value for 'active' to false
|
|
|
|
|
* This is used to remove the active color on entire sets of tools
|
|
|
|
|
*
|
|
|
|
|
* @param element The Cornerstone element that is being used
|
|
|
|
|
* @param toolType The tooltype of the tools that will be deactivated
|
|
|
|
|
*/
|
2016-09-20 22:47:44 +02:00
|
|
|
OHIF.measurements.deactivateAllToolData = (element, toolType) => {
|
2016-09-22 20:58:29 +02:00
|
|
|
const toolData = cornerstoneTools.getToolState(element, toolType);
|
2015-12-19 04:24:00 +01:00
|
|
|
if (!toolData) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-22 20:58:29 +02:00
|
|
|
for (let i = 0; i < toolData.data.length; i++) {
|
|
|
|
|
toolData.data[i].active = false;
|
2015-12-19 04:24:00 +01:00
|
|
|
}
|
2016-01-11 11:32:20 +01:00
|
|
|
};
|