Convert TIFF to OME-Zarr#

Note

There is also a CLI command for conversion. Consult iohub convert --help for documentation.

class iohub.convert.TIFFConverter(input_dir: str | Path, output_dir: str | Path, grid_layout: int = False, chunks: tuple[int] | Literal['XY', 'XYZ'] = None, hcs_plate: bool = None)[source]#

Convert Micro-Manager TIFF formats (OME-TIFF, ND-TIFF) into HCS OME-Zarr. Each FOV will be written to a separate well in the plate layout.

Parameters:
input_dirstr | Path

Input directory path

output_dirstr | Path

Output zarr directory path

grid_layoutbool, optional

Whether to lay out the positions in a grid-like format based on how the data was acquired (useful for tiled acquisitions), by default False

chunkstuple[int] or Literal[‘XY’, ‘XYZ’], optional

Chunk size of the output Zarr arrays, by default None (chunk by XYZ volumes or 500 MB size limit, whichever is smaller)

hcs_platebool, optional

Create NGFF HCS layout based on position names from the HCS Site Generator in Micro-Manager (only available for OME-TIFF), and is ignored for other formats, by default None (attempt to apply to OME-TIFF datasets, disable this with False)

Notes

The image plane metadata for each FOV is aggregated into a JSON file, and placed under the Zarr array directory (e.g. /row/column/fov/0/image_plane_metadata.json).

__call__() None[source]#

Runs the conversion.

Examples

>>> from iohub.convert import TIFFConverter
>>> converter = TIFFConverter("input/path/", "output/path/")
>>> converter()