Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

[Bug] viewport overlays disappear for multiframe images when viewport initialImageOptions preset is 'middle'.

Open seandoyle opened this issue 5 months ago • 0 comments

Describe the Bug

If the viewports are configured with

            initialImageOptions: {
              preset: 'middle', // Triggers multiframe issue
            },

and the study contains multiple multi-frame images - the initial presentation of the study correctly shows the viewport overlays. But when an image icon is dragged onto the viewport - the overlays disappear.

The issue is in ohif/extensions/cornerstone/src/Viewport/Overlays/CustomizableViewportOverlay.tsx - the imageIndex passed into displaySeriesProps is the frame number of the middle slice in the multiframe image. The value of instances[imageIndex] is undefined.

CustomizableViewportOverlay's displaySetProps appears to be called twice when the images are first drawn on the screen - once with the imageIndex of zero and then with the appropriate slice number. But when an image is dragged onto the viewport only the imageIndex with the slice number is invoked. There is some other initialization that must have occurred in the images initially displayed on the screen which is not performed when images are dragged over.

Steps to Reproduce

  1. Edit extensions/default/src/getHangingProtocolModule.js. Insert
initialImageOptions: {
              preset: 'middle', // Triggers multiframe issue
            },
        into both viewports defined in this file (not sure which is used in the default basic image viewer). 
  1. Display a study with multiple multiframe images in the Basic Viewer mode.
  2. Drag an image that is not displayed in the viewport on top of the viewport.
  3. The viewport overlays disappear.

The current behavior

Viewport overlay text disappears.

The expected behavior

The viewport overlay text appears on every image.

OS

Ubuntu 20.04

Node version

v20.14.0

Browser

Chrome Version 126.0.6478.182 (Official Build) (64-bit)

seandoyle avatar Aug 26 '24 21:08 seandoyle