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.3.tar.gz (22.9 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.3-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for zarrify-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ada8c9b8a624728bb8dab2f93717a45a3a7733fde4a229bbc27138b38ff624ff
MD5 fb3599591b85a2891301bba6b8f7a1af
BLAKE2b-256 f0cfdfd127b06675a91ff38f069ce73e89d13033e58a39ca65ead819f2b1afdb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zarrify-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 33c606e3e58fe061e3d29070ccc4a722689c1cab120fd474bea3290bf0c136e4
MD5 e53a08b1be24861322393f4d579441aa
BLAKE2b-256 b8e256603142747ce36fe9868c7ae680ea4792b140d89c0c8ac57b636448486b

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