Skip to content

feat: show OME channel names in the LayerPanel + let users rename channels#845

Merged
aelefebv merged 2 commits into
mainfrom
feat/omero-channel-names
Jun 26, 2026
Merged

feat: show OME channel names in the LayerPanel + let users rename channels#845
aelefebv merged 2 commits into
mainfrom
feat/omero-channel-names

Conversation

@aelefebv

Copy link
Copy Markdown
Owner

What this does

Two related channel-identity features:

  1. Display channel names from the OME metadata (generic). lucida now reads
    attributes.ome.omero.channels[].label from a dataset's zarr.json and shows it in the
    LayerPanel instead of the positional Ch N. It's keyed on the standard OME-Zarr omero
    block — no vendor/format-specific code — so any OME-Zarr with omero labels benefits
    (CZI/ND2/LIF alike). Reading the cheap omero JSON, not the bundled OME-XML, keeps the
    dataset-open path fast and off the XML-parsing surface.

  2. User channel rename. A new SetChannelName ViewportCommand carries a per-channel
    ChannelSettings.name override. It mirrors the existing SetChannelColormap path exactly,
    so the rename persists in saved views and broadcasts to followers like every other
    per-channel setting. An inline rename input (gated on the same canEdit permission as the
    layer rename) sits next to each channel label; an empty rename clears the override.

Display precedence: user override → omero label → Ch N, applied at every channel-naming
site (label, eye-button aria-label, colormap selector, contrast control).

How it's threaded

  • lucida-store/src/parse.rs — parse the omero channels (label + optional color), fail-soft on
    malformed/partial omero (interior gaps backfilled positionally, never mislabels).
  • lucida-content/src/image.rsMultiscaleInfo.channel_infos: Vec<ChannelInfo>
    (#[serde(default, skip_serializing_if]).
  • lucida-store/src/import.rs — populate it on import (single image + plate).
  • lucida-coreSetChannelName command + ChannelSettings.name.
  • web — mirror the types, thread the names into the LayerPanel, add the rename UI.

Back-compat

Additive and snapshot-safe: new Rust fields are #[serde(default)], the web field is optional
with a Ch N fallback, ChannelSettings/colormaps/saved-view encoding are otherwise unchanged
(colormaps stay positional in this PR — this changes names, not colors), and channels still
bind by index. Datasets without an omero block (incl. all existing lucida-written stores) keep
showing Ch N.

Tests + verification

cargo test --workspace, clippy -D warnings, fmt, wasm-pack build, and the web
tsc/eslint/pnpm test (1497) all pass. New coverage: omero→manifest e2e + back-compat,
the api-wiring fail-safe (non-plate scene_root-raises, channel-count mismatch), the
projection/precedence, and the rename command (round-trip, apply, clear, selection-epoch).

Verified live against a real 7-channel Leica STELLARIS confocal store (enriched by the
companion zarrmony change): the LayerPanel shows DAPI (405 nm), ALEXA 594 (590 nm),
ALEXA 750 (753 nm), ALEXA 488 (499 nm), ALEXA 647-R-PE (653 nm), ALEXA 555 (553 nm),
ALEXA 700 (696 nm); renaming a channel overrides + persists, clearing falls back to the omero
label.

Related

The companion converter change that writes these omero labels for Leica confocal LIFs is
ferrinm/zarrmony#32 (which in turn ports the fix upstream to bioio-devs/bioio-lif#52).

aelefebv added 2 commits June 25, 2026 15:33
Reads attributes.ome.omero.channels[].label (+ optional color) generically (any
OME-Zarr; no vendor code, no OME-XML on the open path), threads ChannelInfo through
MultiscaleInfo -> manifest -> web, and renders the label (Ch N fallback) in the
LayerPanel label, eye-button aria-label, colormap selector, and contrast control.
Untrusted-omero-safe positional parse (gap-fill + trailing-truncate, never mislabels);
back-compat via #[serde(default)]. ChannelSettings/colormaps/saved-views untouched.
Slice B1 of the lucida channel-names run.
Adds a SetChannelName ViewportCommand mirroring SetChannelColormap: a per-channel
ChannelSettings.name override (serde-default, back-compat) applied on the selection
epoch, an inline canEdit-gated rename input in the LayerPanel, and saved-view + presence
persistence. Display precedence: user override -> omero label -> Ch N, at every naming
site. Empty input clears back to the omero label. Slice B2 of the channel-names run.
@aelefebv
aelefebv merged commit edc595f into main Jun 26, 2026
6 checks passed
@aelefebv
aelefebv deleted the feat/omero-channel-names branch June 26, 2026 00:18
@aelefebv aelefebv mentioned this pull request Jun 25, 2026
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