👨‍💻 Command Line Interface

ngff-zarr provides a command line interface to convert a variety of scientific file formats to ome-zarr and inspect and ome-zarr store’s contents.

Installation

To install the command line interface (CLI):

pip install 'ngff-zarr[cli]'

Usage

Convert an image file

Convert any scientific image file format supported by either itk, tifffile, liffile (Leica LIF), or imageio.

Example:

ngff-zarr -i ./MR-head.nrrd -o ./MR-head.ome.zarr

ngff-zarr convert

Convert a Leica LIF file

Convert all series from a LIF file:

ngff-zarr -i microscopy.lif -o output/

Convert a specific series by index:

ngff-zarr -i microscopy.lif -o output.ome.zarr --series 0

Convert series matching a pattern:

ngff-zarr -i microscopy.lif -o output/ --series "*GFP*"

For more details on LIF conversion, see Leica LIF Support.

Convert an image volume slice series

Note the quotes:

ngff-zarr -i "series/*.tif" -o ome-ngff.ome.zarr

Specify output chunks

ngff-zarr -c 64 -i ./MR-head.nrrd

ngff-zarr output chunks

Specify metadata

ngff-zarr --dims "z" "y" "x" --scale x 1.4 y 1.4 z 2.5 --translation x 6.24 y 360.0 z 332.5 --name LIDC2 -i "series/*.tif"

ngff-zarr metadata

Limit memory consumption

Limit memory consumption by passing a rough memory limit in human-readable units, e.g. 8GB with the --memory-target option.

ngff-zarr --memory-target 50M -i ./LIDCFull.vtk -o ./LIDCFull.ome.zarr

ngff-zarr memory-target

OME-Zarr Zip (.ozx) files

RFC-9 introduces support for OME-Zarr Zip (.ozx) files, which package an entire OME-Zarr hierarchy into a single ZIP archive. This format enables:

  • Single-file distribution: Share complete multiscale datasets as one file

  • Version metadata: Embedded NGFF version in ZIP comment

Write .ozx files

ngff-zarr -i MR-head.nrrd -o MR-head.ozx

Inspect .ozx files

ngff-zarr -i ./MR-head.ozx

More options

ngff-zarr --help