Skip to content

Select channels#365

Closed
melonora wants to merge 56 commits into
scverse:refactor_list_widgetsfrom
melonora:select_channels
Closed

Select channels#365
melonora wants to merge 56 commits into
scverse:refactor_list_widgetsfrom
melonora:select_channels

Conversation

@melonora
Copy link
Copy Markdown
Collaborator

@melonora melonora commented Jun 6, 2025

Users currently don't have the option to select to load individual channels. While the table widget is nice for when working with rasterizations that don't result in large images, for spatial proteomics data in which each channel is large, this is not a nice experience.
This PR presents a first way of improving this.

The channel element widget has the following characteristics:

It updates upon selection chance in the element widget
It has no issues with multiple spatialdata objects as it is based on current selected element
When adding a layer this way, there is a suffix _ch:channel_name.
In addition to that, this PR has removed the colorbar slider in order to make more space for the new widget.

Lastly, this PR fixes a bug of coordinate systems in the CoordinateSystemWidget not being de-duplicated in case of loading multiple SpatialData objects.

melonora and others added 30 commits March 28, 2024 09:05
Given that the code is private and we know which function is used for which widget I removed the overhead
that the wrapper creates
* simplify conditional

* bump version, change to ctrl+l

* add bermuda

* add blog post

* correct doc reference

* use export_figure

* remove argument

* match type hint

* verify path

* update artefact path

* revert viewer theme change

* check readthedocs with pydanticv2

* constrain dask

* constrain dask

* attempt fix mac

* add warning

* change caplog index

* change access of deprecated _dock_widgets access
LucaMarconato and others added 12 commits August 15, 2025 20:47
* simplify conditional

* small changes for zarrv3 spatialdata

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* bump mins: python, spatialdata, dask

* fix min dask

* bump napari-matplotlib, bump python mins

* fix test scatterplot hover

* fix seeds in tests

* attempt fix readthedocs install

* attempt fix readsthedocs

* pre-release install in benchmark job

* bump anndata and spatialdata mins

* fix

* attempt fix benchmark job

* remove benchmarks section from test.yaml
updates:
- [github.com/pre-commit/mirrors-mypy: v1.17.1 → v1.19.1](pre-commit/mirrors-mypy@v1.17.1...v1.19.1)
- https://github.com/psf/blackhttps://github.com/psf/black-pre-commit-mirror
- [github.com/psf/black-pre-commit-mirror: 25.1.0 → 25.12.0](psf/black-pre-commit-mirror@25.1.0...25.12.0)
- [github.com/asottile/blacken-docs: 1.19.1 → 1.20.0](adamchainz/blacken-docs@1.19.1...1.20.0)
- [github.com/astral-sh/ruff-pre-commit: v0.12.8 → v0.14.10](astral-sh/ruff-pre-commit@v0.12.8...v0.14.10)
- [github.com/asottile/pyupgrade: v3.20.0 → v3.21.2](asottile/pyupgrade@v3.20.0...v3.21.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: LucaMarconato <2664412+LucaMarconato@users.noreply.github.com>
…tes (scverse#380)

Bumps the actions group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4` | `6` |
| [actions/setup-python](https://github.com/actions/setup-python) | `5` | `6` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4` | `5` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `4` | `6` |
| [actions/github-script](https://github.com/actions/github-script) | `7` | `8` |



Updates `actions/checkout` from 4 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v6)

Updates `actions/setup-python` from 5 to 6
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v5...v6)

Updates `actions/upload-artifact` from 4 to 5
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v4...v5)

Updates `actions/download-artifact` from 4 to 6
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v4...v6)

Updates `actions/github-script` from 7 to 8
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@v7...v8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/github-script
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: LucaMarconato <2664412+LucaMarconato@users.noreply.github.com>
* fix tests cleanup

* remove test_aaa.py
@LucaMarconato
Copy link
Copy Markdown
Member

I'll start by merging the components of this PR that are unrelated to the new ability of adding images in single layer.

