Skip to content

Spatial memory improvements - #1357

Merged
adkinsrs merged 2 commits into
mainfrom
devel
Oct 30, 2026
Merged

adkinsrs merged 2 commits into
mainfrom
devel

Conversation

@adkinsrs

Copy link
Copy Markdown
Member

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:

  • Added a downsample_image utility in services/spatial/common.py to 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]
  • Introduced MAX_DISPLAY_IMAGE_DIM class variable in BaseSpatialViewer and set it to a lower value (2000) in CondensedSpatialViewer, allowing different resolutions for different viewer types. [1] [2]

Dimmed image handling simplification:

  • Removed the _build_dimmed_array method and now apply dimming using the renderer's global_alpha property, sharing a single image array across all plots to avoid redundant image copies and reduce memory usage. [1] [2] [3]

Frontend rendering adjustment:

  • Increased the maximum polling wait time for tile rendering in www/js/classes/tilegrid.js from 1 minute to 3 minutes to better accommodate slow renders.

Add image downsampling functionality and adjust rendering timeout in DatasetTile
@adkinsrs
adkinsrs merged commit 2607f04 into main Oct 30, 2026
11 checks passed
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