Skip to main content

Read and write image data from and to TIFF files.

Project description

https://badge.fury.io/py/tifffile.png https://pypip.in/d/tifffile/badge.png

Read and write image data from and to TIFF files.

Image and metadata can be read from TIFF, BigTIFF, OME-TIFF, STK, LSM, NIH, SGI, ImageJ, MicroManager, FluoView, SEQ and GEL files. Only a subset of the TIFF specification is supported, mainly uncompressed and losslessly compressed 2**(0 to 6) bit integer, 16, 32 and 64-bit float, grayscale and RGB(A) images, which are commonly used in bio-scientific imaging. Specifically, reading JPEG and CCITT compressed image data or EXIF, IPTC, GPS, and XMP metadata is not implemented. Only primary info records are read for STK, FluoView, MicroManager, and NIH image formats.

TIFF, the Tagged Image File Format, is under the control of Adobe Systems. BigTIFF allows for files greater than 4 GB. STK, LSM, FluoView, SGI, SEQ, GEL, and OME-TIFF, are custom extensions defined by Molecular Devices (Universal Imaging Corporation), Carl Zeiss MicroImaging, Olympus, Silicon Graphics International, Media Cybernetics, Molecular Dynamics, and the Open Microscopy Environment consortium respectively.

For command line usage run python tifffile.py --help

Author:

Christoph Gohlke

Organization:

Laboratory for Fluorescence Dynamics, University of California, Irvine

Version:

2014.08.24

Requirements

Installation

  • If using conda, conda install tifffile -c conda-forge.

  • Otherwise, pip install tifffile.

Notes

This is a mirror of the code at http://www.lfd.uci.edu/~gohlke/code/tifffile.py.html. For any development concerns, please email Christoph Gohlke at cgohlke at uci.edu.

The API is not stable yet and might change between revisions.

Tested on little-endian platforms only.

Other Python packages and modules for reading bio-scientific TIFF files:

Acknowledgements

  • Egor Zindy, University of Manchester, for cz_lsm_scan_info specifics.

  • Wim Lewis for a bug fix and some read_cz_lsm functions.

  • Hadrien Mary for help on reading MicroManager files.

References

  1. TIFF 6.0 Specification and Supplements. Adobe Systems Incorporated. http://partners.adobe.com/public/developer/tiff/

  2. TIFF File Format FAQ. http://www.awaresystems.be/imaging/tiff/faq.html

  3. MetaMorph Stack (STK) Image File Format. http://support.meta.moleculardevices.com/docs/t10243.pdf

  4. Image File Format Description LSM 5/7 Release 6.0 (ZEN 2010). Carl Zeiss MicroImaging GmbH. BioSciences. May 10, 2011

  5. File Format Description - LSM 5xx Release 2.0. http://ibb.gsf.de/homepage/karsten.rodenacker/IDL/Lsmfile.doc

  6. The OME-TIFF format. http://www.openmicroscopy.org/site/support/file-formats/ome-tiff

  7. UltraQuant(r) Version 6.0 for Windows Start-Up Guide. http://www.ultralum.com/images%20ultralum/pdf/UQStart%20Up%20Guide.pdf

  8. Micro-Manager File Formats. http://www.micro-manager.org/wiki/Micro-Manager_File_Formats

  9. Tags for TIFF and Related Specifications. Digital Preservation. http://www.digitalpreservation.gov/formats/content/tiff_tags.shtml

Examples

>>> data = numpy.random.rand(5, 301, 219)
>>> imsave('temp.tif', data)
>>> image = imread('temp.tif')
>>> numpy.testing.assert_array_equal(image, data)
>>> with TiffFile('temp.tif') as tif:
...     images = tif.asarray()
...     for page in tif:
...         for tag in page.tags.values():
...             t = tag.name, tag.value
...         image = page.asarray()

Known build errors

On Windows, the error Error:unable to find vcvarsall.bat means that distutils is not correctly configured to use the C compiler. Modify (or create, if not existing) the configuration file distutils.cfg (located for example at C:\Python27\Lib\distutils\distutils.cfg) to contain:

[build]
compiler=mingw32

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

tifffile-0.11.0.tar.gz (72.3 kB view details)

Uploaded Source

Built Distribution

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

tifffile-0.11.0-cp35-cp35m-macosx_10_6_x86_64.whl (83.0 kB view details)

Uploaded CPython 3.5mmacOS 10.6+ x86-64

File details

Details for the file tifffile-0.11.0.tar.gz.

File metadata

  • Download URL: tifffile-0.11.0.tar.gz
  • Upload date:
  • Size: 72.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tifffile-0.11.0.tar.gz
Algorithm Hash digest
SHA256 b3dc2eac0c18dc5d0693e5a8dd9e3ec61fe4710f78603a45787111f613b2cee9
MD5 30d8d96c4bee984aeb9ad743f32ab2f1
BLAKE2b-256 afb5f676a06cacd0ff7b70c7af3e1e46a7aea543ae8dc3ad80fa75047e67d12f

See more details on using hashes here.

File details

Details for the file tifffile-0.11.0-cp35-cp35m-macosx_10_6_x86_64.whl.

File metadata

File hashes

Hashes for tifffile-0.11.0-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 089481c735d0b887e57c59978a4c4a80c8b2f708c5ac01a51b401b5f2f35df43
MD5 927faba14e45fbd4cf4503e595ff106b
BLAKE2b-256 609b4dd7e400252ea33c6e5aa8a453d8f4708eb43e404118f736797316b7b79d

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