Skip to main content

xtiff

A tiny Python 3 library for writing multi-channel TIFF stacks.

The aim of this library is to provide an easy way to write multi-channel image stacks for external visualization and analysis. It acts as an interface to the popular tifffile package and supports xarray DataArrays as well as numpy-compatible data structures.

To maximize compatibility with third-party software, the images are written in standard-compliant fashion, with minimal metadata and in TZCYX channel order. In particular, a minimal subset of the OME-TIFF standard is supported, enabling the naming of channels.

Installation

Install from pypi:

pip install xtiff

Usage

The package provides one single function:

to_tiff(img, file, image_name=None, channel_names=None, image_date=None,
        write_mode=WriteMode.OME_TIFF, big_tiff=None, big_tiff_size_threshold=4294967246, 
        byte_order=None, compression_type=None, compression_level=0, pixel_size=None,
        pixel_depth=None, ome_schema_version=OMESchemaVersion.OME201606v2)

Documentation of the function parameters is available via Python's internal help system: help(xtiff.to_tiff)

FAQ

Why should I care about TIFF? I use Zarr/NetCDF/whatever.

That's good! TIFF is an old and complex file format, has many disadvantages and is impractical for storing large images. However, it also remains one of the most widely used scientific image formats and is (at least partially) supported by many popular tools, such as ImageJ. With xtiff, you can continue to store your images in your favorite file format, while having the opportunity to easily convert them to a format that can be read by (almost) any tool if needed.

Why can't I use the tifffile package directly?

Of course you can! Christoph Gohlke's tifffile package provides a very powerful and feature-complete interface for writing TIFF files and is the backend for xtiff. Essentially, the xtiff package is just a wrapper for tifffile. While you can in principle write any image directly with tifffile, in many cases, the flexibility of the TIFF format can be daunting. The xtiff package reduces the configuration burden and metadata to an essential minimum.

Change log

2019-12-12 v0.1.0 - Initial release

License

This project is licensed under the MIT license.

Metadata

Release files for xtiff 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xtiff 0.1.2
File Size Uploaded Provenance Actions
xtiff-0.1.2.tar.gz 7.1 kB Without provenance Details for xtiff-0.1.2.tar.gz

Release files / xtiff-0.1.2.tar.gz

Download URL xtiff-0.1.2.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2891c4f22c90aa7f6209096b156a001d757aa76cf44683edf50aea1f487ea449
BLAKE2b-256 checksum
How to use checksums
993f9102cd7cdf7cf3e44fbbed5e1bfb6870fef876c70f6f1c4c26d73071b3a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5

Security for xtiff 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page