Skip to main content

OME-TIFF and OME-ZARR writer APIs designed for microscopy acquisition

Project description

ome-writers

License PyPI Python Version CI codecov

OME-TIFF and OME-ZARR writer APIs designed for microscopy acquisition.

This package provides a unified interface for writing OME-TIFF and OME-ZARR files, with various different backends. It is currently designed/optimized for "deterministic" use cases where the shape of the data is known ahead of time, and the data can be efficiently chunked and written in a predictable manner with a series of calls to stream.append(frame) as the data is generated.

Installation

pip install ome-writers

Or, include all optional dependencies for specific backends:

  • tensorstore: for tensorstore backend support
  • acquire-zarr: for acquire-zarr backend support
  • tiff: for tiff backend support using tifffile.
  • all: install all backends
pip install "ome-writers[all]"

Basic Usage

from ome_writers import Dimension, create_stream

# Configure the dimensions of the data stream
# The stream expects that data will be appended in the order and shape
# defined by the dimensions.
# labels must currently be one of 't', 'c', 'z', 'y', 'x', or 'p' (stage position).
dims = [
    Dimension(label="t", size=10, unit=(1.0, "s")),
    Dimension(label="c", size=3),
    Dimension(label="z", size=5, unit=(1.0, "um")),
    Dimension(label="y", size=512, unit=(1.0, "um"), chunk_size=128),
    Dimension(label="x", size=512, unit=(1.0, "um"), chunk_size=128),
]

stream = create_stream(
    "my_data.zarr",
    dimensions=dims,
    dtype='uint16',
    # backend may be any of
    # "acquire-zarr", "tensorstore", "tiff" (for ome-tiff) or "auto"
    backend="acquire-zarr"  
)

# Write data frame by frame, as it is generated by your application
for frame in ...:
    stream.append(frame)

# Flush any pending writes to disk
stream.flush()

Contributing

This is a work in progress; we absolutely welcome and appreciate contributions! If you have suggestions, improvements, or bug fixes, please open an issue or submit a pull request.

git clone https://github.com/pymmcore-plus/ome-writers.git
cd ome-writers

# setup env
uv sync

# test
uv run pytest

# lint
uv run pre-commit run -a

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

ome_writers-0.0.1b1.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

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

ome_writers-0.0.1b1-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file ome_writers-0.0.1b1.tar.gz.

File metadata

  • Download URL: ome_writers-0.0.1b1.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ome_writers-0.0.1b1.tar.gz
Algorithm Hash digest
SHA256 e037ebcf992a76d8eb7108618416426606f93047992d34aa0d3950f4b3241f4b
MD5 34b4a58e4d44d52bfcf91d582b887d4f
BLAKE2b-256 bcec630f772c77e34b1fcee2a1dd819eb1a1550b25ef0624c04cc88e0a8b4861

See more details on using hashes here.

Provenance

The following attestation bundles were made for ome_writers-0.0.1b1.tar.gz:

Publisher: ci.yml on pymmcore-plus/ome-writers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ome_writers-0.0.1b1-py3-none-any.whl.

File metadata

  • Download URL: ome_writers-0.0.1b1-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ome_writers-0.0.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 185b8d6cfd8a6ecb21666092d158f2f7708a91322b2d3ea19283b653e2c4a8c5
MD5 b5e092fab5639de80afa23a7d8a289c6
BLAKE2b-256 c7ac1f7315f58c3350525790a2bd91e500dac0428d94093035145cd014225494

See more details on using hashes here.

Provenance

The following attestation bundles were made for ome_writers-0.0.1b1-py3-none-any.whl:

Publisher: ci.yml on pymmcore-plus/ome-writers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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