Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

[Bug] Reset breaks MPR

Open pwespi opened this issue 7 months ago • 4 comments

Describe the Bug

When clicking reset before using MPR, the viewports are black.

Steps to Reproduce

  1. https://viewer.ohif.org/viewer?StudyInstanceUIDs=1.2.840.113619.2.290.3.3767434740.232.1619607454.466&SeriesInstanceUID=2.16.840.1.114362.1.12114306.25269253871.637892513.276.716
  2. Click reset
  3. Click layout > MPR
  4. Observe that all viewports are black

Image

The current behavior

After a reset, MPR viewports are black.

The expected behavior

After a reset, MPR viewports should show data as usual.

Image

OS

macOS

Node version

lts

Browser

Chrome latest

pwespi avatar May 22 '25 15:05 pwespi

On viewer-dev.ohif.org only 1 of the 3 viewports is black.

https://viewer-dev.ohif.org/viewer?StudyInstanceUIDs=1.2.840.113619.2.290.3.3767434740.232.1619607454.466&SeriesInstanceUID=2.16.840.1.114362.1.12114306.25269253871.637892513.276.716

Image

The bug only happens if reset is the first action done. If you enter MPR first, exit again, reset, enter again MPR, then MPR works...

pwespi avatar May 22 '25 15:05 pwespi

I too was able to reproduce this issue.

jbocce avatar May 22 '25 18:05 jbocce

Yes I also experiment a similar problem, previously the reset button was restoring properly the HangingProtocol viewport settings but now seems to be reset to a default state no matter of the hanging protocol.

This probably comes on how HP is apply and/or viewport instance stores it's initial state

salimkanoun avatar May 22 '25 21:05 salimkanoun

I don't know what the root cause is, but making this change in extensions/cornerstone/src/commandsModule.ts seems to help:

- viewport.resetProperties?.();
+ const defaultProperties = viewport.getDefaultProperties();
+ viewport.setProperties(defaultProperties);

pwespi avatar May 27 '25 07:05 pwespi