scverse / scverse/napari-spatialdata

The channel slider works only for a single channel image.

Open
#273 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

macos
Dominant language
Python
Stars
90
Forks
25
Avg merge
22m
Merged PRs (30d)
1

Description

When adding two images, the channel slider (bottom of the interface) doesn't work on the second image; to fix one needs to first delete the first image.

To reproduce, run the code:

from spatialdata import SpatialData
from spatialdata.models import Image2DModel
from napari_spatialdata import Interactive
from numpy.random import default_rng

RNG = default_rng(0)
image0 = Image2DModel.parse(RNG.random((5, 100, 100)))
image1 = Image2DModel.parse(RNG.random((5, 100, 100)))

sdata = SpatialData.init_from_elements({'image0': image0, 'image1': image1})

Interactive(sdata)

and then:

  1. add image0, the slider in the bottom of the interface works
  2. add image1 (which is now in focus), the slide will not work
  3. delete image0, the slider will work again, on image1.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Python reproduction with Interactive and two Image2DModel images, then trace how the channel slider handles the focused image when both image0 and image1 are present. Done means the slider changes channels for image1 without requiring image0 to be deleted, while preserving the existing single-image behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.