fix: reset VOI on mpr reset (#2115)
Co-authored-by: Davide Punzo <punzodavide@hotmail.it>
This commit is contained in:
parent
cca3d6bff2
commit
0baf18dcb2
@ -17,6 +17,7 @@ const { BlendMode } = Constants;
|
|||||||
const commandsModule = ({ commandsManager, UINotificationService }) => {
|
const commandsModule = ({ commandsManager, UINotificationService }) => {
|
||||||
// TODO: Put this somewhere else
|
// TODO: Put this somewhere else
|
||||||
let apis = {};
|
let apis = {};
|
||||||
|
let defaultVOI;
|
||||||
|
|
||||||
async function _getActiveViewportVTKApi(viewports) {
|
async function _getActiveViewportVTKApi(viewports) {
|
||||||
const {
|
const {
|
||||||
@ -119,9 +120,11 @@ const commandsModule = ({ commandsManager, UINotificationService }) => {
|
|||||||
return apis[index];
|
return apis[index];
|
||||||
},
|
},
|
||||||
resetMPRView() {
|
resetMPRView() {
|
||||||
apis.forEach(api => {
|
// Reset orientation
|
||||||
api.resetOrientation();
|
apis.forEach(api => api.resetOrientation());
|
||||||
});
|
|
||||||
|
// Reset VOI
|
||||||
|
if (defaultVOI) setVOI(defaultVOI);
|
||||||
|
|
||||||
// Reset the crosshairs
|
// Reset the crosshairs
|
||||||
apis[0].svgWidgets.rotatableCrosshairsWidget.resetCrosshairs(apis, 0);
|
apis[0].svgWidgets.rotatableCrosshairsWidget.resetCrosshairs(apis, 0);
|
||||||
@ -387,6 +390,7 @@ const commandsModule = ({ commandsManager, UINotificationService }) => {
|
|||||||
|
|
||||||
// Get current VOI if cornerstone viewport.
|
// Get current VOI if cornerstone viewport.
|
||||||
const cornerstoneVOI = getVOIFromCornerstoneViewport();
|
const cornerstoneVOI = getVOIFromCornerstoneViewport();
|
||||||
|
defaultVOI = cornerstoneVOI;
|
||||||
|
|
||||||
const viewportProps = [
|
const viewportProps = [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user