Skip to main content

Convert czi to OME-TIFF

Project description

czi2ometiff

czi2ometiff is a Python tool for converting Zeiss CZI microscopy files into OME-TIFF, a widely used open standard for bioimaging data.
It provides a simple, reliable interface for extracting image data, channel names, and pixel sizes from CZI files and exporting them into high-quality OME-TIFF files.

Features

  • Easy to use — convert a CZI file to OME-TIFF with a single function call.
  • Automatic metadata extraction:
    • Channel names (from CZI metadata if available)
    • Pixel sizes in X, Y, and Z (converted to micrometers)
  • Flexible output — works with multi-channel and multi-Z images.
  • OME-TIFF pyramids — optional downsampled pyramid levels for fast viewing in tools like QuPath, OMERO, and napari.
  • Built on numpy2ometiff — leverages robust OME-TIFF writing from the numpy2ometiff library.

Installation

Install directly via pip:

pip install czi2ometiff

Example Usage

from czi2ometiff import convert_czi_to_ometiff

# Input CZI file
input_file = "example_image.czi"

# Optional: specify output path
output_file = "example_image.ome.tiff"

# Convert to OME-TIFF
output_path = convert_czi_to_ometiff(
    input_path=input_file,
    output_path=output_file,   # Optional—defaults to input filename with .ome.tiff
    downsample_count=8          # Number of pyramid levels
)

print("Saved OME-TIFF:", output_path)

How It Works

czi2ometiff automatically:

  1. Reads the CZI file using czifile
  2. Extracts image data as a NumPy array
  3. Detects channel names from CZI metadata
  4. Extracts pixel sizes (stored in meters in CZI; converted to micrometers)
  5. Reformats data into the (Z, C, Y, X) layout expected by OME-TIFF
  6. Writes the final OME-TIFF using the numpy2ometiff.write_ome_tiff() function

All required metadata is set for compatibility with standard bioimaging software.

Contributing

Contributions are welcome!
If you'd like to add features, improve metadata parsing, or enhance compatibility with other CZI variants:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

For major changes, please open an issue first to discuss your ideas.

License

This project is licensed under the BSD 3-Clause License — see the LICENSE file for details.

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

czi2ometiff-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

czi2ometiff-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: czi2ometiff-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for czi2ometiff-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9ed0d90a11348689a2f3cb9a36691cea679db48fed3dc8dac63f1b503d22105c
MD5 e4cb7167d0f0573c1b4aff7b29ac5e32
BLAKE2b-256 e598f18f96075ea775f31c0a5266543de8490925b9264afc09563a82492fab0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: czi2ometiff-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for czi2ometiff-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0251b8c908fd1d884d73b5cd896ed985988a341926c20cc291a7b3b620baf68a
MD5 e673e4939ac171aa87ea714925e9a4f5
BLAKE2b-256 19bb7863c518ca3d897029e5ec139683f224901ad973689cf8e5048e4dd13890

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