viv icon indicating copy to clipboard operation
viv copied to clipboard

The overview uses the smallest available image size and not the best one

Open andreasg123 opened this issue 4 years ago • 5 comments
trafficstars

Describe the bug

bioformats2raw produces very small images at the lowest level of the image pyramid. In one sample image (about 70,000 pixels in the larger dimension), the smallest image was 63x136. The overview happened to be twice that large in each dimension. However, it loaded the smallest available image, making the overview look pixelated. Making bioformats2raw produce fewer levels would require determining the image dimensions upfront to specify the number of resolutions, an undesirable option given the many different possible input formats.

Expected behavior

OverviewView._setHeightWidthScale pretty much computes the best zoom level. However, OverviewView.filterViewState uses instead -(this.loader.length - 1) as the zoom level.

Environment:

  • Release or git hash: 0.10.3
  • Browser: Chrome

andreasg123 avatar Aug 27 '21 01:08 andreasg123

What about exposing this behavior as a parameter, with the suggested change as default behavior? My guess is that most images will be generated with bioformats2raw, but some may not.

manzt avatar Nov 04 '21 18:11 manzt

@andreasg123 If you want to see this done, would you be willing to open a PR? It sounds like you understand the problem well (thank you very much for poring over my code). I think you would need to update the underlying layer as well to fetch the right zoom level.

ilan-gold avatar Nov 09 '21 15:11 ilan-gold

I could do it, but not for at least another week.

ilan-gold avatar Nov 09 '21 15:11 ilan-gold

As for @manzt's comment, I don't feel strongly. Exposing things can create more work in the future due to maintenance or prevent work from needing to be done for exposing the API.

ilan-gold avatar Nov 09 '21 15:11 ilan-gold

@ilan-gold, I'll see if I can find time to do this. I don't think that this needs to be a parameter because the behavior that I proposed matches what the detail view does.

andreasg123 avatar Nov 09 '21 17:11 andreasg123