Fixing issues with bidirectional tool and measure flow

This commit is contained in:
Bruno Alves de Faria committed 2018-02-27 07:25:15 -03:00
1 parent 797b2f5588
commit 00a76a6ca5
10 files changed
+85 -75

No files matched your search

@@ -8,7 +8,7 @@ export class StackImagePositionOffsetSynchronizer {
constructor() {
this.active = false;
this.syncedViewports = [];
this.synchronizer = new cornerstoneTools.Synchronizer('CornerstoneNewImage', cornerstoneTools.stackImagePositionOffsetSynchronizer);
this.synchronizer = new cornerstoneTools.Synchronizer('cornerstonenewimage', cornerstoneTools.stackImagePositionOffsetSynchronizer);
}
static get ELEMENT_DISABLED_EVENT() {
@@ -3,6 +3,7 @@ import { Session } from 'meteor/session';
import { Random } from 'meteor/random';
import { $ } from 'meteor/jquery';
import { OHIF } from 'meteor/ohif:core';
import { cornerstone, cornerstoneTools } from 'meteor/ohif:cornerstone';
import { getFrameOfReferenceUID } from './getFrameOfReferenceUID';
import { updateCrosshairsSynchronizer } from './updateCrosshairsSynchronizer';
import { crosshairsSynchronizers } from './crosshairsSynchronizers';
@@ -344,18 +345,21 @@ export const toolManager = {
if (button === 'left') {
newToolIdLeft = toolId;
}
const newCornerstoneToolLeft = tools[newToolIdLeft]; // left mouse tool is used for touch as well
let newToolIdMiddle = activeTool.middle;
if (button === 'middle') {
newToolIdMiddle = toolId;
}
const newCornerstoneToolMiddle = cornerstoneTools[newToolIdMiddle];
let newToolIdRight = activeTool.right;
if (button === 'right') {
newToolIdRight = toolId;
}
const newCornerstoneToolRight = cornerstoneTools[newToolIdRight];
// Deactivate scroll wheel tools
@@ -4,12 +4,12 @@ import { crosshairsSynchronizers } from './crosshairsSynchronizers';
/**
* This function is used to maintain the updateImageSynchronizers
* that are using in the Crosshair tool. The function creates
* that are using in the Crosshair tool. The function creates
* (and destroys any currently existing) a new synchronizer for the given
* frame of reference. It then searches for other viewports that share the same
* frame of reference, and adds those to the synchronizer. These viewports
* will now function together when the Crosshair tool is used.
*
*
* @param currentFrameOfReferenceUID
*/
export function updateCrosshairsSynchronizer(currentFrameOfReferenceUID) {
@@ -21,10 +21,10 @@ import { crosshairsSynchronizers } from './crosshairsSynchronizers';
synchronizer.destroy();
} else {
// Create a new synchronizer
crosshairsSynchronizers.synchronizers[currentFrameOfReferenceUID] = new cornerstoneTools.Synchronizer("CornerstoneNewImage", cornerstoneTools.updateImageSynchronizer);
crosshairsSynchronizers.synchronizers[currentFrameOfReferenceUID] = new cornerstoneTools.Synchronizer('cornerstonenewimage', cornerstoneTools.updateImageSynchronizer);
synchronizer = crosshairsSynchronizers.synchronizers[currentFrameOfReferenceUID];
}
// Add all elements that stem from the same frame of reference
$('.imageViewerViewport').each((index, element) => {
const frameOfReferenceUID = getFrameOfReferenceUID(element);