feat: show OME channel names in the LayerPanel + let users rename channels#845
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Two related channel-identity features:
Display channel names from the OME metadata (generic). lucida now reads
attributes.ome.omero.channels[].labelfrom a dataset'szarr.jsonand shows it in theLayerPanel instead of the positional
Ch N. It's keyed on the standard OME-Zarr omeroblock — 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.
User channel rename. A new
SetChannelNameViewportCommand carries a per-channelChannelSettings.nameoverride. It mirrors the existingSetChannelColormappath 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
canEditpermission as thelayer 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-namingsite (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 onmalformed/partial omero (interior gaps backfilled positionally, never mislabels).
lucida-content/src/image.rs—MultiscaleInfo.channel_infos: Vec<ChannelInfo>(
#[serde(default, skip_serializing_if]).lucida-store/src/import.rs— populate it on import (single image + plate).lucida-core—SetChannelNamecommand +ChannelSettings.name.Back-compat
Additive and snapshot-safe: new Rust fields are
#[serde(default)], the web field is optionalwith a
Ch Nfallback,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 webtsc/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), theprojection/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 omerolabel.
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).