Skip to content

Add standalone raw-UCHL1 oocyte segmentation workflow - #50

Draft
kuang-da wants to merge 1 commit into
mainfrom
agent/add-oocyte-segmentation-workflow
Draft

Add standalone raw-UCHL1 oocyte segmentation workflow#50
kuang-da wants to merge 1 commit into
mainfrom
agent/add-oocyte-segmentation-workflow

Conversation

@kuang-da

Copy link
Copy Markdown
Member

Summary

This PR adds aegle.oocyte, a standalone raw-UCHL1 workflow for whole-slide
oocyte detection, exact mask persistence, human Precision and Recall review,
manual boundary resolution, final-label expression profiling, and immutable
release packaging. It does not consume DeepCell cell or nucleus masks and does
not modify the existing Aegle end-to-end pipeline.

The delivery model is deliberately human-in-the-loop. Deterministic Python
commands perform detection, segmentation, identity validation, finalization,
profiling, and packaging. A biologist decides whether an object is an oocyte and
whether its boundary is acceptable. Codex may orchestrate the deterministic
steps, inspect manifests and exported review JSON, preserve versioned outputs,
and explain the next checkpoint, but it may not silently resolve biological
choices.

Codex orchestration

aegle/oocyte/AGENTS.md is the operational handoff for another Codex session.
It defines:

  • the source-of-truth hierarchy for configs, manifests, NPZ masks, review JSON,
    profiling manifests, and release hashes;
  • the startup state audit required before any command is run;
  • the boundary between Codex actions and biologist decisions;
  • the phase order from input audit through detection, Precision, Recall,
    boundary finalization, profiling, and release;
  • immutable output and review-identity rules;
  • the completed D11/D13 panel1 reference invariants;
  • a reusable prompt for a colleague starting or resuming the workflow with
    Codex.

docs/oocyte_detection.md remains the command-level reference for every review
and finalization subcommand. Algorithm optimization and profile retuning are
explicitly deferred to follow-up work.

Reference run

The checked-in panel1 config and sample manifest cover four donor13 positive
sections and four donor11 biological negative controls. The frozen
donor13_v6 detector plus the separately named rescue pass was taken through
complete Precision, whole-slide Recall, boundary review, profiling, and release
packaging.

The final reviewed release contains:

  • 129, 68, 219, and 43 donor13 labels for samples 13-21 through 13-24;
  • 459 donor13 oocytes in total;
  • zero final labels in donor11 samples 11-21 through 11-24;
  • raw within-mask values for all 36 registered channels;
  • exact cropped NPZ masks, whole-slide OME labels, mappings, review evidence,
    static whole-slide review consoles, and SHA-256 manifests.

The raw images and generated release are not committed. The final cohort
release spec is retained as provenance; collaborators must adapt filesystem
paths when rebuilding in another environment.

Validation

python -m unittest discover -s tests/oocyte -v
Ran 78 tests: OK (skipped=3 opt-in local-data regressions)

python src/run_oocyte_release.py validate \
  --release-dir /workspaces/1-spatial_frs_analysis/oocyte-output/d11_d13_panel1_delivery_v6
status=valid, samples=8, positive_oocytes=459, negative_controls=4,
channels=36, artifacts=598

The release consoles were also exercised through Chromium under file://.
The positive page rendered all cards and whole-slide hotspots, distinguished
overlapping hotspot navigation, toggled raw/masked views, and made no network
requests. The donor11 page rendered a raw-only overview with no masks or cards.

Scope boundaries

  • No DeepCell or Aegle pipeline output is required by the oocyte module.
  • Detector accepts remain review candidates until durable human review and
    finalization complete.
  • donor13_v6 is immutable and is not claimed to be validated for a different
    donor, panel, staining run, or tissue context.
  • Review feedback is preserved as delivery provenance; this PR does not learn
    new parameters from it.
  • Raw OME-TIFFs, generated masks, review screenshots, and release archives stay
    outside Git.

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