mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-30 14:42:46 +08:00
29 lines
820 B
Python
29 lines
820 B
Python
from ...external.tifffile import TiffFile, imsave
|
|
|
|
|
|
def imread(fname, dtype=None, **kwargs):
|
|
"""Load a tiff image from file.
|
|
|
|
Parameters
|
|
----------
|
|
fname : str or file
|
|
File name or file-like-object.
|
|
dtype : numpy dtype object or string specifier
|
|
Specifies data type of array elements (Not currently used).
|
|
kwargs : keyword pairs, optional
|
|
Addition keyword arguments to pass through (see `tifffile`'s `imread` function).
|
|
|
|
Notes
|
|
-----
|
|
Provided by Christophe Golhke's tifffile.py [1]_, and supports many
|
|
advanced image types including multi-page and floating point.
|
|
|
|
References
|
|
----------
|
|
.. [1] http://www.lfd.uci.edu/~gohlke/code/tifffile.py
|
|
|
|
"""
|
|
with open(fname, 'rb') as f:
|
|
tif = TiffFile(f)
|
|
return tif.asarray(**kwargs)
|