Skip to content

generate_plate_overview() core function (PR2 of #7) - #12

Merged
ferrinm merged 1 commit into
mainfrom
feat/plate-overview
May 20, 2026
Merged

generate_plate_overview() core function (PR2 of #7)#12
ferrinm merged 1 commit into
mainfrom
feat/plate-overview

Conversation

@ferrinm

@ferrinm ferrinm commented May 20, 2026

Copy link
Copy Markdown
Owner

Closes #9. Part of #7.

Summary

  • New module src/pyphenix/_overview.py exposing generate_plate_overview(). No napari/Qt imports.
  • Produces 2**N − 1 PNGs (one per channel combo) plus a JSON provenance sidecar.
  • Plate-wide per-channel contrast: 99.5th percentile of nonzero, downsampled, max-projected pixels — single pass through the wells (per ADR-0001).
  • Singletons rendered in viridis; merges use each channel's colormap from _colormaps.channel_color with additive RGB blending.
  • Layout: title (plate ID + combo) and objective subtitle on top, plate grid with row-letter and column-number labels, per-channel colorbars stacked on the right, scale bar in µm at the bottom.
  • matplotlib and tqdm added to base dependencies; generate_plate_overview exported from the package.
  • README usage example added under the headless install section.

Test plan

  • tests/test_overview.py — 9 new tests covering:
    • combo count (2^N − 1) and JSON sidecar presence
    • filename conventions (ch{X}.png, ch{X}+ch{Y}.png, merge_all.png)
    • JSON sidecar contents (plate ID, layout, computed contrast limits, channel colormaps, channel names, objective, pyphenix version, pixel size)
    • channels= filter constrains the combo set
    • contrast_limits= override is applied and recorded in the sidecar
    • PNGs are non-empty
    • _overview.py source contains no import napari / from napari
    • module imports correctly in a subprocess with napari blocked at sys.meta_path
    • empty wells still produce all PNGs (blank cell + labels render)
  • Full suite passes: 51 passed (9 new + 42 existing)
  • Manual visual check of generated PNGs on a real Phenix experiment before merge

🤖 Generated with Claude Code

Implements PR2 of #7 (closes #9). New module `src/pyphenix/_overview.py`
exposes `generate_plate_overview()`, producing one PNG per channel combo
(2^N - 1 for N selected channels) plus a JSON provenance sidecar.

- single pass through wells with tqdm progress
- per-channel plate-wide contrast: 99.5th percentile of nonzero
  downsampled max-projected pixels (per ADR-0001)
- singletons in viridis; merges use `_colormaps.channel_color` with
  additive RGB blending
- layout: title + objective subtitle, plate grid with row letters and
  column numbers, per-channel colorbars on the right, scale bar in µm
- JSON sidecar captures parameters, computed and rendering contrast
  limits, channel→colormap, pixel size, objective, pyphenix version
- no napari/Qt imports; matplotlib + tqdm added to base deps

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ferrinm
ferrinm merged commit e17555e into main May 20, 2026
13 checks passed
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.

PR2: generate_plate_overview() core function

1 participant