Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a377c78
Entry identity: reusable outputs in conda; warn on an uncertain first…
claude Dec 3, 2026
add0367
Fix the command-line gaps before the next brick (v0.10.1)
claude Dec 3, 2026
3535b68
Add he_tissue_v2: the H&E tissue mask with the white estimated from t…
claude Dec 3, 2026
57338fd
Record the owner's decisions of the v0.10.1 CLI fixes (plan question 93)
claude Dec 3, 2026
c065049
Entry identity: warn only after the record is written; force the edit…
claude Dec 3, 2026
2da8c17
Fix the review findings of the CLI usability changes
claude Dec 3, 2026
1345159
Keep he_tissue_mask.py under the 600-line rule
claude Dec 3, 2026
a87c403
Merge remote-tracking branch 'origin/claude/vibrant-maxwell-ktjhbd' i…
claude Dec 3, 2026
4e6c119
Merge remote-tracking branch 'origin/claude/cool-dijkstra-lngj7d' int…
claude Dec 3, 2026
9d052c2
Merge remote-tracking branch 'origin/claude/friendly-meitner-w5xoc5' …
claude Dec 3, 2026
0ca1565
describe --id FOLDER=ID: name any folder's ID in fast mode
claude Dec 4, 2026
88b7548
tissue-mask: create and record a masks folder when the run has none
claude Dec 4, 2026
a76185d
A_DESCRIPTION_REQUIRED: name both routes that publish a description
claude Dec 4, 2026
01fcb75
plan Q94: #620's CLI choices were proposed, not decided; record the o…
claude Dec 4, 2026
9c5780f
declare-masks --ignore TYPE: let runs skip a label image or mask type…
claude Dec 4, 2026
197b6db
docs: describe --id, tissue-mask's masks folder, declare-masks --igno…
claude Dec 4, 2026
da2ac87
Name the two plane memory figures apart; say why links out are refused
claude Dec 4, 2026
6973070
Merge pull request #624 from CellMigrationLab/fix/symlink-and-plane-m…
guijacquemet Dec 4, 2026
62e97fe
Write OME-Zarr copies in 1024 x 1024 chunks; name stores too coarse f…
claude Dec 4, 2026
0907891
Merge pull request #625 from CellMigrationLab/fix/convert-ome-zarr-ch…
guijacquemet Dec 4, 2026
55470cb
CLI wording: help, success, next-step and refusal messages; guide and…
claude Dec 4, 2026
15d1e75
convert: refuse axes that contradict an RGB header
claude Dec 4, 2026
acc5d30
describe --publish: exit 1 when the headers contradict the description
claude Dec 4, 2026
d1702a3
describe: refuse fast-mode options for a published description
claude Dec 4, 2026
e147746
declare-masks: check --ignore before declaring, so both apply or neither
claude Dec 4, 2026
0ad63ad
tissue-mask: check the rule, the extra and the images before creating…
claude Dec 4, 2026
1b816c3
describe: point to the notebook for repeats that are not comparable
claude Dec 4, 2026
4dd8c77
check: use the earlier run's exclusions and masks folder, as run does
claude Dec 4, 2026
174721c
Merge #627 (docs/cli-wording-v0.10.1): CLI wording
claude Dec 4, 2026
211dcf7
Merge #628 (fix/cli-behaviour-v0.10.1): CLI behaviour fixes
claude Dec 4, 2026
fdd838b
Fix the full-suite failures #627's wording left
claude Dec 4, 2026
70e9649
tissue-mask: import the H&E module only when the command runs
claude Dec 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ src/morphobricks_preprocessing/
0011 settings file, Q10), folder_values (no pixel), settings_template
entry_record.py morphobricks_entry.json: build_record, write_entry_record, check_entry_record,
EntryResult, reuse_or_refuse (RE10); entry_identity.py brick_identity (every
file of the brick hashed against RECORD, libraries by RECORD digest);
file of the brick hashed against RECORD, libraries by RECORD digest;
pip, setuptools and wheel left out: INSTALL_TOOLS, v0.10.1);
entry_publish.py default_output, check_output_place, staging_folder, publish
(renameat2 RENAME_NOREPLACE, or an exclusive mkdir)
notebook_entry_card.py the card "Run on a validated folder" of every brick (ADR 0007 Q6)
Expand Down Expand Up @@ -297,7 +298,10 @@ src/morphobricks_preprocessing/
WindowLayoutError (shared by both);
window_reader.py WindowReader (#304): many windows of one image through a
bounded, thread-safe block_cache.BlockCache of decoded pieces (opt-in),
RunInputs.window_reader -> RunWindowReader by channel IDs;
RunInputs.window_reader -> RunWindowReader by channel IDs; it refuses at
open an OME-Zarr whose chunks leave no window within the limit (v0.10.1);
window_chunks.py check_window_chunks: check/run warn about such stores
(chunks_too_large_for_windows, e.g. one chunk per plane);
window_map.py map_plan / map_windows / iter_windows: a function over
windows in a bounded thread pool, results in window order, memory
planned and checked against a budget before any read (lazy-windows §5);
Expand Down Expand Up @@ -378,12 +382,20 @@ src/morphobricks_preprocessing/
he_tissue_mask.py the opt-in H&E tissue mask (Spec ADR 0005 BM15; RunInputs.he_tissue_mask and
preview_he_tissue_mask through run_inputs_tissue.py's lazy mixin, the he-mask
extra): the FOV resolved from the run, every refusal before any read, BM15's
lineage line and own retry comparator; he_tissue_rule.py the fixed rule
he_tissue_v1 (provisional) as one canonical record, computed from its record
lineage line and own retry comparator; he_tissue_rule.py the fixed rules
he_tissue_v1 and he_tissue_v2 (the default: v1 on the plane rescaled to its
white, estimate_white; both provisional) as canonical records, computed from
their record; he_tissue_run_facts.py the run facts of its lineage line
(the RGB header override item, the recorded pixel size)
(SciPy clean-up, 8-connected, disks clipped by the border); code_identity.py
the verified code identity (RECORD digest, PEP 610); lineage_schema.py the
reader's dispatch by operation and the duplicate-key refusal;
cli_tissue_mask.py the command tissue-mask
ignored_masks.py ignored_masks.toml (v0.10.1, owner 4 Dec 2026): the mask types and OME-Zarr label
images the runs skip; strict reader (read_ignored, parse_ignored), canonical text,
the manifest's optional ignored_masks entry (recorded_ignored); written by
mask_declare.ignore_masks (declare-masks --ignore, under the lock); preflight
passes the list to find_masks(ignore=); unrecorded.py leaves them out
mask_declare.py declare_masks/with_declared_masks: declare mask types added after preprocessing in
the published description (#587), the representation stated (no default) and the
ID the folder name or given; published by publish_description (lock, base
Expand Down Expand Up @@ -444,6 +456,11 @@ src/morphobricks_preprocessing/
moved from report.py in PP-10d
discovery_report.py the run report (discovery_report.json and .txt, design v0.4 §4): status,
manifest SHA-256, what was found, reused, recomputed and replaced
describe_ids.py describe --id FOLDER=ID (v0.10.1): apply_ids through Draft.confirm_id (the
notebook's rules), refusals naming the option; describe_questions.py the
draft's open questions and which options answer them (moved from cli_describe)
tissue_masks_folder.py create_masks_folder: tissue-mask on a run without a masks folder creates
<experiment>_masks (or --masks) and records it by running preprocessing again
cli.py, __main__ `morphobricks-preprocessing check|run|masks|calibrate|describe|convert|settings` (also `python -m morphobricks_preprocessing`);
cli_run.py holds `run`'s options and output; cli_calibrate.py `calibrate`;
cli_convert.py `convert`; log_target.py where `--log` may write (#99),
Expand Down Expand Up @@ -585,7 +602,8 @@ src/morphobricks_preprocessing/
changed right there, the proposal the Axes step starts from
notebook_zarr_copy.py the first screen's "Also save a copy as OME-Zarr" and the Axes step's
card that writes it once the roles are confirmed; ome_zarr_copy.py
the writers (OME-NGFF 0.4, written directly) and the copy's name
the writers (OME-NGFF 0.4, written directly, chunks of at most
1 x 1024 x 1024 since v0.10.1) and the copy's name
notebook_projection.py the Axes step's card for Z-stacks: choose the projection, write the
projected copies into the output folder (convert_experiment), open
them as the experiment; the greyed 3-D option
Expand Down Expand Up @@ -1033,7 +1051,9 @@ functions the tests use.
(the normalization brick's `check_rgb`), else `rgb_not_possible` in a run.
- **Suggestion:** `rgb` only when every analysed image is a TIFF stored as RGB colour
(`TiffMetadata.rgb_samples`: photometric RGB, three samples per pixel, axis `S`), the
confirmed C role is on `S`, and RGB is possible. Never applied without confirmation.
confirmed C role is on `S`, and RGB is possible; in `check` and `run` also when the
published description declares every acquisition `rgb` (`declared_image_type`, v0.10.1:
OME-Zarr states no colour). Never applied without confirmation.
- **Notebook:** step 2's "Image type" card appears once the axis roles are confirmed
(also when embedded); radio buttons with the suggestion preselected, disabled at
fluorescence when RGB is impossible; `ConfirmToggle` **Yes, this is the right image
Expand Down Expand Up @@ -1098,7 +1118,7 @@ Technical details go to `logging` (shown in the notebook's "Technical details" p
| Histogram range (Q34, P6) | Step 3 **Settings**: the brick's `HistogramSettings` (`minmax` default, or `robust` with adjustable quantiles); recorded in the manifest's `settings.histogram`, any change recomputes every row. Every plane binned with `histogram_with_range_check` (memory estimate with `range_check=True`, through `planes._Binning`); `narrow_histogram_range` warnings from `range_check_issues`, one per channel, with the narrow planes recorded in the manifest's `narrow_histogram_ranges` so kept rows still report them. CSV schema 4 (underflow and overflow columns, zero with `minmax`); schema 3 tables recomputed. CLI `--histogram-range`, `--robust-quantiles`. Normalization brick pinned to v0.3.1 |
| Position identity (Q20, D02) | `position_id` = image name without extension, in every CSV row and manifest file entry; FOV key = labels + `position_id`; duplicates in one leaf folder are the error `duplicate_position_id`. CSV columns and schema 2 unchanged; manifest version 1 with an optional key |
| Masks (Q32) | Optional masks folder outside the experiment, one subfolder per mask type mirroring the experiment's folders, or the experiment's folders with `<image>_<type>.tif` (both may be mixed; `ambiguous_mask` when a name could fit two images or both layouts), paired by leaf folder + `position_id`; OME-Zarr label images are masks too. Header-only errors (`masks_folder_not_found`, `masks_inside_experiment`, `mask_names_differ_in_case`, `duplicate_mask`, `ambiguous_mask`, `unreadable_mask`, `mask_not_2d`, `mask_size_mismatch`, `mask_pixel_type`) and warnings (`mask_missing`, `mask_without_image`, `mask_outside_type_folder`) in `check`/`run`; manifest key `masks` (optional, version 1). Optional mask step (`masks` command, `scan_masks`): kinds, relations with evidence, direct-parent hierarchy, `mask_relationships.json` (report version 1); default thresholds the user may change (`thresholds=` keyword, one CLI option each, checked by `mask_thresholds`, written in the report); suggestions only, the user names and confirms. SciPy core dependency. Confirmed by the owner: 2D masks at the image's YX, integer/bool pixels, masks folder outside the experiment. Next: notebook step and a file of the user's answers; tag v0.2.0 proposed after merge. Plane identity (issue #36): masks may have Z and/or T named in their own metadata (never guessed: unnamed axes are `mask_not_2d`); the masks of an image share their planes (`mask_planes_differ`) and `run` checks them against the image's confirmed roles (`mask_planes_mismatch`, `mask_plane_issues`), so a 2D mask is refused for a Z-stack or time-lapse; manifest mask entries gain `axes` and `shape` (optional keys, version 1); `read_mask(z=, t=)` reads one plane; `scan_masks` scans plane by plane |
| H&E tissue mask (I1, BM15) | Opt-in only (`he-mask` extra; scikit-image, normalization's `stain` and the helper imported only when called). Fixed rule `he_tissue_v1`, provisional until its acceptance report is accepted; no per-call thresholds; sizes in pixels; colour maths from normalization only. One `uint8` region per image through BM12's publication with BM15's own line and comparator; an unverified code identity writes a mask never reused; freezing needs a new mask ID (design `docs/design/he-tissue-mask.md`, owner decisions of 16 November 2026) |
| H&E tissue mask (I1, BM15) | Opt-in only (`he-mask` extra; scikit-image, normalization's `stain` and the helper imported only when called). Fixed rules, provisional until an acceptance report is accepted: `he_tissue_v1` (white fixed at 255) and, the default since v0.10.1, `he_tissue_v2` (v1 on the plane rescaled to its white, the median of its brightest 0.1 %; v1 kept 0 % on grey-glass scans such as Zenodo 4550300); no per-call thresholds; sizes in pixels; colour maths from normalization only. One `uint8` region per image through BM12's publication with BM15's own line and comparator; an unverified code identity writes a mask never reused; freezing needs a new mask ID (design `docs/design/he-tissue-mask.md`, owner decisions of 16 November 2026) |
| Settings (ADR 0011, Q89) | `defaults.toml` (package data) declares the run's (`common`) and Cellpose's (`cellpose`) settings with default, unit and help; `morphobricks_preprocessing.settings` loads, modifies, saves and passes them with the five shared names on the vendored `_brick_settings.py` (never edited; re-vendored from the Spec); the classes, CLI defaults and notebook widgets are copies held equal by `tests/test_settings.py`; no Cellpose CLI option |
| Notebook style | Follow the lab's NucleiSky and LabChronicle notebooks (see §7) |
| Widget widths | **99%**, never 100% |
Expand Down
Loading
Loading