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 }) => {
|
||||
// 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 = [
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user