Metadata-Version: 2.3
Name: zarrify
Version: 0.1.3
Summary: Convert scientific image formats (TIFF, MRC, N5) to OME-Zarr
Keywords: zarr,ome-zarr,tiff,mrc,n5,scientific-imaging
Author: Yurii Zubov
Author-email: Yurii Zubov <zubov452@gmail.com>
License: MIT
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Dist: bokeh>=3.3.2
Requires-Dist: click>=8.1.8,<9.0.0
Requires-Dist: colorama>=0.4.6,<0.5.0
Requires-Dist: dask>=2024.12.1,<2025.0.0
Requires-Dist: dask-jobqueue==0.9.0
Requires-Dist: imagecodecs>=2024.12.30,<2025.0.0
Requires-Dist: mrcfile>=1.5.3,<2.0.0
Requires-Dist: natsort>=8.4.0,<9.0.0
Requires-Dist: numcodecs>=0.15.1,<0.16.1
Requires-Dist: numpy>=1.26.2
Requires-Dist: pydantic>=2.11.7,<3
Requires-Dist: pydantic-zarr>=0.9.0
Requires-Dist: pint>=0.20.0,<1.0.0
Requires-Dist: scipy>=1.16.1
Requires-Dist: tensorstore>=0.1.71
Requires-Dist: tifffile>=2024.1.0,<2025.5.10
Requires-Dist: xarray-multiscale>=2.1.0
Requires-Dist: zarr>=3.0
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: ome-zarr-models ; extra == 'test'
Requires-Python: >=3.12
Provides-Extra: test
Description-Content-Type: text/markdown

# Zarrify

Convert TIFF, TIFF stacks, MRC, N5, and zarr v2 files to OME-Zarr v3.

## Install

Requires [Pixi](https://pixi.sh/latest/installation/).

```bash
git clone <repo>
cd zarrify
pixi run dev-install
```

## Run

```bash
pixi run zarrify --config config.yaml
```

Copy a config template from `config_examples/` and edit for your data.

## Config

```yaml
src: "/path/to/input"         # tiff, tiff stack dir, .mrc, .n5, or zarr v2 .zarr
dest: "/path/to/output.zarr"

cluster: lsf                  # local | lsf
workers: 100
log_dir: "/path/to/lsf/logs"
extra_directives: ["-P myproject"]

zarr_chunks: [32, 32, 32]     # inner chunk shape
shard_shape: [1024, 1024, 1024]  # outer shard — null to disable
codec: zstd                   # zstd | gzip | blosc
codec_level: 3                # null = per-codec default (zstd:3, gzip:6, blosc:5)

axes: [z, y, x]
scale: [8.0, 8.0, 8.0]
translation: [0.0, 0.0, 0.0]
units: [nanometer, nanometer, nanometer]

optimize_reads: false         # chunk-aligned TIFF reads (single TIFF only)

multiscale: false             # build a multiscale pyramid
ms_workers: 100
data_origin: raw              # raw | labels
antialiasing: false
normalize_voxel_size: false
custom_scale_factors: null    # e.g. [[1,1,1],[2,2,2],[4,4,4]]
```

CLI flags override config values:

```bash
pixi run zarrify --config config.yaml --workers 200 --scale 1.0 1.0 0.058 0.058
```

## LSF example

```bash
bsub -n 4 -P myproject -o out.log -e err.log \
  "pixi run zarrify --config config.yaml"
```

## Python API

```python
from zarrify.to_zarr import to_zarr
from zarrify.utils.dask_utils import initialize_dask_client

client = initialize_dask_client("local")
to_zarr("input.mrc", "output.zarr", client)
```
