-
Notifications
You must be signed in to change notification settings - Fork 337
ImageOverview (and visible region bounds) does not scale properly #746
Description
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:
- Open an image with extreme dimensions (E.g.
width= 30000 px andheight= 200,000 px). - Play around with the
ImageOverviewon the top right of the viewer. - Check if the region clicked on the
ImageOverviewmatches 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).