Skip to content

feat: Imaris input, pixel calibration, OOM-safe pyramids - #13

Merged
lguerard merged 3 commits into
mainfrom
feat/imaris-calibration-oom
Jun 23, 2026
Merged

lguerard merged 3 commits into
mainfrom
feat/imaris-calibration-oom

Conversation

@lguerard

Copy link
Copy Markdown
Contributor

Three asks for the OME-ZARR plugin:

Imaris

  • native .ims reading via imaris-ims-file-reader (HDF5, no JVM); new [imaris] extra. to_ome_zarr("scan.ims", "out.zarr") just works. (bioio still handles CZI/LIF/ND2/OME-TIFF.)

Pixel calibration (regardless of input)

  • physical voxel size is read from the input — bioio physical_pixel_sizes, Imaris resolution, or an existing OME-ZARR's scale — and written into NGFF coordinateTransformations with micrometer units. pixel_size={...} overrides / supplies it for bare arrays.
  • per level: X/Y scale by the downsample factor, Z stays (matches XY-only downsampling). Labels written into the input store inherit its calibration.

OOM-safe pyramids

  • each level is built by reading the previous level back from disk and streaming the strided result with bounded chunks (_CHUNK_CAP). The dask graph never chains level-on-level and no whole plane/volume is materialised → terabyte inputs convert in bounded RAM.

Tests: calibration scale/units asserted, Imaris import-guard, full suite green (25 passed); ruff + mkdocs --strict clean. Imaris/bioio runtime paths are import-guarded (not installed in CI).

🤖 Generated with Claude Code

lguerard and others added 3 commits June 22, 2026 16:46
ome_zarr >= 0.16 nests multiscales under the "ome" key instead of at
the root level. load_ome_zarr and estimate_empty_tiles now fall back to
attrs["ome"]["multiscales"] when attrs["multiscales"] is absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- read Imaris .ims natively (HDF5, no JVM) via imaris-ims-file-reader;
  add the [imaris] extra and a .ims dispatch in to_ome_zarr
- read physical voxel size from the input (bioio physical_pixel_sizes,
  Imaris resolution, or an existing OME-ZARR scale) and write it into
  the NGFF coordinateTransformations with micrometer units; pixel_size=
  overrides or supplies it for bare arrays. X/Y scale per level, Z stays
- build each pyramid level by reading the previous level back from disk
  and streaming with bounded chunks, so the dask graph never chains and
  no whole plane/volume is held in RAM (no OOM on terabyte inputs)
- labels written into the input store inherit its calibration

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CI used a newer ruff than local and reformatted _io.py. Pin the
ruff-action to 0.15.18 so local and CI agree, and apply that version's
formatting.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lguerard
lguerard merged commit e1b39c4 into main Jun 23, 2026
1 check passed
@lguerard
lguerard deleted the feat/imaris-calibration-oom branch June 23, 2026 07:09
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