allen-cell-animated / volume-viewer

https://allen-cell-animated.github.io/volume-viewer/
Other
90 stars 7 forks source link

Error: multiscale level does not fit in preferred memory footprint #217

Open krokicki opened 1 month ago

krokicki commented 1 month ago

Description

First of all, this is an amazing 3d viewer! Something happened in the last update though, where I can no longer load my OME-Zarrs.

For example, this link used to work: https://allen-cell-animated.github.io/website-3d-cell-viewer/viewer?url=https%3A%2F%2Fjanelia-flylight-imagery-dev.s3.amazonaws.com%2FFly-eFISH%2FNP01_1_1_SS00790_AstA546_CCHa1_647_1x_LOL.chunked.zarr%2F0

But now it throws an error, although nothing has changed about my hardware or data:

VolumeLoadError: Volume is too large; multiscale level does not fit in preferred memory footprint. No scale level is available for this volume which fits within our maximum GPU memory footprint. This maximum is tuned to ensure compatibility with the majority of browsers. If you're trying to load your own OME-Zarr dataset, you may be able to open this volume by including a lower scale level.

In the console I see this:

Volume is too large; no multiscale level found that fits in preferred memory footprint. 
Selected level 3  has dimensions Array(3) [ 752, 240, 240 ]. 
Max atlas edge allowed is undefined.

I'm wondering if the issue is the undefined maxAtlasEdge?

Expected Behavior

I would expect at least the lowest scale level to load. The scale level 3 data is definitely small enough to git into my GPU memory.

Reproduction

See link above.

Environment

Firefox 126.0.1, macOS 13.6.1, AMD Radeon Pro Vega II 32 GB.

toloudis commented 1 week ago

Thank you for reporting this!

We are currently thinking about making a fix for this to go back to the old behavior. The code is being extra careful to not allocate huge gpu textures or huge amounts of cpu memory. Indeed we will probably remove the error condition, change it to a console warning, and just try to load the lowest multiresolution level.

(Not sure why max atlas edge was "undefined" but we will look into that.)

JohnGrime commented 1 week ago

On a related topic, if I may ...

We're trying to use (multi-resolution) Zarr files with Volume Viewer and I was wondering if there's a way for the user to specify the level of the image pyramid that is used for visualization, or even to allow for dynamic display of higher-res images as the user zooms in on the data?

Thanks! :)

toloudis commented 1 week ago

You can't explicitly select your multiresolution level right now. The main reason is that we are trying to pick the level automatically to maintain performance within a reasonable memory footprint. (In principle I believe you SHOULD be allowed to explicitly choose this if you know what you're doing).

Currently there is a "secret" advanced settings dialog which you can access by clicking ctrl-alt-1 . In there there's a setting to bias the selection of multiresolution level so if you set the bias correctly it should load a higher or lower resolution. The same dialog also has a "maxAtlasSize" setting which lets you basically dial in the texture memory we are using for the gpu volume data. That will also indicate to the viewer that it can pick a higher or lower resolution level.

Dynamically changing resolution with zoom is of course a very interesting feature but we haven't started to go down that road yet.