Regarding that ability, while it is important to give this feature to users, I do not like the idea of having a new widget. This will complicate development and may not be a good choice for UX. I'll explore if I find a minimal way to integrate the new functionality the existing var widget, but if not, I'll close the PR and postpone this work after redesign. In the new work the internal code regarding async loading will still be used.

LucaMarconato and others added 5 commits January 6, 2026 17:31
* better 3D and 2.5D support for raster and vector data

* fix mypy; workaround qt test (command double registration)

* fix deprecated API

* remove dask pin

* cleanup

* add tests for 3D points, 2.5D shapes; improve contribution guide

* bump min spatialdata
* fix scanpy set_default_colors_for_categorical_obs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix

* fix

* fix

* fix tests

* fix tests macos/linux

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ubuntu <ubuntu@machine.denbi.prod>
* fix docs links

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* cleanup import

* attempt fix ci

* add lowerbound spatialdata

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
LucaMarconato and others added 5 commits March 23, 2026 15:52
…erse#390)

* patch headless tests due to vispy

* improve docstring

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix precommit; fix spatialdata pre-release dep

---------

Co-authored-by: Ubuntu <ubuntu@machine.denbi.prod>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…tes (scverse#394)

Bumps the actions group with 4 updates in the / directory: [actions/upload-artifact](https://github.com/actions/upload-artifact), [actions/download-artifact](https://github.com/actions/download-artifact), [actions/github-script](https://github.com/actions/github-script) and [codecov/codecov-action](https://github.com/codecov/codecov-action).


Updates `actions/upload-artifact` from 5 to 7
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v5...v7)

Updates `actions/download-artifact` from 6 to 8
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v6...v8)

Updates `actions/github-script` from 8 to 9
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@v8...v9)

Updates `codecov/codecov-action` from 5 to 6
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/github-script
  dependency-version: '9'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: codecov/codecov-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/mirrors-mypy: v1.19.1 → v1.20.2](pre-commit/mirrors-mypy@v1.19.1...v1.20.2)
- [github.com/psf/black-pre-commit-mirror: 25.12.0 → 26.3.1](psf/black-pre-commit-mirror@25.12.0...26.3.1)
- [github.com/astral-sh/ruff-pre-commit: v0.14.10 → v0.15.12](astral-sh/ruff-pre-commit@v0.14.10...v0.15.12)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix pre-commit

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Luca Marconato <m.lucalmer@gmail.com>
* fix the Issue scverse#31

* fix Issue scverse#31

* fix Issue scverse#31

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* address review feedback PR#393

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Luca Marconato <m.lucalmer@gmail.com>
Co-authored-by: LucaMarconato <2664412+LucaMarconato@users.noreply.github.com>
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

LucaMarconato and others added 2 commits May 15, 2026 11:05
- Remove the dedicated Channels widget from SdataWidget; channel-specific
  layer loading is now triggered from the View panel instead.
- Add an 'add in new layer' checkbox inline with the Vars label. When
  checked, double-clicking a var (or a multi-selection of vars) loads each
  selected channel as a new napari layer instead of navigating the slider.
- Multi-selection support: mousePressEvent captures the pre-click selection
  so that double-clicking any already-selected item acts on the full set.
  AListWidget emits load_channels(tuple) once for all selected channels.
- Sequential queue in SdataWidget (_enqueue_channel / _process_queue):
  channels are loaded one after the other without blocking the UI or
  showing 'Please wait'. _onClick retains its original guard for
  user-initiated single-element loads.
- Fix: skip dims.set_point and _channel_changed processing when the active
  layer is a 2D channel-specific image (no channel dimension to navigate).
- Add test_add_in_new_layer_multiple_channels covering async sequential
  loading of three channels via _enqueue_channel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LucaMarconato
Copy link
Copy Markdown
Member

LucaMarconato commented May 15, 2026

Ah, I just noticed that this PR is not opened against main. I'll close and reopen against main (#395).

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.

3 participants