<commit_before>"""
The module ``xtiff`` provides support for conversion from TIFF to HDF5.

===============================================================================
Overview
===============================================================================
The module ``xtiff`` implements a relatively simplistic form of conversion from
TIFF to HDF5. Preserves the description fields from the metadata if found as a
list under the attribute `descriptions`. Additionally, keeps track of the TIFF
filenames stitched together and the offsets of each TIFF file as the attributes
`filenames` and `offsets`, respectively.

.. todo::

    Currently, this only keeps one channel and works on one Z-plane. It would \
    be nice to relax these constraints and these features in the future.

===============================================================================
API
===============================================================================
"""


__author__ = "<NAME> <<EMAIL>>"
__date__ = "$Jun 26, 2014 11:40:54 EDT$"


import collections
import os

import numpy
import h5py

import vigra
import vigra.impex

from nanshe.util import iters, xglob, prof, xnumpy
from nanshe.io import hdf5

try:
    import tifffile
except ImportError:
    # scikit-image is bundled with tifffile so use it.
    from skimage.external import tifffile


from past.builtins import unicode


# Get the logger<commit_msg>Drop fallback to scikit-image's tifffile<commit_after>"""
The module ``xtiff`` provides support for conversion from TIFF to HDF5.

===============================================================================
Overview
===============================================================================
The module ``xtiff`` implements a relatively simplistic form of conversion from
TIFF to HDF5. Preserves the description fields from the metadata if found as a
list under the attribute `descriptions`. Additionally, keeps track of the TIFF
filenames stitched together and the offsets of each TIFF file as the attributes
`filenames` and `offsets`, respectively.

.. todo::

    Currently, this only keeps one channel and works on one Z-plane. It would \
    be nice to relax these constraints and these features in the future.

===============================================================================
API
===============================================================================
"""


__author__ = "<NAME> <<EMAIL>@<EMAIL>>"
__date__ = "$Jun 26, 2014 11:40:54 EDT$"


import collections
import os

import numpy
import h5py

import vigra
import vigra.impex

from nanshe.util import iters, xglob, prof, xnumpy
from nanshe.io import hdf5

import tifffile

from past.builtins import unicode


# Get the logger
{'fraction_non_alphanumeric': 0.2825128581925055, 'fraction_numerical': 0.011756061719324026, 'mean_word_length': 5.841708542713568, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2532351', 'n_tokens_mistral': 709, 'n_tokens_neox': 630, 'n_words': 286}