2017-06-13 09:59:01 +02:00
|
|
|
import { OHIF } from 'meteor/ohif:core'
|
2016-09-20 22:47:44 +02:00
|
|
|
|
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
|
|
|
|
|
*/
|
2016-11-12 17:52:12 +01:00
|
|
|
OHIF.measurements.deactivateAllToolData = () => {
|
2017-06-13 09:59:01 +02:00
|
|
|
const toolState = cornerstoneTools.globalImageIdSpecificToolStateManager.saveToolState()
|
2015-12-19 04:24:00 +01:00
|
|
|
|
2017-06-13 09:59:01 +02:00
|
|
|
Object.keys(toolState).forEach(imageId => {
|
|
|
|
|
const toolData = toolState[imageId];
|
2016-11-12 17:52:12 +01:00
|
|
|
|
2017-06-13 09:59:01 +02:00
|
|
|
Object.keys(toolData).forEach(toolType => {
|
|
|
|
|
const specificToolData = toolData[toolType]
|
|
|
|
|
if (!specificToolData || !specificToolData.data || !specificToolData.data.length) {
|
|
|
|
|
return
|
|
|
|
|
}
|
2016-11-12 17:52:12 +01:00
|
|
|
|
2017-06-13 09:59:01 +02:00
|
|
|
specificToolData.data.forEach(data => {
|
|
|
|
|
data.active = false
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
cornerstoneTools.globalImageIdSpecificToolStateManager.restoreToolState(toolState)
|
|
|
|
|
}
|