[med-svn] [Git][python-team/packages/tifffile][upstream] New upstream version 20201118

Ole Streicher gitlab at salsa.debian.org
Fri Nov 20 07:59:19 GMT 2020



Ole Streicher pushed to branch upstream at Debian Python Team / packages / tifffile


Commits:
34571760 by Ole Streicher at 2020-11-20T08:48:02+01:00
New upstream version 20201118
- - - - -


9 changed files:

- CHANGES.rst
- PKG-INFO
- README.rst
- setup.py
- tests/conftest.py
- tests/test_tifffile.py
- tifffile.egg-info/PKG-INFO
- tifffile.egg-info/requires.txt
- tifffile/tifffile.py


Changes:

=====================================
CHANGES.rst
=====================================
@@ -1,7 +1,70 @@
 Revisions
 ---------
+2020.11.18
+    Pass 4363 tests.
+    Support writing SEPARATED colorspace (#37).
+    Use imagecodecs.deflate if available.
+    Fix SCN and NDPI series with Z dimensions.
+    Add TiffReader alias for TiffFile.
+    TiffPage.is_volumetric returns True if ImageDepth > 1.
+    Zarr store getitem returns numpy arrays instead of bytes.
+2020.10.1
+    Formally deprecate unused TiffFile parameters (scikit-image #4996).
+2020.9.30
+    Allow to pass additional arguments to compression codecs.
+    Deprecate TiffWriter.save function (use TiffWriter.write).
+    Deprecate TiffWriter.save compress parameter (use compression).
+    Remove multifile parameter from TiffFile (breaking).
+    Pass all is_flag arguments from imread to TiffFile.
+    Do not byte-swap JPEG2000, WEBP, PNG, JPEGXR segments in TiffPage.decode.
+2020.9.29
+    Fix reading files produced by ScanImage > 2015 (#29).
+2020.9.28
+    Derive ZarrStore from MutableMapping.
+    Support zero shape ZarrTiffStore.
+    Fix ZarrFileStore with non-TIFF files.
+    Fix ZarrFileStore with missing files.
+    Cache one chunk in ZarrFileStore.
+    Keep track of already opened files in FileCache.
+    Change parse_filenames function to return zero-based indices.
+    Remove reopen parameter from asarray (breaking).
+    Rename FileSequence.fromfile to imread (breaking).
+2020.9.22
+    Add experimental zarr storage interface (WIP).
+    Remove unused first dimension from TiffPage.shaped (breaking).
+    Move reading of STK planes to series interface (breaking).
+    Always use virtual frames for ScanImage files.
+    Use DimensionOrder to determine axes order in OmeXml.
+    Enable writing striped volumetric images.
+    Keep complete dataoffsets and databytecounts for TiffFrames.
+    Return full size tiles from Tiffpage.segments.
+    Rename TiffPage.is_sgi property to is_volumetric (breaking).
+    Rename TiffPageSeries.is_pyramid to is_pyramidal (breaking).
+    Fix TypeError when passing jpegtables to non-JPEG decode function (#25).
+2020.9.3
+    Do not write contiguous series by default (breaking).
+    Allow to write to SubIFDs (WIP).
+    Fix writing F-contiguous numpy arrays (#24).
+2020.8.25
+    Do not convert EPICS timeStamp to datetime object.
+    Read incompletely written Micro-Manager image file stack header (#23).
+    Remove tag 51123 values from TiffFile.micromanager_metadata (breaking).
+2020.8.13
+    Use tifffile metadata over OME and ImageJ for TiffFile.series (breaking).
+    Fix writing iterable of pages with compression (#20).
+    Expand error checking of TiffWriter data, dtype, shape, and tile arguments.
+2020.7.24
+    Parse nested OmeXml metadata argument (WIP).
+    Do not lazy load TiffFrame JPEGTables.
+    Fix conditionally skipping some tests.
+2020.7.22
+    Do not auto-enable OME-TIFF if description is passed to TiffWriter.save.
+    Raise error writing empty bilevel or tiled images.
+    Allow to write tiled bilevel images.
+    Allow to write multi-page TIFF from iterable of single page images (WIP).
+    Add function to validate OME-XML.
+    Correct Philips slide width and length.
 2020.7.17
-    Pass 3022 tests.
     Initial support for writing OME-TIFF (WIP).
     Return samples as separate dimension in OME series (breaking).
     Fix modulo dimensions for multiple OME series.
@@ -37,7 +100,7 @@ Revisions
     Fix writing single tiles larger than image data (#3).
     Always store ExtraSamples values in tuple (breaking).
 2020.5.5
-    Allow to write tiled TIFF from iterator of tiles (WIP).
+    Allow to write tiled TIFF from iterable of tiles (WIP).
     Add function to iterate over decoded segments of TiffPage (WIP).
     Pass chunks of segments to ThreadPoolExecutor.map to reduce memory usage.
     Fix reading invalid files with too many strips.


=====================================
PKG-INFO
=====================================
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: tifffile
-Version: 2020.7.17
+Version: 2020.11.18
 Summary: Read and write TIFF(r) files
 Home-page: https://www.lfd.uci.edu/~gohlke/
 Author: Christoph Gohlke
@@ -20,23 +20,25 @@ Description: Read and write TIFF(r) files
         NIHImage, ImageJ, MicroManager, FluoView, ScanImage, SEQ, GEL, SVS, SCN, SIS,
         ZIF (Zoomable Image File Format), QPTIFF (QPI), NDPI, and GeoTIFF files.
         
+        Image data can be read as numpy arrays or zarr arrays/groups from strips,
+        tiles, pages (IFDs), SubIFDs, higher order series, and pyramidal levels.
+        
         Numpy arrays can be written to TIFF, BigTIFF, OME-TIFF, and ImageJ hyperstack
-        compatible files in multi-page, memory-mappable, tiled, predicted, or
-        compressed form.
+        compatible files in multi-page, volumetric, pyramidal, memory-mappable, tiled,
+        predicted, or compressed form.
         
-        A subset of the TIFF specification is supported, mainly uncompressed and
-        losslessly compressed 8, 16, 32 and 64-bit integer, 16, 32 and 64-bit float,
-        grayscale and multi-sample images.
-        Specifically, reading slices of image data, CCITT and OJPEG compression,
-        chroma subsampling without JPEG compression, color space transformations,
-        samples with differing types, or IPTC and XMP metadata are not implemented.
+        A subset of the TIFF specification is supported, mainly 8, 16, 32 and 64-bit
+        integer, 16, 32 and 64-bit float, grayscale and multi-sample images.
+        Specifically, CCITT and OJPEG compression, chroma subsampling without JPEG
+        compression, color space transformations, samples with differing types, or
+        IPTC and XMP metadata are not implemented.
         
         TIFF(r), the Tagged Image File Format, is a trademark and under control of
         Adobe Systems Incorporated. BigTIFF allows for files larger than 4 GB.
-        STK, LSM, FluoView, SGI, SEQ, GEL, QPTIFF, NDPI, and OME-TIFF, are custom
+        STK, LSM, FluoView, SGI, SEQ, GEL, QPTIFF, NDPI, SCN, and OME-TIFF, are custom
         extensions defined by Molecular Devices (Universal Imaging Corporation),
         Carl Zeiss MicroImaging, Olympus, Silicon Graphics International,
-        Media Cybernetics, Molecular Dynamics, PerkinElmer, Hamamatsu, and the
+        Media Cybernetics, Molecular Dynamics, PerkinElmer, Hamamatsu, Leica, and the
         Open Microscopy Environment consortium, respectively.
         
         For command line usage run ``python -m tifffile --help``
@@ -49,26 +51,91 @@ Description: Read and write TIFF(r) files
         
         :License: BSD 3-Clause
         
-        :Version: 2020.7.17
+        :Version: 2020.11.18
         
         Requirements
         ------------
         This release has been tested with the following requirements and dependencies
         (other versions may work):
         
-        * `CPython 3.7.8, 3.8.4, 3.9.0b4 64-bit <https://www.python.org>`_
-        * `Numpy 1.18.5 <https://pypi.org/project/numpy/>`_
+        * `CPython 3.7.9, 3.8.6, 3.9.0 64-bit <https://www.python.org>`_
+        * `Numpy 1.19.4 <https://pypi.org/project/numpy/>`_
         * `Imagecodecs 2020.5.30 <https://pypi.org/project/imagecodecs/>`_
           (required only for encoding or decoding LZW, JPEG, etc.)
-        * `Matplotlib 3.2.2 <https://pypi.org/project/matplotlib/>`_
+        * `Matplotlib 3.3.3 <https://pypi.org/project/matplotlib/>`_
           (required only for plotting)
-        * `Lxml 4.5.2 <https://github.com/lxml/lxml>`_
+        * `Lxml 4.6.1 <https://pypi.org/project/lxml/>`_
           (required only for validating and printing XML)
+        * `Zarr 2.5.0 <https://pypi.org/project/zarr/>`_
+          (required only for opening zarr storage)
         
         Revisions
         ---------
+        2020.11.18
+            Pass 4363 tests.
+            Support writing SEPARATED colorspace (#37).
+            Use imagecodecs.deflate if available.
+            Fix SCN and NDPI series with Z dimensions.
+            Add TiffReader alias for TiffFile.
+            TiffPage.is_volumetric returns True if ImageDepth > 1.
+            Zarr store getitem returns numpy arrays instead of bytes.
+        2020.10.1
+            Formally deprecate unused TiffFile parameters (scikit-image #4996).
+        2020.9.30
+            Allow to pass additional arguments to compression codecs.
+            Deprecate TiffWriter.save function (use TiffWriter.write).
+            Deprecate TiffWriter.save compress parameter (use compression).
+            Remove multifile parameter from TiffFile (breaking).
+            Pass all is_flag arguments from imread to TiffFile.
+            Do not byte-swap JPEG2000, WEBP, PNG, JPEGXR segments in TiffPage.decode.
+        2020.9.29
+            Fix reading files produced by ScanImage > 2015 (#29).
+        2020.9.28
+            Derive ZarrStore from MutableMapping.
+            Support zero shape ZarrTiffStore.
+            Fix ZarrFileStore with non-TIFF files.
+            Fix ZarrFileStore with missing files.
+            Cache one chunk in ZarrFileStore.
+            Keep track of already opened files in FileCache.
+            Change parse_filenames function to return zero-based indices.
+            Remove reopen parameter from asarray (breaking).
+            Rename FileSequence.fromfile to imread (breaking).
+        2020.9.22
+            Add experimental zarr storage interface (WIP).
+            Remove unused first dimension from TiffPage.shaped (breaking).
+            Move reading of STK planes to series interface (breaking).
+            Always use virtual frames for ScanImage files.
+            Use DimensionOrder to determine axes order in OmeXml.
+            Enable writing striped volumetric images.
+            Keep complete dataoffsets and databytecounts for TiffFrames.
+            Return full size tiles from Tiffpage.segments.
+            Rename TiffPage.is_sgi property to is_volumetric (breaking).
+            Rename TiffPageSeries.is_pyramid to is_pyramidal (breaking).
+            Fix TypeError when passing jpegtables to non-JPEG decode function (#25).
+        2020.9.3
+            Do not write contiguous series by default (breaking).
+            Allow to write to SubIFDs (WIP).
+            Fix writing F-contiguous numpy arrays (#24).
+        2020.8.25
+            Do not convert EPICS timeStamp to datetime object.
+            Read incompletely written Micro-Manager image file stack header (#23).
+            Remove tag 51123 values from TiffFile.micromanager_metadata (breaking).
+        2020.8.13
+            Use tifffile metadata over OME and ImageJ for TiffFile.series (breaking).
+            Fix writing iterable of pages with compression (#20).
+            Expand error checking of TiffWriter data, dtype, shape, and tile arguments.
+        2020.7.24
+            Parse nested OmeXml metadata argument (WIP).
+            Do not lazy load TiffFrame JPEGTables.
+            Fix conditionally skipping some tests.
+        2020.7.22
+            Do not auto-enable OME-TIFF if description is passed to TiffWriter.save.
+            Raise error writing empty bilevel or tiled images.
+            Allow to write tiled bilevel images.
+            Allow to write multi-page TIFF from iterable of single page images (WIP).
+            Add function to validate OME-XML.
+            Correct Philips slide width and length.
         2020.7.17
-            Pass 3022 tests.
             Initial support for writing OME-TIFF (WIP).
             Return samples as separate dimension in OME series (breaking).
             Fix modulo dimensions for multiple OME series.
@@ -104,7 +171,7 @@ Description: Read and write TIFF(r) files
             Fix writing single tiles larger than image data (#3).
             Always store ExtraSamples values in tuple (breaking).
         2020.5.5
-            Allow to write tiled TIFF from iterator of tiles (WIP).
+            Allow to write tiled TIFF from iterable of tiles (WIP).
             Add function to iterate over decoded segments of TiffPage (WIP).
             Pass chunks of segments to ThreadPoolExecutor.map to reduce memory usage.
             Fix reading invalid files with too many strips.
@@ -134,102 +201,6 @@ Description: Read and write TIFF(r) files
             Remove deprecated lzw_decode functions (breaking).
             Remove support for Python 2.7 and 3.5 (breaking).
         2019.7.26
-            Fix infinite loop reading more than two tags of same code in IFD.
-            Delay import of logging module.
-        2019.7.20
-            Fix OME-XML detection for files created by Imaris.
-            Remove or replace assert statements.
-        2019.7.2
-            Do not write SampleFormat tag for unsigned data types.
-            Write ByteCount tag values as SHORT or LONG if possible.
-            Allow to specify axes in FileSequence pattern via group names.
-            Add option to concurrently read FileSequence using threads.
-            Derive TiffSequence from FileSequence.
-            Use str(datetime.timedelta) to format Timer duration.
-            Use perf_counter for Timer if possible.
-        2019.6.18
-            Fix reading planar RGB ImageJ files created by Bio-Formats.
-            Fix reading single-file, multi-image OME-TIFF without UUID.
-            Presume LSM stores uncompressed images contiguously per page.
-            Reformat some complex expressions.
-        2019.5.30
-            Ignore invalid frames in OME-TIFF.
-            Set default subsampling to (2, 2) for RGB JPEG compression.
-            Fix reading and writing planar RGB JPEG compression.
-            Replace buffered_read with FileHandle.read_segments.
-            Include page or frame numbers in exceptions and warnings.
-            Add Timer class.
-        2019.5.22
-            Add optional chroma subsampling for JPEG compression.
-            Enable writing PNG, JPEG, JPEGXR, and JPEG2K compression (WIP).
-            Fix writing tiled images with WebP compression.
-            Improve handling GeoTIFF sparse files.
-        2019.3.18
-            Fix regression decoding JPEG with RGB photometrics.
-            Fix reading OME-TIFF files with corrupted but unused pages.
-            Allow to load TiffFrame without specifying keyframe.
-            Calculate virtual TiffFrames for non-BigTIFF ScanImage files > 2GB.
-            Rename property is_chroma_subsampled to is_subsampled (breaking).
-            Make more attributes and methods private (WIP).
-        2019.3.8
-            Fix MemoryError when RowsPerStrip > ImageLength.
-            Fix SyntaxWarning on Python 3.8.
-            Fail to decode JPEG to planar RGB (tentative).
-            Separate public from private test files (WIP).
-            Allow testing without data files or imagecodecs.
-        2019.2.22
-            Use imagecodecs-lite as a fallback for imagecodecs.
-            Simplify reading numpy arrays from file.
-            Use TiffFrames when reading arrays from page sequences.
-            Support slices and iterators in TiffPageSeries sequence interface.
-            Auto-detect uniform series.
-            Use page hash to determine generic series.
-            Turn off TiffPages cache (tentative).
-            Pass through more parameters in imread.
-            Discontinue movie parameter in imread and TiffFile (breaking).
-            Discontinue bigsize parameter in imwrite (breaking).
-            Raise TiffFileError in case of issues with TIFF structure.
-            Return TiffFile.ome_metadata as XML (breaking).
-            Ignore OME series when last dimensions are not stored in TIFF pages.
-        2019.2.10
-            Assemble IFDs in memory to speed-up writing on some slow media.
-            Handle discontinued arguments fastij, multifile_close, and pages.
-        2019.1.30
-            Use black background in imshow.
-            Do not write datetime tag by default (breaking).
-            Fix OME-TIFF with SamplesPerPixel > 1.
-            Allow 64-bit IFD offsets for NDPI (files > 4GB still not supported).
-        2019.1.4
-            Fix decoding deflate without imagecodecs.
-        2019.1.1
-            Update copyright year.
-            Require imagecodecs >= 2018.12.16.
-            Do not use JPEG tables from keyframe.
-            Enable decoding large JPEG in NDPI.
-            Decode some old-style JPEG.
-            Reorder OME channel axis to match PlanarConfiguration storage.
-            Return tiled images as contiguous arrays.
-            Add decode_lzw proxy function for compatibility with old czifile module.
-            Use dedicated logger.
-        2018.11.28
-            Make SubIFDs accessible as TiffPage.pages.
-            Make parsing of TiffSequence axes pattern optional (breaking).
-            Limit parsing of TiffSequence axes pattern to file names, not path names.
-            Do not interpolate in imshow if image dimensions <= 512, else use bilinear.
-            Use logging.warning instead of warnings.warn in many cases.
-            Fix numpy FutureWarning for out == 'memmap'.
-            Adjust ZSTD and WebP compression to libtiff-4.0.10 (WIP).
-            Decode old-style LZW with imagecodecs >= 2018.11.8.
-            Remove TiffFile.qptiff_metadata (QPI metadata are per page).
-            Do not use keyword arguments before variable positional arguments.
-            Make either all or none return statements in a function return expression.
-            Use pytest parametrize to generate tests.
-            Replace test classes with functions.
-        2018.11.6
-            Rename imsave function to imwrite.
-            Readd Python implementations of packints, delta, and bitorder codecs.
-            Fix TiffFrame.compression AttributeError.
-        2018.10.18
             ...
         
         Refer to the CHANGES file for older revisions.
@@ -240,7 +211,7 @@ Description: Read and write TIFF(r) files
         
         Tested on little-endian platforms only.
         
-        Python 32-bit versions are deprecated. Python <= 3.6 are no longer supported.
+        Python 32-bit versions are deprecated. Python <= 3.7 are no longer supported.
         
         Tifffile relies on the `imagecodecs <https://pypi.org/project/imagecodecs/>`_
         package for encoding and decoding LZW, JPEG, and other compressed image
@@ -262,17 +233,24 @@ Description: Read and write TIFF(r) files
           tag of the first IFD defines the position of TIFF IFDs in the high
           dimensional data. Tifffile can read OME-TIFF files, except when the OME-XML
           metadata are stored in a separate file. Tifffile can write numpy arrays
-          to single-file, non-pyramidal OME-TIFF.
+          to single-file OME-TIFF.
         * *LSM* stores all IFDs below 4 GB but wraps around 32-bit StripOffsets.
           The StripOffsets of each series and position require separate unwrapping.
           The StripByteCounts tag contains the number of bytes for the uncompressed
           data. Tifffile can read large LSM files.
+        * *STK* (MetaMorph Stack) contains additional image planes stored contiguously
+          after the image data of the first page. The total number of planes
+          is equal to the counts of the UIC2tag. Tifffile can read STK files.
         * *NDPI* uses some 64-bit offsets in the file header, IFD, and tag structures.
           Tag values/offsets can be corrected using high bits stored after IFD
           structures. JPEG compressed segments with dimensions >65536 or missing
           restart markers are not readable with libjpeg. Tifffile can read NDPI
           files > 4 GB. JPEG segments with restart markers and dimensions >65536 can
           be decoded with the imagecodecs library on Windows.
+        * *Philips* TIFF slides store wrong ImageWidth and ImageLength tag values for
+          tiled pages. The values can be corrected using the DICOM_PIXEL_SPACING
+          attributes of the XML formatted description of the first page. Tifffile can
+          read Philips slides.
         * *ScanImage* optionally allows corrupt non-BigTIFF files > 2 GB. The values
           of StripOffsets and StripByteCounts can be recovered using the constant
           differences of the offsets of IFD and tag values throughout the file.
@@ -299,6 +277,7 @@ Description: Read and write TIFF(r) files
         * `ScanImageTiffReaderPython
           <https://gitlab.com/vidriotech/scanimagetiffreader-python>`_
         * `bigtiff <https://pypi.org/project/bigtiff>`_
+        * `Large Image <https://github.com/girder/large_image>`_
         
         Some libraries are using tifffile to write OME-TIFF files:
         
@@ -308,6 +287,10 @@ Description: Read and write TIFF(r) files
           <https://pypi.org/project/aicsimageio>`_
         * `xtiff <https://github.com/BodenmillerGroup/xtiff>`_
         
+        Other tools for inspecting and manipulating TIFF files:
+        
+        * `tifftools <https://github.com/DigitalSlideArchive/tifftools>`_
+        
         References
         ----------
         * TIFF 6.0 Specification and Supplements. Adobe Systems Incorporated.
@@ -373,7 +356,7 @@ Description: Read and write TIFF(r) files
         Save a floating-point array and metadata, using zlib compression:
         
         >>> data = numpy.random.rand(2, 5, 3, 301, 219).astype('float32')
-        >>> imwrite('temp.tif', data, compress=6, metadata={'axes': 'TZCYX'})
+        >>> imwrite('temp.tif', data, compression='zlib', metadata={'axes': 'TZCYX'})
         
         Save a volume with xyz voxel size 2.6755x2.6755x3.9474 micron^3 to an ImageJ
         formatted TIFF file:
@@ -449,12 +432,19 @@ Description: Read and write TIFF(r) files
         1.0
         >>> del memmap_image
         
-        Successively append images to a BigTIFF file, which can exceed 4 GB:
+        Successively write the frames of one contiguous series to a TIFF file:
+        
+        >>> data = numpy.random.randint(0, 255, (30, 301, 219), 'uint8')
+        >>> with TiffWriter('temp.tif') as tif:
+        ...     for frame in data:
+        ...         tif.write(frame, contiguous=True)
+        
+        Successively append image series to a BigTIFF file, which can exceed 4 GB:
         
         >>> data = numpy.random.randint(0, 255, (5, 2, 3, 301, 219), 'uint8')
         >>> with TiffWriter('temp.tif', bigtiff=True) as tif:
         ...     for i in range(data.shape[0]):
-        ...         tif.save(data[i], compress=6, photometric='minisblack')
+        ...         tif.write(data[i], photometric='minisblack')
         
         Append an image to the existing TIFF file:
         
@@ -472,31 +462,18 @@ Description: Read and write TIFF(r) files
         Write two numpy arrays to a multi-series OME-TIFF file:
         
         >>> data0 = numpy.random.randint(0, 255, (32, 32, 3), 'uint8')
-        >>> data1 = numpy.random.randint(0, 1023, (5, 256, 256), 'uint16')
-        >>> with TiffWriter('temp.ome.tif', ome=True) as tif:
-        ...     tif.save(data0, compress=6, photometric='rgb')
-        ...     tif.save(data1, photometric='minisblack', contiguous=False,
-        ...              metadata=dict(axes='ZYX', SignificantBits=10,
-        ...                            PositionZ=[0.0, 1.0, 2.0, 3.0, 4.0]))
+        >>> data1 = numpy.random.randint(0, 1023, (4, 256, 256), 'uint16')
+        >>> with TiffWriter('temp.ome.tif') as tif:
+        ...     tif.write(data0, photometric='rgb')
+        ...     tif.write(data1, photometric='minisblack',
+        ...              metadata={'axes': 'ZYX', 'SignificantBits': 10,
+        ...                        'Plane': {'PositionZ': [0.0, 1.0, 2.0, 3.0]}})
         
         Read the second image series from the OME-TIFF file:
         
         >>> series1 = imread('temp.ome.tif', series=1)
         >>> series1.shape
-        (5, 256, 256)
-        
-        Read an image stack from a series of TIFF files with a file name pattern:
-        
-        >>> imwrite('temp_C001T001.tif', numpy.random.rand(64, 64))
-        >>> imwrite('temp_C001T002.tif', numpy.random.rand(64, 64))
-        >>> image_sequence = TiffSequence('temp_C001*.tif', pattern='axes')
-        >>> image_sequence.shape
-        (1, 2)
-        >>> image_sequence.axes
-        'CT'
-        >>> data = image_sequence.asarray()
-        >>> data.shape
-        (1, 2, 64, 64)
+        (4, 256, 256)
         
         Create a TIFF file from a generator of tiles:
         
@@ -505,38 +482,67 @@ Description: Read and write TIFF(r) files
         ...     for i in range(data.shape[0]): yield data[i]
         >>> imwrite('temp.tif', tiles(), dtype='uint16', shape=(48, 64), tile=(16, 16))
         
-        Write a tiled, multi-resolution, pyramidal TIFF file using JPEG compression:
+        Write a tiled, multi-resolution, pyramidal OME-TIFF file using JPEG
+        compression. Sub-resolution images are written to SubIFDs:
         
         >>> data = numpy.arange(1024*1024*3, dtype='uint8').reshape((1024, 1024, 3))
-        >>> with TiffWriter('temp.tif') as tif:
-        ...     options = dict(tile=(256, 256), compress='jpeg', metadata=None)
-        ...     tif.save(data, **options)
-        ...     # save pyramid levels. In production use resampling to generate levels!
-        ...     tif.save(data[::2, ::2], subfiletype=1, **options)
-        ...     tif.save(data[::4, ::4], subfiletype=1, **options)
-        
-        Access the image levels in the pyramidal TIFF file:
-        
-        >>> baseimage = imread('temp.tif')
-        >>> second_level = imread('temp.tif', series=0, level=1)
-        >>> with TiffFile('temp.tif') as tif:
+        >>> with TiffWriter('temp.ome.tif') as tif:
+        ...     options = dict(tile=(256, 256), compression='jpeg')
+        ...     tif.write(data, subifds=2, **options)
+        ...     # save pyramid levels to the two subifds
+        ...     # in production use resampling to generate sub-resolutions!
+        ...     tif.write(data[::2, ::2], subfiletype=1, **options)
+        ...     tif.write(data[::4, ::4], subfiletype=1, **options)
+        
+        Access the image levels in the pyramidal OME-TIFF file:
+        
+        >>> baseimage = imread('temp.ome.tif')
+        >>> second_level = imread('temp.ome.tif', series=0, level=1)
+        >>> with TiffFile('temp.ome.tif') as tif:
         ...     baseimage = tif.series[0].asarray()
         ...     second_level = tif.series[0].levels[1].asarray()
         
         Iterate over and decode single JPEG compressed tiles in the TIFF file:
         
-        >>> with TiffFile('temp.tif') as tif:
+        >>> with TiffFile('temp.ome.tif') as tif:
         ...     fh = tif.filehandle
         ...     for page in tif.pages:
-        ...         jpegtables = page.tags.get('JPEGTables', None)
-        ...         if jpegtables is not None:
-        ...             jpegtables = jpegtables.value
         ...         for index, (offset, bytecount) in enumerate(
         ...             zip(page.dataoffsets, page.databytecounts)
         ...         ):
         ...             fh.seek(offset)
         ...             data = fh.read(bytecount)
-        ...             tile, indices, shape = page.decode(data, index, jpegtables)
+        ...             tile, indices, shape = page.decode(
+        ...                 data, index, jpegtables=page.jpegtables
+        ...             )
+        
+        Use zarr to access the tiled, pyramidal images in the TIFF file:
+        
+        >>> import zarr
+        >>> store = imread('temp.ome.tif', aszarr=True)
+        >>> z = zarr.open(store, mode='r')
+        >>> z
+        <zarr.hierarchy.Group '/' read-only>
+        >>> z[0]  # base layer
+        <zarr.core.Array '/0' (1024, 1024, 3) uint8 read-only>
+        >>> store.close()
+        
+        Read an image stack from a series of TIFF files with a file name pattern:
+        
+        >>> imwrite('temp_C001T001.tif', numpy.random.rand(64, 64))
+        >>> imwrite('temp_C001T002.tif', numpy.random.rand(64, 64))
+        >>> image_sequence = TiffSequence('temp_C001*.tif', pattern='axes')
+        >>> image_sequence.shape
+        (1, 2)
+        >>> image_sequence.axes
+        'CT'
+        >>> data = image_sequence.asarray()
+        >>> data.shape
+        (1, 2, 64, 64)
+        >>> with image_sequence.aszarr() as store:
+        ...     zarr.open(store, mode='r')
+        <zarr.core.Array (1, 2, 64, 64) float64 read-only>
+        >>> image_sequence.close()
         
 Platform: any
 Classifier: Development Status :: 4 - Beta
@@ -548,5 +554,5 @@ Classifier: Programming Language :: Python :: 3 :: Only
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
-Requires-Python: >=3.6
+Requires-Python: >=3.7
 Provides-Extra: all


=====================================
README.rst
=====================================
@@ -10,23 +10,25 @@ Image and metadata can be read from TIFF, BigTIFF, OME-TIFF, STK, LSM, SGI,
 NIHImage, ImageJ, MicroManager, FluoView, ScanImage, SEQ, GEL, SVS, SCN, SIS,
 ZIF (Zoomable Image File Format), QPTIFF (QPI), NDPI, and GeoTIFF files.
 
+Image data can be read as numpy arrays or zarr arrays/groups from strips,
+tiles, pages (IFDs), SubIFDs, higher order series, and pyramidal levels.
+
 Numpy arrays can be written to TIFF, BigTIFF, OME-TIFF, and ImageJ hyperstack
-compatible files in multi-page, memory-mappable, tiled, predicted, or
-compressed form.
+compatible files in multi-page, volumetric, pyramidal, memory-mappable, tiled,
+predicted, or compressed form.
 
-A subset of the TIFF specification is supported, mainly uncompressed and
-losslessly compressed 8, 16, 32 and 64-bit integer, 16, 32 and 64-bit float,
-grayscale and multi-sample images.
-Specifically, reading slices of image data, CCITT and OJPEG compression,
-chroma subsampling without JPEG compression, color space transformations,
-samples with differing types, or IPTC and XMP metadata are not implemented.
+A subset of the TIFF specification is supported, mainly 8, 16, 32 and 64-bit
+integer, 16, 32 and 64-bit float, grayscale and multi-sample images.
+Specifically, CCITT and OJPEG compression, chroma subsampling without JPEG
+compression, color space transformations, samples with differing types, or
+IPTC and XMP metadata are not implemented.
 
 TIFF(r), the Tagged Image File Format, is a trademark and under control of
 Adobe Systems Incorporated. BigTIFF allows for files larger than 4 GB.
-STK, LSM, FluoView, SGI, SEQ, GEL, QPTIFF, NDPI, and OME-TIFF, are custom
+STK, LSM, FluoView, SGI, SEQ, GEL, QPTIFF, NDPI, SCN, and OME-TIFF, are custom
 extensions defined by Molecular Devices (Universal Imaging Corporation),
 Carl Zeiss MicroImaging, Olympus, Silicon Graphics International,
-Media Cybernetics, Molecular Dynamics, PerkinElmer, Hamamatsu, and the
+Media Cybernetics, Molecular Dynamics, PerkinElmer, Hamamatsu, Leica, and the
 Open Microscopy Environment consortium, respectively.
 
 For command line usage run ``python -m tifffile --help``
@@ -39,26 +41,91 @@ For command line usage run ``python -m tifffile --help``
 
 :License: BSD 3-Clause
 
-:Version: 2020.7.17
+:Version: 2020.11.18
 
 Requirements
 ------------
 This release has been tested with the following requirements and dependencies
 (other versions may work):
 
-* `CPython 3.7.8, 3.8.4, 3.9.0b4 64-bit <https://www.python.org>`_
-* `Numpy 1.18.5 <https://pypi.org/project/numpy/>`_
+* `CPython 3.7.9, 3.8.6, 3.9.0 64-bit <https://www.python.org>`_
+* `Numpy 1.19.4 <https://pypi.org/project/numpy/>`_
 * `Imagecodecs 2020.5.30 <https://pypi.org/project/imagecodecs/>`_
   (required only for encoding or decoding LZW, JPEG, etc.)
-* `Matplotlib 3.2.2 <https://pypi.org/project/matplotlib/>`_
+* `Matplotlib 3.3.3 <https://pypi.org/project/matplotlib/>`_
   (required only for plotting)
-* `Lxml 4.5.2 <https://github.com/lxml/lxml>`_
+* `Lxml 4.6.1 <https://pypi.org/project/lxml/>`_
   (required only for validating and printing XML)
+* `Zarr 2.5.0 <https://pypi.org/project/zarr/>`_
+  (required only for opening zarr storage)
 
 Revisions
 ---------
+2020.11.18
+    Pass 4363 tests.
+    Support writing SEPARATED colorspace (#37).
+    Use imagecodecs.deflate if available.
+    Fix SCN and NDPI series with Z dimensions.
+    Add TiffReader alias for TiffFile.
+    TiffPage.is_volumetric returns True if ImageDepth > 1.
+    Zarr store getitem returns numpy arrays instead of bytes.
+2020.10.1
+    Formally deprecate unused TiffFile parameters (scikit-image #4996).
+2020.9.30
+    Allow to pass additional arguments to compression codecs.
+    Deprecate TiffWriter.save function (use TiffWriter.write).
+    Deprecate TiffWriter.save compress parameter (use compression).
+    Remove multifile parameter from TiffFile (breaking).
+    Pass all is_flag arguments from imread to TiffFile.
+    Do not byte-swap JPEG2000, WEBP, PNG, JPEGXR segments in TiffPage.decode.
+2020.9.29
+    Fix reading files produced by ScanImage > 2015 (#29).
+2020.9.28
+    Derive ZarrStore from MutableMapping.
+    Support zero shape ZarrTiffStore.
+    Fix ZarrFileStore with non-TIFF files.
+    Fix ZarrFileStore with missing files.
+    Cache one chunk in ZarrFileStore.
+    Keep track of already opened files in FileCache.
+    Change parse_filenames function to return zero-based indices.
+    Remove reopen parameter from asarray (breaking).
+    Rename FileSequence.fromfile to imread (breaking).
+2020.9.22
+    Add experimental zarr storage interface (WIP).
+    Remove unused first dimension from TiffPage.shaped (breaking).
+    Move reading of STK planes to series interface (breaking).
+    Always use virtual frames for ScanImage files.
+    Use DimensionOrder to determine axes order in OmeXml.
+    Enable writing striped volumetric images.
+    Keep complete dataoffsets and databytecounts for TiffFrames.
+    Return full size tiles from Tiffpage.segments.
+    Rename TiffPage.is_sgi property to is_volumetric (breaking).
+    Rename TiffPageSeries.is_pyramid to is_pyramidal (breaking).
+    Fix TypeError when passing jpegtables to non-JPEG decode function (#25).
+2020.9.3
+    Do not write contiguous series by default (breaking).
+    Allow to write to SubIFDs (WIP).
+    Fix writing F-contiguous numpy arrays (#24).
+2020.8.25
+    Do not convert EPICS timeStamp to datetime object.
+    Read incompletely written Micro-Manager image file stack header (#23).
+    Remove tag 51123 values from TiffFile.micromanager_metadata (breaking).
+2020.8.13
+    Use tifffile metadata over OME and ImageJ for TiffFile.series (breaking).
+    Fix writing iterable of pages with compression (#20).
+    Expand error checking of TiffWriter data, dtype, shape, and tile arguments.
+2020.7.24
+    Parse nested OmeXml metadata argument (WIP).
+    Do not lazy load TiffFrame JPEGTables.
+    Fix conditionally skipping some tests.
+2020.7.22
+    Do not auto-enable OME-TIFF if description is passed to TiffWriter.save.
+    Raise error writing empty bilevel or tiled images.
+    Allow to write tiled bilevel images.
+    Allow to write multi-page TIFF from iterable of single page images (WIP).
+    Add function to validate OME-XML.
+    Correct Philips slide width and length.
 2020.7.17
-    Pass 3022 tests.
     Initial support for writing OME-TIFF (WIP).
     Return samples as separate dimension in OME series (breaking).
     Fix modulo dimensions for multiple OME series.
@@ -94,7 +161,7 @@ Revisions
     Fix writing single tiles larger than image data (#3).
     Always store ExtraSamples values in tuple (breaking).
 2020.5.5
-    Allow to write tiled TIFF from iterator of tiles (WIP).
+    Allow to write tiled TIFF from iterable of tiles (WIP).
     Add function to iterate over decoded segments of TiffPage (WIP).
     Pass chunks of segments to ThreadPoolExecutor.map to reduce memory usage.
     Fix reading invalid files with too many strips.
@@ -124,102 +191,6 @@ Revisions
     Remove deprecated lzw_decode functions (breaking).
     Remove support for Python 2.7 and 3.5 (breaking).
 2019.7.26
-    Fix infinite loop reading more than two tags of same code in IFD.
-    Delay import of logging module.
-2019.7.20
-    Fix OME-XML detection for files created by Imaris.
-    Remove or replace assert statements.
-2019.7.2
-    Do not write SampleFormat tag for unsigned data types.
-    Write ByteCount tag values as SHORT or LONG if possible.
-    Allow to specify axes in FileSequence pattern via group names.
-    Add option to concurrently read FileSequence using threads.
-    Derive TiffSequence from FileSequence.
-    Use str(datetime.timedelta) to format Timer duration.
-    Use perf_counter for Timer if possible.
-2019.6.18
-    Fix reading planar RGB ImageJ files created by Bio-Formats.
-    Fix reading single-file, multi-image OME-TIFF without UUID.
-    Presume LSM stores uncompressed images contiguously per page.
-    Reformat some complex expressions.
-2019.5.30
-    Ignore invalid frames in OME-TIFF.
-    Set default subsampling to (2, 2) for RGB JPEG compression.
-    Fix reading and writing planar RGB JPEG compression.
-    Replace buffered_read with FileHandle.read_segments.
-    Include page or frame numbers in exceptions and warnings.
-    Add Timer class.
-2019.5.22
-    Add optional chroma subsampling for JPEG compression.
-    Enable writing PNG, JPEG, JPEGXR, and JPEG2K compression (WIP).
-    Fix writing tiled images with WebP compression.
-    Improve handling GeoTIFF sparse files.
-2019.3.18
-    Fix regression decoding JPEG with RGB photometrics.
-    Fix reading OME-TIFF files with corrupted but unused pages.
-    Allow to load TiffFrame without specifying keyframe.
-    Calculate virtual TiffFrames for non-BigTIFF ScanImage files > 2GB.
-    Rename property is_chroma_subsampled to is_subsampled (breaking).
-    Make more attributes and methods private (WIP).
-2019.3.8
-    Fix MemoryError when RowsPerStrip > ImageLength.
-    Fix SyntaxWarning on Python 3.8.
-    Fail to decode JPEG to planar RGB (tentative).
-    Separate public from private test files (WIP).
-    Allow testing without data files or imagecodecs.
-2019.2.22
-    Use imagecodecs-lite as a fallback for imagecodecs.
-    Simplify reading numpy arrays from file.
-    Use TiffFrames when reading arrays from page sequences.
-    Support slices and iterators in TiffPageSeries sequence interface.
-    Auto-detect uniform series.
-    Use page hash to determine generic series.
-    Turn off TiffPages cache (tentative).
-    Pass through more parameters in imread.
-    Discontinue movie parameter in imread and TiffFile (breaking).
-    Discontinue bigsize parameter in imwrite (breaking).
-    Raise TiffFileError in case of issues with TIFF structure.
-    Return TiffFile.ome_metadata as XML (breaking).
-    Ignore OME series when last dimensions are not stored in TIFF pages.
-2019.2.10
-    Assemble IFDs in memory to speed-up writing on some slow media.
-    Handle discontinued arguments fastij, multifile_close, and pages.
-2019.1.30
-    Use black background in imshow.
-    Do not write datetime tag by default (breaking).
-    Fix OME-TIFF with SamplesPerPixel > 1.
-    Allow 64-bit IFD offsets for NDPI (files > 4GB still not supported).
-2019.1.4
-    Fix decoding deflate without imagecodecs.
-2019.1.1
-    Update copyright year.
-    Require imagecodecs >= 2018.12.16.
-    Do not use JPEG tables from keyframe.
-    Enable decoding large JPEG in NDPI.
-    Decode some old-style JPEG.
-    Reorder OME channel axis to match PlanarConfiguration storage.
-    Return tiled images as contiguous arrays.
-    Add decode_lzw proxy function for compatibility with old czifile module.
-    Use dedicated logger.
-2018.11.28
-    Make SubIFDs accessible as TiffPage.pages.
-    Make parsing of TiffSequence axes pattern optional (breaking).
-    Limit parsing of TiffSequence axes pattern to file names, not path names.
-    Do not interpolate in imshow if image dimensions <= 512, else use bilinear.
-    Use logging.warning instead of warnings.warn in many cases.
-    Fix numpy FutureWarning for out == 'memmap'.
-    Adjust ZSTD and WebP compression to libtiff-4.0.10 (WIP).
-    Decode old-style LZW with imagecodecs >= 2018.11.8.
-    Remove TiffFile.qptiff_metadata (QPI metadata are per page).
-    Do not use keyword arguments before variable positional arguments.
-    Make either all or none return statements in a function return expression.
-    Use pytest parametrize to generate tests.
-    Replace test classes with functions.
-2018.11.6
-    Rename imsave function to imwrite.
-    Readd Python implementations of packints, delta, and bitorder codecs.
-    Fix TiffFrame.compression AttributeError.
-2018.10.18
     ...
 
 Refer to the CHANGES file for older revisions.
@@ -230,7 +201,7 @@ The API is not stable yet and might change between revisions.
 
 Tested on little-endian platforms only.
 
-Python 32-bit versions are deprecated. Python <= 3.6 are no longer supported.
+Python 32-bit versions are deprecated. Python <= 3.7 are no longer supported.
 
 Tifffile relies on the `imagecodecs <https://pypi.org/project/imagecodecs/>`_
 package for encoding and decoding LZW, JPEG, and other compressed image
@@ -252,17 +223,24 @@ some of which allow file or data sizes to exceed the 4 GB limit:
   tag of the first IFD defines the position of TIFF IFDs in the high
   dimensional data. Tifffile can read OME-TIFF files, except when the OME-XML
   metadata are stored in a separate file. Tifffile can write numpy arrays
-  to single-file, non-pyramidal OME-TIFF.
+  to single-file OME-TIFF.
 * *LSM* stores all IFDs below 4 GB but wraps around 32-bit StripOffsets.
   The StripOffsets of each series and position require separate unwrapping.
   The StripByteCounts tag contains the number of bytes for the uncompressed
   data. Tifffile can read large LSM files.
+* *STK* (MetaMorph Stack) contains additional image planes stored contiguously
+  after the image data of the first page. The total number of planes
+  is equal to the counts of the UIC2tag. Tifffile can read STK files.
 * *NDPI* uses some 64-bit offsets in the file header, IFD, and tag structures.
   Tag values/offsets can be corrected using high bits stored after IFD
   structures. JPEG compressed segments with dimensions >65536 or missing
   restart markers are not readable with libjpeg. Tifffile can read NDPI
   files > 4 GB. JPEG segments with restart markers and dimensions >65536 can
   be decoded with the imagecodecs library on Windows.
+* *Philips* TIFF slides store wrong ImageWidth and ImageLength tag values for
+  tiled pages. The values can be corrected using the DICOM_PIXEL_SPACING
+  attributes of the XML formatted description of the first page. Tifffile can
+  read Philips slides.
 * *ScanImage* optionally allows corrupt non-BigTIFF files > 2 GB. The values
   of StripOffsets and StripByteCounts can be recovered using the constant
   differences of the offsets of IFD and tag values throughout the file.
@@ -289,6 +267,7 @@ Other libraries for reading scientific TIFF files from Python:
 * `ScanImageTiffReaderPython
   <https://gitlab.com/vidriotech/scanimagetiffreader-python>`_
 * `bigtiff <https://pypi.org/project/bigtiff>`_
+* `Large Image <https://github.com/girder/large_image>`_
 
 Some libraries are using tifffile to write OME-TIFF files:
 
@@ -298,6 +277,10 @@ Some libraries are using tifffile to write OME-TIFF files:
   <https://pypi.org/project/aicsimageio>`_
 * `xtiff <https://github.com/BodenmillerGroup/xtiff>`_
 
+Other tools for inspecting and manipulating TIFF files:
+
+* `tifftools <https://github.com/DigitalSlideArchive/tifftools>`_
+
 References
 ----------
 * TIFF 6.0 Specification and Supplements. Adobe Systems Incorporated.
@@ -363,7 +346,7 @@ Save a numpy array to a single-page RGB TIFF file:
 Save a floating-point array and metadata, using zlib compression:
 
 >>> data = numpy.random.rand(2, 5, 3, 301, 219).astype('float32')
->>> imwrite('temp.tif', data, compress=6, metadata={'axes': 'TZCYX'})
+>>> imwrite('temp.tif', data, compression='zlib', metadata={'axes': 'TZCYX'})
 
 Save a volume with xyz voxel size 2.6755x2.6755x3.9474 micron^3 to an ImageJ
 formatted TIFF file:
@@ -439,12 +422,19 @@ Memory-map image data of the first page in the TIFF file:
 1.0
 >>> del memmap_image
 
-Successively append images to a BigTIFF file, which can exceed 4 GB:
+Successively write the frames of one contiguous series to a TIFF file:
+
+>>> data = numpy.random.randint(0, 255, (30, 301, 219), 'uint8')
+>>> with TiffWriter('temp.tif') as tif:
+...     for frame in data:
+...         tif.write(frame, contiguous=True)
+
+Successively append image series to a BigTIFF file, which can exceed 4 GB:
 
 >>> data = numpy.random.randint(0, 255, (5, 2, 3, 301, 219), 'uint8')
 >>> with TiffWriter('temp.tif', bigtiff=True) as tif:
 ...     for i in range(data.shape[0]):
-...         tif.save(data[i], compress=6, photometric='minisblack')
+...         tif.write(data[i], photometric='minisblack')
 
 Append an image to the existing TIFF file:
 
@@ -462,31 +452,18 @@ Iterate over pages and tags in the TIFF file and successively read images:
 Write two numpy arrays to a multi-series OME-TIFF file:
 
 >>> data0 = numpy.random.randint(0, 255, (32, 32, 3), 'uint8')
->>> data1 = numpy.random.randint(0, 1023, (5, 256, 256), 'uint16')
->>> with TiffWriter('temp.ome.tif', ome=True) as tif:
-...     tif.save(data0, compress=6, photometric='rgb')
-...     tif.save(data1, photometric='minisblack', contiguous=False,
-...              metadata=dict(axes='ZYX', SignificantBits=10,
-...                            PositionZ=[0.0, 1.0, 2.0, 3.0, 4.0]))
+>>> data1 = numpy.random.randint(0, 1023, (4, 256, 256), 'uint16')
+>>> with TiffWriter('temp.ome.tif') as tif:
+...     tif.write(data0, photometric='rgb')
+...     tif.write(data1, photometric='minisblack',
+...              metadata={'axes': 'ZYX', 'SignificantBits': 10,
+...                        'Plane': {'PositionZ': [0.0, 1.0, 2.0, 3.0]}})
 
 Read the second image series from the OME-TIFF file:
 
 >>> series1 = imread('temp.ome.tif', series=1)
 >>> series1.shape
-(5, 256, 256)
-
-Read an image stack from a series of TIFF files with a file name pattern:
-
->>> imwrite('temp_C001T001.tif', numpy.random.rand(64, 64))
->>> imwrite('temp_C001T002.tif', numpy.random.rand(64, 64))
->>> image_sequence = TiffSequence('temp_C001*.tif', pattern='axes')
->>> image_sequence.shape
-(1, 2)
->>> image_sequence.axes
-'CT'
->>> data = image_sequence.asarray()
->>> data.shape
-(1, 2, 64, 64)
+(4, 256, 256)
 
 Create a TIFF file from a generator of tiles:
 
@@ -495,35 +472,64 @@ Create a TIFF file from a generator of tiles:
 ...     for i in range(data.shape[0]): yield data[i]
 >>> imwrite('temp.tif', tiles(), dtype='uint16', shape=(48, 64), tile=(16, 16))
 
-Write a tiled, multi-resolution, pyramidal TIFF file using JPEG compression:
+Write a tiled, multi-resolution, pyramidal OME-TIFF file using JPEG
+compression. Sub-resolution images are written to SubIFDs:
 
 >>> data = numpy.arange(1024*1024*3, dtype='uint8').reshape((1024, 1024, 3))
->>> with TiffWriter('temp.tif') as tif:
-...     options = dict(tile=(256, 256), compress='jpeg', metadata=None)
-...     tif.save(data, **options)
-...     # save pyramid levels. In production use resampling to generate levels!
-...     tif.save(data[::2, ::2], subfiletype=1, **options)
-...     tif.save(data[::4, ::4], subfiletype=1, **options)
-
-Access the image levels in the pyramidal TIFF file:
-
->>> baseimage = imread('temp.tif')
->>> second_level = imread('temp.tif', series=0, level=1)
->>> with TiffFile('temp.tif') as tif:
+>>> with TiffWriter('temp.ome.tif') as tif:
+...     options = dict(tile=(256, 256), compression='jpeg')
+...     tif.write(data, subifds=2, **options)
+...     # save pyramid levels to the two subifds
+...     # in production use resampling to generate sub-resolutions!
+...     tif.write(data[::2, ::2], subfiletype=1, **options)
+...     tif.write(data[::4, ::4], subfiletype=1, **options)
+
+Access the image levels in the pyramidal OME-TIFF file:
+
+>>> baseimage = imread('temp.ome.tif')
+>>> second_level = imread('temp.ome.tif', series=0, level=1)
+>>> with TiffFile('temp.ome.tif') as tif:
 ...     baseimage = tif.series[0].asarray()
 ...     second_level = tif.series[0].levels[1].asarray()
 
 Iterate over and decode single JPEG compressed tiles in the TIFF file:
 
->>> with TiffFile('temp.tif') as tif:
+>>> with TiffFile('temp.ome.tif') as tif:
 ...     fh = tif.filehandle
 ...     for page in tif.pages:
-...         jpegtables = page.tags.get('JPEGTables', None)
-...         if jpegtables is not None:
-...             jpegtables = jpegtables.value
 ...         for index, (offset, bytecount) in enumerate(
 ...             zip(page.dataoffsets, page.databytecounts)
 ...         ):
 ...             fh.seek(offset)
 ...             data = fh.read(bytecount)
-...             tile, indices, shape = page.decode(data, index, jpegtables)
+...             tile, indices, shape = page.decode(
+...                 data, index, jpegtables=page.jpegtables
+...             )
+
+Use zarr to access the tiled, pyramidal images in the TIFF file:
+
+>>> import zarr
+>>> store = imread('temp.ome.tif', aszarr=True)
+>>> z = zarr.open(store, mode='r')
+>>> z
+<zarr.hierarchy.Group '/' read-only>
+>>> z[0]  # base layer
+<zarr.core.Array '/0' (1024, 1024, 3) uint8 read-only>
+>>> store.close()
+
+Read an image stack from a series of TIFF files with a file name pattern:
+
+>>> imwrite('temp_C001T001.tif', numpy.random.rand(64, 64))
+>>> imwrite('temp_C001T002.tif', numpy.random.rand(64, 64))
+>>> image_sequence = TiffSequence('temp_C001*.tif', pattern='axes')
+>>> image_sequence.shape
+(1, 2)
+>>> image_sequence.axes
+'CT'
+>>> data = image_sequence.asarray()
+>>> data.shape
+(1, 2, 64, 64)
+>>> with image_sequence.aszarr() as store:
+...     zarr.open(store, mode='r')
+<zarr.core.Array (1, 2, 64, 64) float64 read-only>
+>>> image_sequence.close()


=====================================
setup.py
=====================================
@@ -17,11 +17,15 @@ version += ('.' + buildnumber) if buildnumber else ''
 
 description = re.search(r'"""(.*)\.(?:\r\n|\r|\n)', code).groups()[0]
 
-readme = re.search(r'(?:\r\n|\r|\n){2}"""(.*)"""(?:\r\n|\r|\n){2}__version__',
-                   code, re.MULTILINE | re.DOTALL).groups()[0]
-
-readme = '\n'.join([description, '=' * len(description)] +
-                   readme.splitlines()[1:])
+readme = re.search(
+    r'(?:\r\n|\r|\n){2}"""(.*)"""(?:\r\n|\r|\n){2}__version__',
+    code,
+    re.MULTILINE | re.DOTALL,
+).groups()[0]
+
+readme = '\n'.join(
+    [description, '=' * len(description)] + readme.splitlines()[1:]
+)
 
 if 'sdist' in sys.argv:
     # update README, LICENSE, and CHANGES files
@@ -29,8 +33,11 @@ if 'sdist' in sys.argv:
     with open('README.rst', 'w') as fh:
         fh.write(readme)
 
-    license = re.search(r'(# Copyright.*?(?:\r\n|\r|\n))(?:\r\n|\r|\n)+""',
-                        code, re.MULTILINE | re.DOTALL).groups()[0]
+    license = re.search(
+        r'(# Copyright.*?(?:\r\n|\r|\n))(?:\r\n|\r|\n)+""',
+        code,
+        re.MULTILINE | re.DOTALL,
+    ).groups()[0]
 
     license = license.replace('# ', '').replace('#', '')
 
@@ -38,8 +45,15 @@ if 'sdist' in sys.argv:
         fh.write('BSD 3-Clause License\n\n')
         fh.write(license)
 
-    revisions = re.search(r'(?:\r\n|\r|\n){2}(Revisions.*)   \.\.\.', readme,
-                          re.MULTILINE | re.DOTALL).groups()[0].strip()
+    revisions = (
+        re.search(
+            r'(?:\r\n|\r|\n){2}(Revisions.*)   \.\.\.',
+            readme,
+            re.MULTILINE | re.DOTALL,
+        )
+        .groups()[0]
+        .strip()
+    )
 
     with open('CHANGES.rst', 'r') as fh:
         old = fh.read()
@@ -65,25 +79,37 @@ setup(
         # 'Documentation': 'https://',
     },
     packages=['tifffile'],
-    python_requires='>=3.6',
+    python_requires='>=3.7',
     install_requires=[
         'numpy>=1.15.1',
-        # 'imagecodecs>=2020.2.18',
+        # 'imagecodecs>=2020.5.30',
     ],
     extras_require={
-        'all': ['imagecodecs>=2020.2.18', 'matplotlib>=3.1', 'lxml'],
+        'all': [
+            'imagecodecs>=2020.5.30',
+            'matplotlib>=3.2',
+            'lxml',
+            # 'zarr>=2.5.0'
+        ]
     },
     tests_require=[
-        'pytest', 'imagecodecs', 'czifile', 'cmapfile', 'oiffile', 'lfdfiles',
-        'roifile', 'lxml',
-        ],
+        'pytest',
+        'imagecodecs',
+        'czifile',
+        'cmapfile',
+        'oiffile',
+        'lfdfiles',
+        'roifile',
+        'lxml',
+        'zarr>=2.5.0',
+    ],
     entry_points={
         'console_scripts': [
             'tifffile = tifffile:main',
             'lsm2bin = tifffile.lsm2bin:main',
         ],
         # 'napari.plugin': ['tifffile = tifffile.napari_tifffile'],
-        },
+    },
     platforms=['any'],
     classifiers=[
         'Development Status :: 4 - Beta',


=====================================
tests/conftest.py
=====================================
@@ -1,6 +1,11 @@
 # tifffile/tests/conftest.py
 
-collect_ignore = ['_tmp', 'data']
+import os
+import sys
+
+
+if os.environ.get('SKIP_CODECS', None):
+    sys.modules['imagecodecs'] = None
 
 
 def pytest_report_header(config):
@@ -8,11 +13,17 @@ def pytest_report_header(config):
         from numpy import __version__ as numpy
         from tifffile import __version__ as tifffile
         from test_tifffile import config
+
         try:
             from imagecodecs import __version__ as imagecodecs
         except ImportError:
             imagecodecs = 'N/A'
-        return ('versions: tifffile-%s, imagecodecs-%s, numpy-%s\n'
-                'test config: %s' % (tifffile, imagecodecs, numpy, config()))
+        return (
+            'versions: tifffile-{}, imagecodecs-{}, numpy-{}\n'
+            'test config: {}'.format(tifffile, imagecodecs, numpy, config())
+        )
     except Exception:
         pass
+
+
+collect_ignore = ['_tmp', 'data']


=====================================
tests/test_tifffile.py
=====================================
The diff for this file was not included because it is too large.

=====================================
tifffile.egg-info/PKG-INFO
=====================================
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: tifffile
-Version: 2020.7.17
+Version: 2020.11.18
 Summary: Read and write TIFF(r) files
 Home-page: https://www.lfd.uci.edu/~gohlke/
 Author: Christoph Gohlke
@@ -20,23 +20,25 @@ Description: Read and write TIFF(r) files
         NIHImage, ImageJ, MicroManager, FluoView, ScanImage, SEQ, GEL, SVS, SCN, SIS,
         ZIF (Zoomable Image File Format), QPTIFF (QPI), NDPI, and GeoTIFF files.
         
+        Image data can be read as numpy arrays or zarr arrays/groups from strips,
+        tiles, pages (IFDs), SubIFDs, higher order series, and pyramidal levels.
+        
         Numpy arrays can be written to TIFF, BigTIFF, OME-TIFF, and ImageJ hyperstack
-        compatible files in multi-page, memory-mappable, tiled, predicted, or
-        compressed form.
+        compatible files in multi-page, volumetric, pyramidal, memory-mappable, tiled,
+        predicted, or compressed form.
         
-        A subset of the TIFF specification is supported, mainly uncompressed and
-        losslessly compressed 8, 16, 32 and 64-bit integer, 16, 32 and 64-bit float,
-        grayscale and multi-sample images.
-        Specifically, reading slices of image data, CCITT and OJPEG compression,
-        chroma subsampling without JPEG compression, color space transformations,
-        samples with differing types, or IPTC and XMP metadata are not implemented.
+        A subset of the TIFF specification is supported, mainly 8, 16, 32 and 64-bit
+        integer, 16, 32 and 64-bit float, grayscale and multi-sample images.
+        Specifically, CCITT and OJPEG compression, chroma subsampling without JPEG
+        compression, color space transformations, samples with differing types, or
+        IPTC and XMP metadata are not implemented.
         
         TIFF(r), the Tagged Image File Format, is a trademark and under control of
         Adobe Systems Incorporated. BigTIFF allows for files larger than 4 GB.
-        STK, LSM, FluoView, SGI, SEQ, GEL, QPTIFF, NDPI, and OME-TIFF, are custom
+        STK, LSM, FluoView, SGI, SEQ, GEL, QPTIFF, NDPI, SCN, and OME-TIFF, are custom
         extensions defined by Molecular Devices (Universal Imaging Corporation),
         Carl Zeiss MicroImaging, Olympus, Silicon Graphics International,
-        Media Cybernetics, Molecular Dynamics, PerkinElmer, Hamamatsu, and the
+        Media Cybernetics, Molecular Dynamics, PerkinElmer, Hamamatsu, Leica, and the
         Open Microscopy Environment consortium, respectively.
         
         For command line usage run ``python -m tifffile --help``
@@ -49,26 +51,91 @@ Description: Read and write TIFF(r) files
         
         :License: BSD 3-Clause
         
-        :Version: 2020.7.17
+        :Version: 2020.11.18
         
         Requirements
         ------------
         This release has been tested with the following requirements and dependencies
         (other versions may work):
         
-        * `CPython 3.7.8, 3.8.4, 3.9.0b4 64-bit <https://www.python.org>`_
-        * `Numpy 1.18.5 <https://pypi.org/project/numpy/>`_
+        * `CPython 3.7.9, 3.8.6, 3.9.0 64-bit <https://www.python.org>`_
+        * `Numpy 1.19.4 <https://pypi.org/project/numpy/>`_
         * `Imagecodecs 2020.5.30 <https://pypi.org/project/imagecodecs/>`_
           (required only for encoding or decoding LZW, JPEG, etc.)
-        * `Matplotlib 3.2.2 <https://pypi.org/project/matplotlib/>`_
+        * `Matplotlib 3.3.3 <https://pypi.org/project/matplotlib/>`_
           (required only for plotting)
-        * `Lxml 4.5.2 <https://github.com/lxml/lxml>`_
+        * `Lxml 4.6.1 <https://pypi.org/project/lxml/>`_
           (required only for validating and printing XML)
+        * `Zarr 2.5.0 <https://pypi.org/project/zarr/>`_
+          (required only for opening zarr storage)
         
         Revisions
         ---------
+        2020.11.18
+            Pass 4363 tests.
+            Support writing SEPARATED colorspace (#37).
+            Use imagecodecs.deflate if available.
+            Fix SCN and NDPI series with Z dimensions.
+            Add TiffReader alias for TiffFile.
+            TiffPage.is_volumetric returns True if ImageDepth > 1.
+            Zarr store getitem returns numpy arrays instead of bytes.
+        2020.10.1
+            Formally deprecate unused TiffFile parameters (scikit-image #4996).
+        2020.9.30
+            Allow to pass additional arguments to compression codecs.
+            Deprecate TiffWriter.save function (use TiffWriter.write).
+            Deprecate TiffWriter.save compress parameter (use compression).
+            Remove multifile parameter from TiffFile (breaking).
+            Pass all is_flag arguments from imread to TiffFile.
+            Do not byte-swap JPEG2000, WEBP, PNG, JPEGXR segments in TiffPage.decode.
+        2020.9.29
+            Fix reading files produced by ScanImage > 2015 (#29).
+        2020.9.28
+            Derive ZarrStore from MutableMapping.
+            Support zero shape ZarrTiffStore.
+            Fix ZarrFileStore with non-TIFF files.
+            Fix ZarrFileStore with missing files.
+            Cache one chunk in ZarrFileStore.
+            Keep track of already opened files in FileCache.
+            Change parse_filenames function to return zero-based indices.
+            Remove reopen parameter from asarray (breaking).
+            Rename FileSequence.fromfile to imread (breaking).
+        2020.9.22
+            Add experimental zarr storage interface (WIP).
+            Remove unused first dimension from TiffPage.shaped (breaking).
+            Move reading of STK planes to series interface (breaking).
+            Always use virtual frames for ScanImage files.
+            Use DimensionOrder to determine axes order in OmeXml.
+            Enable writing striped volumetric images.
+            Keep complete dataoffsets and databytecounts for TiffFrames.
+            Return full size tiles from Tiffpage.segments.
+            Rename TiffPage.is_sgi property to is_volumetric (breaking).
+            Rename TiffPageSeries.is_pyramid to is_pyramidal (breaking).
+            Fix TypeError when passing jpegtables to non-JPEG decode function (#25).
+        2020.9.3
+            Do not write contiguous series by default (breaking).
+            Allow to write to SubIFDs (WIP).
+            Fix writing F-contiguous numpy arrays (#24).
+        2020.8.25
+            Do not convert EPICS timeStamp to datetime object.
+            Read incompletely written Micro-Manager image file stack header (#23).
+            Remove tag 51123 values from TiffFile.micromanager_metadata (breaking).
+        2020.8.13
+            Use tifffile metadata over OME and ImageJ for TiffFile.series (breaking).
+            Fix writing iterable of pages with compression (#20).
+            Expand error checking of TiffWriter data, dtype, shape, and tile arguments.
+        2020.7.24
+            Parse nested OmeXml metadata argument (WIP).
+            Do not lazy load TiffFrame JPEGTables.
+            Fix conditionally skipping some tests.
+        2020.7.22
+            Do not auto-enable OME-TIFF if description is passed to TiffWriter.save.
+            Raise error writing empty bilevel or tiled images.
+            Allow to write tiled bilevel images.
+            Allow to write multi-page TIFF from iterable of single page images (WIP).
+            Add function to validate OME-XML.
+            Correct Philips slide width and length.
         2020.7.17
-            Pass 3022 tests.
             Initial support for writing OME-TIFF (WIP).
             Return samples as separate dimension in OME series (breaking).
             Fix modulo dimensions for multiple OME series.
@@ -104,7 +171,7 @@ Description: Read and write TIFF(r) files
             Fix writing single tiles larger than image data (#3).
             Always store ExtraSamples values in tuple (breaking).
         2020.5.5
-            Allow to write tiled TIFF from iterator of tiles (WIP).
+            Allow to write tiled TIFF from iterable of tiles (WIP).
             Add function to iterate over decoded segments of TiffPage (WIP).
             Pass chunks of segments to ThreadPoolExecutor.map to reduce memory usage.
             Fix reading invalid files with too many strips.
@@ -134,102 +201,6 @@ Description: Read and write TIFF(r) files
             Remove deprecated lzw_decode functions (breaking).
             Remove support for Python 2.7 and 3.5 (breaking).
         2019.7.26
-            Fix infinite loop reading more than two tags of same code in IFD.
-            Delay import of logging module.
-        2019.7.20
-            Fix OME-XML detection for files created by Imaris.
-            Remove or replace assert statements.
-        2019.7.2
-            Do not write SampleFormat tag for unsigned data types.
-            Write ByteCount tag values as SHORT or LONG if possible.
-            Allow to specify axes in FileSequence pattern via group names.
-            Add option to concurrently read FileSequence using threads.
-            Derive TiffSequence from FileSequence.
-            Use str(datetime.timedelta) to format Timer duration.
-            Use perf_counter for Timer if possible.
-        2019.6.18
-            Fix reading planar RGB ImageJ files created by Bio-Formats.
-            Fix reading single-file, multi-image OME-TIFF without UUID.
-            Presume LSM stores uncompressed images contiguously per page.
-            Reformat some complex expressions.
-        2019.5.30
-            Ignore invalid frames in OME-TIFF.
-            Set default subsampling to (2, 2) for RGB JPEG compression.
-            Fix reading and writing planar RGB JPEG compression.
-            Replace buffered_read with FileHandle.read_segments.
-            Include page or frame numbers in exceptions and warnings.
-            Add Timer class.
-        2019.5.22
-            Add optional chroma subsampling for JPEG compression.
-            Enable writing PNG, JPEG, JPEGXR, and JPEG2K compression (WIP).
-            Fix writing tiled images with WebP compression.
-            Improve handling GeoTIFF sparse files.
-        2019.3.18
-            Fix regression decoding JPEG with RGB photometrics.
-            Fix reading OME-TIFF files with corrupted but unused pages.
-            Allow to load TiffFrame without specifying keyframe.
-            Calculate virtual TiffFrames for non-BigTIFF ScanImage files > 2GB.
-            Rename property is_chroma_subsampled to is_subsampled (breaking).
-            Make more attributes and methods private (WIP).
-        2019.3.8
-            Fix MemoryError when RowsPerStrip > ImageLength.
-            Fix SyntaxWarning on Python 3.8.
-            Fail to decode JPEG to planar RGB (tentative).
-            Separate public from private test files (WIP).
-            Allow testing without data files or imagecodecs.
-        2019.2.22
-            Use imagecodecs-lite as a fallback for imagecodecs.
-            Simplify reading numpy arrays from file.
-            Use TiffFrames when reading arrays from page sequences.
-            Support slices and iterators in TiffPageSeries sequence interface.
-            Auto-detect uniform series.
-            Use page hash to determine generic series.
-            Turn off TiffPages cache (tentative).
-            Pass through more parameters in imread.
-            Discontinue movie parameter in imread and TiffFile (breaking).
-            Discontinue bigsize parameter in imwrite (breaking).
-            Raise TiffFileError in case of issues with TIFF structure.
-            Return TiffFile.ome_metadata as XML (breaking).
-            Ignore OME series when last dimensions are not stored in TIFF pages.
-        2019.2.10
-            Assemble IFDs in memory to speed-up writing on some slow media.
-            Handle discontinued arguments fastij, multifile_close, and pages.
-        2019.1.30
-            Use black background in imshow.
-            Do not write datetime tag by default (breaking).
-            Fix OME-TIFF with SamplesPerPixel > 1.
-            Allow 64-bit IFD offsets for NDPI (files > 4GB still not supported).
-        2019.1.4
-            Fix decoding deflate without imagecodecs.
-        2019.1.1
-            Update copyright year.
-            Require imagecodecs >= 2018.12.16.
-            Do not use JPEG tables from keyframe.
-            Enable decoding large JPEG in NDPI.
-            Decode some old-style JPEG.
-            Reorder OME channel axis to match PlanarConfiguration storage.
-            Return tiled images as contiguous arrays.
-            Add decode_lzw proxy function for compatibility with old czifile module.
-            Use dedicated logger.
-        2018.11.28
-            Make SubIFDs accessible as TiffPage.pages.
-            Make parsing of TiffSequence axes pattern optional (breaking).
-            Limit parsing of TiffSequence axes pattern to file names, not path names.
-            Do not interpolate in imshow if image dimensions <= 512, else use bilinear.
-            Use logging.warning instead of warnings.warn in many cases.
-            Fix numpy FutureWarning for out == 'memmap'.
-            Adjust ZSTD and WebP compression to libtiff-4.0.10 (WIP).
-            Decode old-style LZW with imagecodecs >= 2018.11.8.
-            Remove TiffFile.qptiff_metadata (QPI metadata are per page).
-            Do not use keyword arguments before variable positional arguments.
-            Make either all or none return statements in a function return expression.
-            Use pytest parametrize to generate tests.
-            Replace test classes with functions.
-        2018.11.6
-            Rename imsave function to imwrite.
-            Readd Python implementations of packints, delta, and bitorder codecs.
-            Fix TiffFrame.compression AttributeError.
-        2018.10.18
             ...
         
         Refer to the CHANGES file for older revisions.
@@ -240,7 +211,7 @@ Description: Read and write TIFF(r) files
         
         Tested on little-endian platforms only.
         
-        Python 32-bit versions are deprecated. Python <= 3.6 are no longer supported.
+        Python 32-bit versions are deprecated. Python <= 3.7 are no longer supported.
         
         Tifffile relies on the `imagecodecs <https://pypi.org/project/imagecodecs/>`_
         package for encoding and decoding LZW, JPEG, and other compressed image
@@ -262,17 +233,24 @@ Description: Read and write TIFF(r) files
           tag of the first IFD defines the position of TIFF IFDs in the high
           dimensional data. Tifffile can read OME-TIFF files, except when the OME-XML
           metadata are stored in a separate file. Tifffile can write numpy arrays
-          to single-file, non-pyramidal OME-TIFF.
+          to single-file OME-TIFF.
         * *LSM* stores all IFDs below 4 GB but wraps around 32-bit StripOffsets.
           The StripOffsets of each series and position require separate unwrapping.
           The StripByteCounts tag contains the number of bytes for the uncompressed
           data. Tifffile can read large LSM files.
+        * *STK* (MetaMorph Stack) contains additional image planes stored contiguously
+          after the image data of the first page. The total number of planes
+          is equal to the counts of the UIC2tag. Tifffile can read STK files.
         * *NDPI* uses some 64-bit offsets in the file header, IFD, and tag structures.
           Tag values/offsets can be corrected using high bits stored after IFD
           structures. JPEG compressed segments with dimensions >65536 or missing
           restart markers are not readable with libjpeg. Tifffile can read NDPI
           files > 4 GB. JPEG segments with restart markers and dimensions >65536 can
           be decoded with the imagecodecs library on Windows.
+        * *Philips* TIFF slides store wrong ImageWidth and ImageLength tag values for
+          tiled pages. The values can be corrected using the DICOM_PIXEL_SPACING
+          attributes of the XML formatted description of the first page. Tifffile can
+          read Philips slides.
         * *ScanImage* optionally allows corrupt non-BigTIFF files > 2 GB. The values
           of StripOffsets and StripByteCounts can be recovered using the constant
           differences of the offsets of IFD and tag values throughout the file.
@@ -299,6 +277,7 @@ Description: Read and write TIFF(r) files
         * `ScanImageTiffReaderPython
           <https://gitlab.com/vidriotech/scanimagetiffreader-python>`_
         * `bigtiff <https://pypi.org/project/bigtiff>`_
+        * `Large Image <https://github.com/girder/large_image>`_
         
         Some libraries are using tifffile to write OME-TIFF files:
         
@@ -308,6 +287,10 @@ Description: Read and write TIFF(r) files
           <https://pypi.org/project/aicsimageio>`_
         * `xtiff <https://github.com/BodenmillerGroup/xtiff>`_
         
+        Other tools for inspecting and manipulating TIFF files:
+        
+        * `tifftools <https://github.com/DigitalSlideArchive/tifftools>`_
+        
         References
         ----------
         * TIFF 6.0 Specification and Supplements. Adobe Systems Incorporated.
@@ -373,7 +356,7 @@ Description: Read and write TIFF(r) files
         Save a floating-point array and metadata, using zlib compression:
         
         >>> data = numpy.random.rand(2, 5, 3, 301, 219).astype('float32')
-        >>> imwrite('temp.tif', data, compress=6, metadata={'axes': 'TZCYX'})
+        >>> imwrite('temp.tif', data, compression='zlib', metadata={'axes': 'TZCYX'})
         
         Save a volume with xyz voxel size 2.6755x2.6755x3.9474 micron^3 to an ImageJ
         formatted TIFF file:
@@ -449,12 +432,19 @@ Description: Read and write TIFF(r) files
         1.0
         >>> del memmap_image
         
-        Successively append images to a BigTIFF file, which can exceed 4 GB:
+        Successively write the frames of one contiguous series to a TIFF file:
+        
+        >>> data = numpy.random.randint(0, 255, (30, 301, 219), 'uint8')
+        >>> with TiffWriter('temp.tif') as tif:
+        ...     for frame in data:
+        ...         tif.write(frame, contiguous=True)
+        
+        Successively append image series to a BigTIFF file, which can exceed 4 GB:
         
         >>> data = numpy.random.randint(0, 255, (5, 2, 3, 301, 219), 'uint8')
         >>> with TiffWriter('temp.tif', bigtiff=True) as tif:
         ...     for i in range(data.shape[0]):
-        ...         tif.save(data[i], compress=6, photometric='minisblack')
+        ...         tif.write(data[i], photometric='minisblack')
         
         Append an image to the existing TIFF file:
         
@@ -472,31 +462,18 @@ Description: Read and write TIFF(r) files
         Write two numpy arrays to a multi-series OME-TIFF file:
         
         >>> data0 = numpy.random.randint(0, 255, (32, 32, 3), 'uint8')
-        >>> data1 = numpy.random.randint(0, 1023, (5, 256, 256), 'uint16')
-        >>> with TiffWriter('temp.ome.tif', ome=True) as tif:
-        ...     tif.save(data0, compress=6, photometric='rgb')
-        ...     tif.save(data1, photometric='minisblack', contiguous=False,
-        ...              metadata=dict(axes='ZYX', SignificantBits=10,
-        ...                            PositionZ=[0.0, 1.0, 2.0, 3.0, 4.0]))
+        >>> data1 = numpy.random.randint(0, 1023, (4, 256, 256), 'uint16')
+        >>> with TiffWriter('temp.ome.tif') as tif:
+        ...     tif.write(data0, photometric='rgb')
+        ...     tif.write(data1, photometric='minisblack',
+        ...              metadata={'axes': 'ZYX', 'SignificantBits': 10,
+        ...                        'Plane': {'PositionZ': [0.0, 1.0, 2.0, 3.0]}})
         
         Read the second image series from the OME-TIFF file:
         
         >>> series1 = imread('temp.ome.tif', series=1)
         >>> series1.shape
-        (5, 256, 256)
-        
-        Read an image stack from a series of TIFF files with a file name pattern:
-        
-        >>> imwrite('temp_C001T001.tif', numpy.random.rand(64, 64))
-        >>> imwrite('temp_C001T002.tif', numpy.random.rand(64, 64))
-        >>> image_sequence = TiffSequence('temp_C001*.tif', pattern='axes')
-        >>> image_sequence.shape
-        (1, 2)
-        >>> image_sequence.axes
-        'CT'
-        >>> data = image_sequence.asarray()
-        >>> data.shape
-        (1, 2, 64, 64)
+        (4, 256, 256)
         
         Create a TIFF file from a generator of tiles:
         
@@ -505,38 +482,67 @@ Description: Read and write TIFF(r) files
         ...     for i in range(data.shape[0]): yield data[i]
         >>> imwrite('temp.tif', tiles(), dtype='uint16', shape=(48, 64), tile=(16, 16))
         
-        Write a tiled, multi-resolution, pyramidal TIFF file using JPEG compression:
+        Write a tiled, multi-resolution, pyramidal OME-TIFF file using JPEG
+        compression. Sub-resolution images are written to SubIFDs:
         
         >>> data = numpy.arange(1024*1024*3, dtype='uint8').reshape((1024, 1024, 3))
-        >>> with TiffWriter('temp.tif') as tif:
-        ...     options = dict(tile=(256, 256), compress='jpeg', metadata=None)
-        ...     tif.save(data, **options)
-        ...     # save pyramid levels. In production use resampling to generate levels!
-        ...     tif.save(data[::2, ::2], subfiletype=1, **options)
-        ...     tif.save(data[::4, ::4], subfiletype=1, **options)
-        
-        Access the image levels in the pyramidal TIFF file:
-        
-        >>> baseimage = imread('temp.tif')
-        >>> second_level = imread('temp.tif', series=0, level=1)
-        >>> with TiffFile('temp.tif') as tif:
+        >>> with TiffWriter('temp.ome.tif') as tif:
+        ...     options = dict(tile=(256, 256), compression='jpeg')
+        ...     tif.write(data, subifds=2, **options)
+        ...     # save pyramid levels to the two subifds
+        ...     # in production use resampling to generate sub-resolutions!
+        ...     tif.write(data[::2, ::2], subfiletype=1, **options)
+        ...     tif.write(data[::4, ::4], subfiletype=1, **options)
+        
+        Access the image levels in the pyramidal OME-TIFF file:
+        
+        >>> baseimage = imread('temp.ome.tif')
+        >>> second_level = imread('temp.ome.tif', series=0, level=1)
+        >>> with TiffFile('temp.ome.tif') as tif:
         ...     baseimage = tif.series[0].asarray()
         ...     second_level = tif.series[0].levels[1].asarray()
         
         Iterate over and decode single JPEG compressed tiles in the TIFF file:
         
-        >>> with TiffFile('temp.tif') as tif:
+        >>> with TiffFile('temp.ome.tif') as tif:
         ...     fh = tif.filehandle
         ...     for page in tif.pages:
-        ...         jpegtables = page.tags.get('JPEGTables', None)
-        ...         if jpegtables is not None:
-        ...             jpegtables = jpegtables.value
         ...         for index, (offset, bytecount) in enumerate(
         ...             zip(page.dataoffsets, page.databytecounts)
         ...         ):
         ...             fh.seek(offset)
         ...             data = fh.read(bytecount)
-        ...             tile, indices, shape = page.decode(data, index, jpegtables)
+        ...             tile, indices, shape = page.decode(
+        ...                 data, index, jpegtables=page.jpegtables
+        ...             )
+        
+        Use zarr to access the tiled, pyramidal images in the TIFF file:
+        
+        >>> import zarr
+        >>> store = imread('temp.ome.tif', aszarr=True)
+        >>> z = zarr.open(store, mode='r')
+        >>> z
+        <zarr.hierarchy.Group '/' read-only>
+        >>> z[0]  # base layer
+        <zarr.core.Array '/0' (1024, 1024, 3) uint8 read-only>
+        >>> store.close()
+        
+        Read an image stack from a series of TIFF files with a file name pattern:
+        
+        >>> imwrite('temp_C001T001.tif', numpy.random.rand(64, 64))
+        >>> imwrite('temp_C001T002.tif', numpy.random.rand(64, 64))
+        >>> image_sequence = TiffSequence('temp_C001*.tif', pattern='axes')
+        >>> image_sequence.shape
+        (1, 2)
+        >>> image_sequence.axes
+        'CT'
+        >>> data = image_sequence.asarray()
+        >>> data.shape
+        (1, 2, 64, 64)
+        >>> with image_sequence.aszarr() as store:
+        ...     zarr.open(store, mode='r')
+        <zarr.core.Array (1, 2, 64, 64) float64 read-only>
+        >>> image_sequence.close()
         
 Platform: any
 Classifier: Development Status :: 4 - Beta
@@ -548,5 +554,5 @@ Classifier: Programming Language :: Python :: 3 :: Only
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
-Requires-Python: >=3.6
+Requires-Python: >=3.7
 Provides-Extra: all


=====================================
tifffile.egg-info/requires.txt
=====================================
@@ -1,6 +1,6 @@
 numpy>=1.15.1
 
 [all]
-imagecodecs>=2020.2.18
-matplotlib>=3.1
+imagecodecs>=2020.5.30
+matplotlib>=3.2
 lxml


=====================================
tifffile/tifffile.py
=====================================
The diff for this file was not included because it is too large.


View it on GitLab: https://salsa.debian.org/python-team/packages/tifffile/-/commit/345717603807a24c0fccf403a07a7395b2c8cfcb

-- 
View it on GitLab: https://salsa.debian.org/python-team/packages/tifffile/-/commit/345717603807a24c0fccf403a07a7395b2c8cfcb
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20201120/ddbe8eed/attachment-0001.html>


More information about the debian-med-commit mailing list