Skip to content

Add a first-reconstruction tutorial and agent skills - #569

Merged
srivarra merged 20 commits into
mainfrom
waveorder-tutorial-skill
Oct 16, 2026
Merged

srivarra merged 20 commits into
mainfrom
waveorder-tutorial-skill

Conversation

@talonchandler

@talonchandler talonchandler commented Jul 16, 2026 •

Copy link
Copy Markdown
Collaborator

Adds an onboarding path for first-time waveorder users: a written tutorial, an agentic skill that walks the same workflow interactively, and a small skill for inspecting transfer functions.

docs/guide/first-reconstruction.md: a six-stage guide from raw data to a tuned reconstruction: is waveorder right for you, what data and metadata do you have, draft reconstructions, manual sweeps, automatic tuning, and scaling up. Linked at the top of the README.

.skills/waveorder-tutorial: the agentic companion to the guide. The agent asks the stage questions, converts data to OME-Zarr, writes draft configs, runs sweeps, and shows everything in napari. Includes reference docs and scripts (example data fetch, TIFF/array converter, ROI cropper, and a 1D/2D sweep helper).

.skills/waveorder-visualize-otf: computes a transfer function from a config and opens it in napari.

How to trial: check out this branch, open Claude Code in the repo root, and run /waveorder-tutorial. With no data of your own it fetches a small sample and reconstructs 2D phase from a defocus stack; bring your own TIFF/zarr/array for a complete test.

Interactive CLI walkthrough for a first reconstruction: environment check,
OME-Zarr conversion, config authoring, napari viewing, and parameter sweeps.
Includes a QPI 2D-from-defocus worked example using the zenodo recOrder_session
sample. Un-ignores .claude/skills/ so the skill ships with the repo.
@talonchandler
talonchandler marked this pull request as ready for review July 16, 2026 18:57
Two-call skill: `wo compute-tf` on a config + input position, then `wo view` on
the resulting transfer function (napari, backgrounded).
@talonchandler talonchandler changed the title Add waveorder-tutorial Claude skill Add waveorder-tutorial and visualize-otf-from-config Claude skills Jul 16, 2026
For 2D reconstructions, the transfer function is stored as a singular system
(U, S, Vh). `wo view` now reconstructs H = U @ diag(S) @ Vh at each lateral
frequency and displays the resulting transfer function(s) — absorption and phase
for 2D phase, the optical TF for 2D fluorescence — instead of the raw singular
vectors. 3D display is unchanged.
@talonchandler
talonchandler marked this pull request as draft July 31, 2026 22:06
srivarra and others added 6 commits August 24, 2026 16:27
Relocate skill content from .claude/skills/ to .skills/ as the single
canonical, harness-agnostic source of truth. Add symlinks so existing
discovery paths still resolve to it:

- .claude/skills -> ../.skills   (Claude Code project skill scan path)
- .agents/skills -> ../.skills   (Codex CLI/ChatGPT skill scan path)

Update .gitignore: .claude/* still ignores session state, but
!.claude/skills un-ignores the symlink so it's tracked.

No content changes; checksums of all 8 skill files are unchanged.
…torial

- Rewrite waveorder-tutorial SKILL.md around the staged onboarding workflow:
  suitability, data/metadata identification, ROI selection, draft
  reconstructions, manual sweeps, auto-tuning, and scaling
- Add scripts/crop_roi.py for ROI cropping and extend scripts/sweep.py with
  two-parameter grid sweeps shown on two napari sliders
- Add iohub convert route and ROI cropping to conversion reference; add
  optimization block, RL/RLGC, and expanded symptom table to config reference
- Add human-readable tutorial at docs/guide/first-reconstruction.md and link
  it with the skill at the top of the README
- Remove all em dashes; move imports to module top in tutorial scripts
…asets

Two reconstructions of the same channel previously produced identically
named layers, so users could not tell them apart in the layer list.
Gradient methods are local (travel ~lr per iteration); grid_search uses lr
as the grid step centered on init. Add the coarse-to-fine recipe to the
skill and config reference.
@talonchandler talonchandler changed the title Add waveorder-tutorial and visualize-otf-from-config Claude skills Add a first-reconstruction tutorial and agent skills Sep 2, 2026
@talonchandler
talonchandler marked this pull request as ready for review September 2, 2026 21:32

@srivarra srivarra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was super cool!

Just a few small suggestions.

Comment thread .skills/waveorder-visualize-otf/SKILL.md
Comment thread .skills/waveorder-tutorial/scripts/sweep.py
Comment thread .skills/waveorder-tutorial/scripts/to_omezarr.py Outdated
Comment thread .skills/waveorder-visualize-otf/SKILL.md Outdated
Comment thread .skills/waveorder-tutorial/SKILL.md Outdated
Start drafts with a small regularization_strength, sweep forward model
parameters for the fewest artifacts (least ringing, sharpest result), then
increase regularization until acceptable as the final step.
@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.92%. Comparing base (507a8af) to head (63bc9ae).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #569      +/-   ##
==========================================
+ Coverage   55.49%   55.92%   +0.42%     
==========================================
  Files          62       75      +13     
  Lines       11051    12617    +1566     
==========================================
+ Hits         6133     7056     +923     
- Misses       4918     5561     +643     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Prefixing with waveorder- makes it easier to filter waveorder-specific
skills, per review.
The tutorial scripts are now self-contained: uv run resolves their
dependencies without a prebuilt environment. Docs and docstrings invoke
them with uv run.
--y-pixel-size and --x-pixel-size override the isotropic --yx-pixel-size
shorthand.
run_in_background is specific to one agent runtime. State the requirement
instead (non-blocking, no interactive stdin, confirm the process stays up)
with a POSIX fallback.
@talonchandler
talonchandler force-pushed the waveorder-tutorial-skill branch from 3a5d9dc to f864c24 Compare October 13, 2026 20:32
The confocal pinhole is modeled only for 3D fluorescence reconstructions
(2D raises NotImplementedError); its diameter is given in demagnified
image space in micrometers. Consolidate this with the RL/RLGC restriction
in the config reference, skill, and guide.
srivarra
srivarra previously approved these changes Oct 14, 2026

@srivarra srivarra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a couple of nitpicks.

Comment thread .skills/waveorder-tutorial/references/conversion.md Outdated
Comment thread .skills/waveorder-tutorial/scripts/sweep.py Outdated
The script does not read OME-XML metadata, so omitted flags produced a
default scale with no warning; the doc also claimed metadata was read.
--values null previously stayed the string 'null' and crashed e.g. a
confocal_pinhole_diameter sweep. Numeric casts stay first because PyYAML
parses dotless floats like 1e-4 as strings.
@talonchandler

Copy link
Copy Markdown
Collaborator Author

@srivarra, I think this is ready. Feel free to modify and/or merge. Thanks!

@srivarra
srivarra merged commit 524926f into main Oct 16, 2026
7 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.

2 participants