feat(converter): automatic channel color detection#47
Draft
BrianWhitneyAI wants to merge 2 commits into
Draft
Conversation
Add bioio_conversion.channel_colors with get_channel_colors(), which derives an OME-Zarr display color per channel, and wire it into OmeZarrConverter so channels are colored automatically instead of all defaulting to white. Color policy (per channel): - Brightfield / transmitted-light channels -> white, and do not consume a fluorescent palette slot. Detected via OME contrast_method / illumination_type with a channel-name fallback. - Recognized fluorophores -> their true emission color via the FLUOROPHORE_COLORS table (e.g. GFP -> green, AF647 -> red). - Remaining channels -> a count-based, perceptually-distinct palette (green / green+magenta / cyan-yellow-magenta / +Okabe-Ito), ordered by emission wavelength when available. Black is never assigned. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
59b4fd6 to
3ac9b69
Compare
Base automatically changed from
feature/v3-direct-czi-read
to
feature/v3-sharding-policy
June 17, 2026 19:54
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.
Summary
Resolves #25
Adds automatic channel display color detection to the OME-Zarr converter. Previously every channel was written with a hardcoded white (
#FFFFFF) OMERO color; now each channel gets a meaningful color derived from its metadata.This ports the recipe from #42 (the standalone
get_channel_colorsexperiment) and wires it intoOmeZarrConverterso colors are assigned during conversion without any caller changes. Targetsfeature/v3-direct-czi-readsince it builds on that branch.Color policy (applied per channel)
contrast_method/illumination_type, with a channel-name fallback (BF,TL,DIC, "phase contrast", …).FLUOROPHORE_COLORStable (e.g. GFP → green, TaRFP → orange, AF647 → red). Matches the OMEfluorfield or the channel name.So identity wins when known, and the distinct palette fills the rest.
Changes
bioio_conversion/channel_colors.py—get_channel_colors()plus the fluorophore/brightfield/palette helpers. Exported from the package__init__.OmeZarrConverter._resolve_channels— derives per-channel colors viaget_channel_colorsinstead of hardcoding white. Explicit user-suppliedchannels=still take precedence; no-channel-axis behavior unchanged.bioio_conversion/tests/test_channel_colors.py— 24 tests.Verification
s_3_t_1_c_3_z_5.czi: EGFP→green, TaRFP→orange (FFA500), Bright→white — confirmed in the written OMERO metadata.🤖 Generated with Claude Code