Skip to content

ImageOverview (and visible region bounds) does not scale properly #746

@melvingelbard

Description

@melvingelbard

Bug report

Describe the bug
The visible region rectangle drawn on the ImageOverview (top right of the viewer) does not exactly match the currently visible region in the viewer. This is a problem that arises when we look at an image that has an very low width/height ratio (i.e. an image with a large height and small/average width).

This bug was first reported in this thread from image.sc.

To Reproduce
Steps to reproduce the behavior:

  1. Open an image with extreme dimensions (E.g. width = 30000 px and height = 200,000 px).
  2. Play around with the ImageOverview on the top right of the viewer.
  3. Check if the region clicked on the ImageOverview matches the currently visible region in the viewer.

Expected behavior
The ImageOverview and the 'visible-region rectangle' match the currently visible region in the viewer.

Screenshots
See the original post on image.sc.

Desktop (please complete the following information):

  • OS: All
  • QuPath v0.2.3 (and prior)

Additional context
It seems that this line is the culprit. I.e. The scale is calculated according to the preferredWidth, regardless of what the actual width of imgPreview ended up being. In the sample image from the image.sc's thread, the original height is 196,416px. The scale is calculated from the preferredWidth (150) instead of the ImageOverview's width (138) (the variable is imgPreview).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions