Repository navigation
Conversation
Add image downsampling functionality and adjust rendering timeout in DatasetTile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds efficient image downsampling to the spatial viewer, reducing the amount of image data sent to the browser and improving performance, especially for large images. It also simplifies how dimmed background images are handled by sharing a single image source across plots and applying opacity at the renderer level, rather than creating separate copies. Additionally, the pull request increases the maximum wait time for tile rendering in the frontend.
Image downsampling and performance improvements:
downsample_imageutility inservices/spatial/common.pyto shrink images so their longest side does not exceed a configurable maximum, reducing payload size sent to the browser. This is used when loading and updating images in the spatial viewer. [1] [2] [3] [4]MAX_DISPLAY_IMAGE_DIMclass variable inBaseSpatialViewerand set it to a lower value (2000) inCondensedSpatialViewer, allowing different resolutions for different viewer types. [1] [2]Dimmed image handling simplification:
_build_dimmed_arraymethod and now apply dimming using the renderer'sglobal_alphaproperty, sharing a single image array across all plots to avoid redundant image copies and reduce memory usage. [1] [2] [3]Frontend rendering adjustment:
www/js/classes/tilegrid.jsfrom 1 minute to 3 minutes to better accommodate slow renders.