From 0baf18dcb2985378016236b735329346a851e14f Mon Sep 17 00:00:00 2001 From: Igor Octaviano Date: Thu, 3 Dec 2020 14:11:14 -0300 Subject: [PATCH] fix: reset VOI on mpr reset (#2115) Co-authored-by: Davide Punzo --- extensions/vtk/src/commandsModule.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/extensions/vtk/src/commandsModule.js b/extensions/vtk/src/commandsModule.js index 901b2a853..dcd1e2d7e 100644 --- a/extensions/vtk/src/commandsModule.js +++ b/extensions/vtk/src/commandsModule.js @@ -17,6 +17,7 @@ const { BlendMode } = Constants; const commandsModule = ({ commandsManager, UINotificationService }) => { // TODO: Put this somewhere else let apis = {}; + let defaultVOI; async function _getActiveViewportVTKApi(viewports) { const { @@ -119,9 +120,11 @@ const commandsModule = ({ commandsManager, UINotificationService }) => { return apis[index]; }, resetMPRView() { - apis.forEach(api => { - api.resetOrientation(); - }); + // Reset orientation + apis.forEach(api => api.resetOrientation()); + + // Reset VOI + if (defaultVOI) setVOI(defaultVOI); // Reset the crosshairs apis[0].svgWidgets.rotatableCrosshairsWidget.resetCrosshairs(apis, 0); @@ -172,7 +175,7 @@ const commandsModule = ({ commandsManager, UINotificationService }) => { segmentNumber, frameIndex, frame, - done = () => {}, + done = () => { }, }) => { let api = apis[viewports.activeViewportIndex]; @@ -387,6 +390,7 @@ const commandsModule = ({ commandsManager, UINotificationService }) => { // Get current VOI if cornerstone viewport. const cornerstoneVOI = getVOIFromCornerstoneViewport(); + defaultVOI = cornerstoneVOI; const viewportProps = [ {