Skip to main content

Convert scientific image formats (TIFF, MRC, N5) to OME-Zarr

Project description

Zarrify

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

Install

Requires Pixi.

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

Run

pixi run zarrify --config config.yaml

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

Config

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:

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

LSF example

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

Python API

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zarrify-0.1.0.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zarrify-0.1.0-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file zarrify-0.1.0.tar.gz.

File metadata

  • Download URL: zarrify-0.1.0.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for zarrify-0.1.0.tar.gz
Algorithm Hash digest
SHA256 907c15ac70dfe435f2186fe9723fa7d936a6a0c7bff10a45dbba32be450b5442
MD5 9d59f542f025c47ea80bc4b3f1d66c99
BLAKE2b-256 6faeb21cab81feea022887d24d4b0d7d9e307296a00454268a6351e2671596f7

See more details on using hashes here.

File details

Details for the file zarrify-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zarrify-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for zarrify-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b8e3cd257969c36da1f7b5a05c1db2a5803002e49866d248f7c6d2575dda2c
MD5 bc88f958f250cefb78b0de4c8b78f479
BLAKE2b-256 7f57ee85cc14f207c966c47541dbf74f94a6b58d4204f03252ffa895412c3fce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page