OHIF / Viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
https://docs.ohif.org/
MIT License
3.08k stars 3.25k forks source link

[Bug] Incorrect zoom value shown in the overlay #4077

Open syed-qure opened 4 months ago

syed-qure commented 4 months ago

Describe the Bug

The zoom value that is calculated and shown in the ViewportsOverlay component does not match with the viewport.getZoom() value.

Steps to Reproduce

  1. Open a study and not the zoom value in the bottom left corner.
  2. Go to console, get the enabledElement and get the zoom value from viewport object
    enabledElement.viewport.getZoom()
Screenshot 2024-05-02 at 10 04 26 AM

The current behavior

I think there is something wrong in the calculation of scale inside ViewportOverlay's updateScale function

The expected behavior

The zoom value in the ViewportOverlay component should be equal to viewport.getZoom()

OS

macOS 13.2.1 (22D68)

Node version

18.19.1

Browser

Arc v1.40.1 (49250)

syed-qure commented 4 months ago

Should I just use viewport.getZoom() and use its value in setScale inside ViewportOverlay and call it a day?

( evt: Types.EventTypes.CameraModifiedEvent ) => {
  const enabledElement = cornerstone.getEnabledElement( evt.element );
  const { viewport } = enabledElement;

  setScale( viewport.getZoom() );
}