fix: reset VOI on mpr reset (#2115)

Co-authored-by: Davide Punzo <punzodavide@hotmail.it>
This commit is contained in:
Igor Octaviano 2020-12-03 14:11:14 -03:00 committed by GitHub
parent cca3d6bff2
commit 0baf18dcb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = [
{