Skip to content

Improve display histogram level choice#1982

Merged
petebankhead merged 1 commit intoqupath:mainfrom
petebankhead:histogram-levels
Aug 23, 2025
Merged

Improve display histogram level choice#1982
petebankhead merged 1 commit intoqupath:mainfrom
petebankhead:histogram-levels

Conversation

@petebankhead
Copy link
Member

@petebankhead petebankhead commented Aug 22, 2025

Avoid using extremely small pyramid levels when calculating histograms for the image display.

The simple heuristic is that we choose the highest resolution that gives us an image with no more than 1024x1024 pixels - or the lowest resolution level, if no level satisfies this rule.
Previously we always chose the lowest-resolution in QuPath v0.6.0.

This addresses #1958
With the PR, the image from https://zenodo.org/records/16569043 displays sensibly.

But it also makes a difference for common OpenSlide test images OS-2.ndpi and similar.
It seems their lowest resolution level has a downsample of 4096, and dimensions of 31x18 pixels.
So histograms generated from these were terrible.
Therefore this PR helps the Brightness/Contrast dialog behave more sensibly with these images too, selecting from resolution level 8 of 13 (rather than 13).

Examples for the hematoxylin image, extracted from OS-2.ndpi using default stain vectors:

In v0.6.0
Screenshot 2025-08-22 at 16 53 51

With this PR
Screenshot 2025-08-22 at 16 54 05

Avoid using extremely small pyramid levels when calculating histograms for the image display.
@petebankhead petebankhead added this to the v0.7.0 milestone Aug 22, 2025
@petebankhead petebankhead merged commit c58eacd into qupath:main Aug 23, 2025
5 of 6 checks passed
@petebankhead petebankhead deleted the histogram-levels branch August 23, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant