Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
66 changes: 66 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,72 @@ The design is [`docs/design-v0.4.md`](docs/design-v0.4.md), imported unchanged f
are in [docs/plan.md](docs/plan.md) §12. (The v0.3 to v0.4 migration guide was removed in
v0.5.1: no run before v0.5.1 is read.)

## Unreleased (after v0.10.0)

**Volumes (Z-stacks), the first step of #438** (MorphoBricks-Spec ADR 0010, proposed; built ahead
of its acceptance as a draft). A **breaking change** of the run manifest (version 7) and of the
resolver contract (version 5): every consumer re-pins `SUPPORTED_RESOLVER_VERSIONS` to `{5}` and
every run folder is run again.

### Changed

- **The Spec pin moves from `232fb38` to `5aad8d3`** (the merge of ADR 0010, accepted 3 December
2026, after ADR 0009): only the vendored `experiment-v1.md` changes (volumes, §1, §4.5, §8); the
fixtures are the same. Notebook drafts written under the old pin are refused
(`spec_commit_mismatch`): start the draft again from the folders; a published
`morphobricks.toml` is untouched.
- **A Z-stack is described, tagged and calibrated as a volume** (VZ1). The description-step error
`z_stack_not_supported` is removed (header check, axis review, `convert`), and with it
`check_metadata(allow_z=)` and `inspect_images(allow_z=)`. A volume is an image whose
**confirmed** `Z` role has more than one slice; a one-slice `Z` is a plane image. Projection stays
an explicit, recorded choice with no default: the notebook's Axes step asks to either *Keep the
3-D stacks* (now enabled) or write projected copies before the roles can be confirmed.
- **Run manifest version 7** (written; versions 6 and 5 are read only for a new run's inputs and
refused by `RunInputs.open` with `RUN_FOLDER_VERSION`). Every file entry records `shape`,
`z_count`, `t_count`, `c_count`, `image_kind` (`plane` or `volume`), `plane_statistics`
(`computed` or `not_computed_volume`), `plane_count` (now the physical planes, `t_count ×
z_count`) and `statistics_rows` (VC2, VC3), each checked against the others by the writer and the
reader. `pixel_sizes` entries gain `reason` and write `source = "unknown"` where nothing gives a
size (VC4; the conversion and projection records keep their codec). New required top-level keys
`checks` (one run-level `W_AXIS_UNCALIBRATED`, `W_MIXED_PLANES_AND_VOLUMES`; derived from the entries
and recomputed by `RunInputs.open`, VC5) and `statistics_artifacts` (VC1).
- **Histograms, normalization and QC metrics are not computed for volumes** (VZ2): a volume's
pixels are not read by the run, it has no row in `plane_histograms.parquet` or `image_qc.csv`,
and a run of volumes only writes **neither table** (both digests and `image_qc` null,
`statistics_artifacts = {"state": "not_computed", "reason": "all_volumes"}`, VZ29) and removes the
tables of an earlier run in the same output folder. Plane images in the same run are unaffected.
- **Keeping Z-stacks is an explicit, recorded choice** (VZ32): a run with volumes needs it (the
notebook's *Keep the 3-D stacks*, `run --keep-z-stacks`, `RunMode(keep_z_stacks=True)`), given or
recorded by the earlier run; without it the run stops before any read (`z_stacks_not_chosen`). The
manifest records `z_handling`: `null`, `"kept"` or `{"projected": method}`.
- **Unknown steps are recorded, never guessed** (VZ9, VZ12, VZ18, VZ30): an `X` or `Y` without a
length, and the `Z` of a volume without one, carry `W_AXIS_UNCALIBRATED` in their `pixel_sizes`
(also for `pixels`, VZ24); `checks` and the run report give it **once per run** with the axes and
how many images lack each, and the fix; nothing is blocked. The Axes step's calibration card lists
them as soon as the roles are confirmed.
- **Mixed runs are checked early and warned, never refused** (VZ4, VZ8, VZ19, VZ31):
`W_MIXED_PLANES_AND_VOLUMES` gives the counts, every place holding both kinds, what it means
downstream (MorphoFeature refuses such a run) and the fix, at the axis review (the notebook's Axes
step and keep-or-project card, `check`), in the run's `checks` and report, and in the run summary.
- **`R_UNIT_NOT_HOMOGENEOUS` compares the confirmed roles other than `Z` and `T`** (VC11, VZ34), so a
plain stack confirmed `ZYX` joins a unit of `YX` images.
- **Resolver contract version 5** (with ADR 0002 AR12 in the same wave, so version 4 is never
released, VZ27): `Request.fov_subset` (`A_FOV_NOT_IN_RUN`) and `Request.z_indices` (VC13); a
`plane` request without `z_indices` on a volume is `A_VOLUME_NOT_SUPPORTED` (rule (b)); an index
an image lacks is `A_Z_INDEX_NOT_IN_IMAGE` (`run_inputs_request.z_index_refusals`); BM5 is kept for
explicit planes; `Provenance.fov_scope` records `z_indices`, and its `scope_digest` covers it.
- **`RunInputs`**: `Fov.z_count`, `t_count` and `c_count` come from the manifest, never from rows;
`histograms(fovs=None)`, the new `image_qc(fovs=None)` and `require_plane_statistics(fovs)` refuse
volumes with `VOLUME_STATISTICS_NOT_COMPUTED` (`run_inputs_statistics.refuse_volume_statistics`,
VC6; "Plane histograms are / Normalization is / QC metrics are not computed for volumes",
VZ33) and check the rows against the manifest; `records` is internal (`_records`);
`read_plane(fov, z=None, ...)` refuses an omitted `z` on a volume and `read_image(fov, *,
volume=False)` a volume without `volume=True` (B2); the new `read_mask_volume` (VC9, VZ28);
`read_objects` refuses a plane outside its selection (VC8); `pixel_sizes` gives `unknown` and
`reason`; the new `check_consumer(...)` applies a consumer's `volume_support`,
`mixed_volume_support` and `requires_calibration` (ADR 0009 O9, O10;
`R_CONSUMER_DIMENSIONS_NOT_ALLOWED`). `fit_scaling` calls `require_plane_statistics` first.

## v0.10.0 (3 December 2026)

Minor release with a **breaking change of file format**: the histogram table is
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
The preprocessing brick of MorphoBricks. It reads an experiment folder of
microscopy TIFFs, computes one intensity histogram per channel of every plane, and writes
them, with each plane's experimental labels, to `plane_histograms.csv`: one row per plane
(an image at one time point), each channel in its own columns. MorphoBricks v1 analyses 2-D
planes: a Z-stack (more than one depth slice) is refused (`z_stack_not_supported`); make
recorded 2-D projected copies first with `convert --project max|mean|sum`, and use the copies. Later bricks
(an image at one time point), each channel in its own columns. A Z-stack (more than one depth
slice) is either kept as a **volume** (`run --keep-z-stacks`, the notebook's *Keep the 3-D
stacks*: described and handed to tools that declare volume support, with no histograms,
normalization or QC computed for it) or projected first into recorded 2-D copies with
`convert --project max|mean|sum`; there is no default (Spec ADR 0010). Later bricks
(for example patch extraction) use that table to calculate normalization
parameters for any group of images without rereading the pixels.

Expand Down
11 changes: 7 additions & 4 deletions docs/colab-release-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,13 @@ again on the tagged commit.
## C. Z-stacks, time-lapse and the OME-Zarr copy (Colab)

17. **Z-stacks** (a new output folder).
- [ ] Scan and read the headers; the viewer has a **z** slider. On Axes the stacks are
still refused (`z_stack_not_supported`) and the card **Z-stacks: save the dataset as
projections** appears: the method list starts on "— choose a method —" (maximum, mean,
sum; no default) and the slices are all unless changed.
- [ ] Scan and read the headers; the viewer has a **z** slider. On Axes no error is
shown for the stacks (they are volumes, Spec ADR 0010) and the card **Z-stacks: save the
dataset as projections** appears; *Confirm axis roles* stays closed until **Keep the 3-D
stacks** is ticked or a projection is written: the method list starts on "— choose a
method —" (maximum, mean, sum; no default) and the slices are all unless changed.
- [ ] With **Keep the 3-D stacks** ticked, the run says "not computed: volume" before and
after it runs, and with stacks only no `plane_histograms.parquet` is written.
- [ ] **Show this projection of the image above** shows the projection of the example.
**Write the projected copies and continue with them** is greyed, with its reason, until
a method is chosen and the example is checked; then it writes
Expand Down
Loading
Loading