fix(reference-lines): Update reference lines for the latest changes in cornerstone tools

This commit is contained in:
Evren Ozkan 2018-11-29 16:02:33 -05:00
parent c7565c7037
commit 5a4deedda8
3 changed files with 10 additions and 4 deletions

View File

@ -455,7 +455,9 @@ const loadDisplaySetIntoViewport = (data, templateData) => {
if (OHIF.viewer.refLinesEnabled) { if (OHIF.viewer.refLinesEnabled) {
// ... and if reference lines are globally enabled, let cornerstoneTools know. // ... and if reference lines are globally enabled, let cornerstoneTools know.
cornerstoneTools.referenceLines.tool.enable(element, OHIF.viewer.updateImageSynchronizer); cornerstoneTools.setToolEnabledForElement(element, 'referenceLines', {
synchronizationContext: OHIF.viewer.updateImageSynchronizer
});
} }
// If the crosshairs tool is active, update the synchronizer // If the crosshairs tool is active, update the synchronizer

View File

@ -1,4 +1,5 @@
import { OHIF } from 'meteor/ohif:core'; import { OHIF } from 'meteor/ohif:core';
import { cornerstone, cornerstoneTools } from 'meteor/ohif:cornerstone';
/** /**
* This function disables reference lines for a specific viewport element. * This function disables reference lines for a specific viewport element.
@ -22,7 +23,7 @@ export function displayReferenceLines(element) {
const imagePlane = cornerstone.metaData.get('imagePlane', imageId); const imagePlane = cornerstone.metaData.get('imagePlane', imageId);
// Disable reference lines for the current element // Disable reference lines for the current element
cornerstoneTools.referenceLines.tool.disable(element); cornerstoneTools.setToolDisabledForElement(element, 'referenceLines');
if (!OHIF.viewer.refLinesEnabled || !imagePlane || !imagePlane.frameOfReferenceUID) { if (!OHIF.viewer.refLinesEnabled || !imagePlane || !imagePlane.frameOfReferenceUID) {
OHIF.log.info('displayReferenceLines refLinesEnabled is not enabled, no imagePlane or no frameOfReferenceUID'); OHIF.log.info('displayReferenceLines refLinesEnabled is not enabled, no imagePlane or no frameOfReferenceUID');
@ -46,7 +47,9 @@ export function displayReferenceLines(element) {
return; return;
} }
cornerstoneTools.referenceLines.tool.enable(viewportElement, OHIF.viewer.updateImageSynchronizer); cornerstoneTools.setToolEnabledForElement(viewportElement, 'referenceLines', {
synchronizationContext: OHIF.viewer.updateImageSynchronizer
});
} }
}); });
} }

View File

@ -56,7 +56,8 @@ export const toolManager = {
wwwcRegion: 'WwwcRegionTool', wwwcRegion: 'WwwcRegionTool',
zoomTouchPinch: 'ZoomTouchPinchTool', zoomTouchPinch: 'ZoomTouchPinchTool',
panMultiTouch: 'PanMultiTouchTool', panMultiTouch: 'PanMultiTouchTool',
stackScrollMouseWheel: 'StackScrollMouseWheelTool' stackScrollMouseWheel: 'StackScrollMouseWheelTool',
referenceLines: 'ReferenceLinesTool'
}; };
const { textStyle, toolStyle, toolColors } = cornerstoneTools; const { textStyle, toolStyle, toolColors } = cornerstoneTools;