Skip to content

[Bug] Resize and setDisplayArea does not work with rotation #2529

@LadislavBohm

Description

@LadislavBohm

Describe the Bug

When you rotate you image and call resize it seems to reset camera and does not respect rotation. I would expect it to try to fit image to center of viewport.

I tried running example for resize and it doesn't seem to do anything:
https://www.cornerstonejs.org/live-examples/resize

In the example whatever I do and press reset nothing happens and is not synchronized.

My requirement seems to be simple. I need image fit image to viewport to center while preserving rotations/flips. I think I tried all imaginable combinations of following:

  • setCamera
  • setDisplayArea
  • resize
  • resetCamera (resets rotations for some reason)
  • setViewPresentation (applies rotation but image does not fit width again)

Steps to Reproduce

  1. Render image
  2. Rotate by 90 degrees for example
  3. Zoom in
  4. Try to reset image to fit viewport

The current behavior

Image got it's camera (or at least rotation) reset and resize does not work as expected

The expected behavior

Option to keep camera/presentation as-is just fit image to viewport

System Information

  • cornerstone 4.15.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions