Skip to content

Helpful additions + bugfixes - #1310

Merged
adkinsrs merged 7 commits into
mainfrom
devel
Aug 7, 2026
Merged

Helpful additions + bugfixes#1310
adkinsrs merged 7 commits into
mainfrom
devel

Conversation

@adkinsrs

@adkinsrs adkinsrs commented Aug 7, 2026

Copy link
Copy Markdown
Member

This pull request introduces several improvements to spatial image handling and UI flexibility in the spatial panel viewer. The main changes add support for multiple image channels, enable dynamic switching between them in the UI, refactor image opacity handling, and streamline color mapping logic. Additionally, there are minor dependency updates and bug fixes.

Spatial image channel support and UI enhancements:

  • Added a function list_image_channels to enumerate available image channels for a dataset, and integrated it into the viewer initialization (services/spatial/common.py, services/spatial/panel_common.py). [1] [2]
  • Introduced a channel selection dropdown widget (channel_select) that appears when multiple channels are available, with a callback to update displayed images when the selection changes (services/spatial/panel_common.py). [1] [2] [3] [4] [5]
  • Refactored image opacity/dimming logic into a reusable method _build_dimmed_array, and ensured the correct image channel and opacity are used throughout the viewer (services/spatial/panel_common.py). [1] [2]

Backend and color mapping improvements:

  • Updated the color mapping logic to use a boolean found_img flag instead of passing image arrays, simplifying checks for image presence and improving maintainability (www/api/resources/spatialpanel.py). [1] [2] [3] [4]
  • Improved the CSV caching and image presence detection logic in the spatial panel API, providing clearer messages and error handling (www/api/resources/spatialpanel.py). [1] [2]

Dependency and minor code updates:

  • Updated the panel library dependency from version 1.8.10 to 1.9.3 in docker/requirements.txt.
  • Added docstrings and improved parameter handling in utility functions (services/spatial/common.py).
  • Removed unused imports and cleaned up legacy code (services/spatial/panel_common.py, www/api/resources/available_display_types.py). [1] [2] [3]

These changes collectively make the spatial panel viewer more flexible and robust, especially for datasets with multiple image channels, and improve the clarity and maintainability of the codebase.

@adkinsrs
adkinsrs merged commit ac0ebf5 into main Aug 7, 2026
7 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