skimage.external.tifffile.imsave(file, data, …) | Write image data to TIFF file. |
skimage.external.tifffile.imread(files, **kwargs) | Return image data from TIFF file(s) as numpy array. |
skimage.external.tifffile.imshow(data[, …]) | Plot n-dimensional images using matplotlib.pyplot. |
skimage.external.tifffile.TiffFile(arg[, …]) | Read image and metadata from TIFF, STK, LSM, and FluoView files. |
skimage.external.tifffile.TiffWriter(file[, …]) | Write image data to TIFF file. |
skimage.external.tifffile.TiffSequence(files) | Sequence of image files. |
skimage.external.tifffile.imsave(file, data, **kwargs) [source]
Write image data to TIFF file.
Refer to the TiffWriter class and member functions for documentation.
| Parameters: |
|
|---|
>>> data = numpy.random.rand(2, 5, 3, 301, 219)
>>> imsave('temp.tif', data, compress=6, metadata={'axes': 'TZCYX'})
skimage.external.tifffile.imread(files, **kwargs) [source]
Return image data from TIFF file(s) as numpy array.
Refer to the TiffFile class and member functions for documentation.
| Parameters: |
|
|---|
>>> imsave('temp.tif', numpy.random.rand(3, 4, 301, 219))
>>> im = imread('temp.tif', key=0)
>>> im.shape
(4, 301, 219)
>>> ims = imread(['temp.tif', 'temp.tif'])
>>> ims.shape
(2, 3, 4, 301, 219)
skimage.external.tifffile.imshow(data, title=None, vmin=0, vmax=None, cmap=None, bitspersample=None, photometric='rgb', interpolation=None, dpi=96, figure=None, subplot=111, maxdim=8192, **kwargs) [source]
Plot n-dimensional images using matplotlib.pyplot.
Return figure, subplot and plot axis. Requires pyplot already imported from matplotlib import pyplot.
| Parameters: |
|
|---|
class skimage.external.tifffile.TiffFile(arg, name=None, offset=None, size=None, multifile=True, multifile_close=True, pages=None, fastij=True, is_ome=None) [source]
Bases: object
Read image and metadata from TIFF, STK, LSM, and FluoView files.
TiffFile instances must be closed using the ‘close’ method, which is automatically called when using the ‘with’ context manager.
>>> with TiffFile('temp.tif') as tif:
... data = tif.asarray()
... data.shape
(5, 301, 219)
| Attributes: |
|
|---|
__init__(arg, name=None, offset=None, size=None, multifile=True, multifile_close=True, pages=None, fastij=True, is_ome=None) [source]
Initialize instance from file.
| Parameters: |
|
|---|
asarray(key=None, series=None, memmap=False, tempdir=None) [source]
Return image data from multiple TIFF pages as numpy array.
By default the first image series is returned.
| Parameters: |
|
|---|
close() [source]
Close open file handle(s).
filehandle Return file handle.
filename Return name of file handle.
fstat Lazy object attribute whose value is computed on first access.
info(series=None, pages=None) [source]
Return string with detailed information about file.
is_bigtiff Lazy object attribute whose value is computed on first access.
is_fei Lazy object attribute whose value is computed on first access.
is_fluoview Lazy object attribute whose value is computed on first access.
is_imagej Lazy object attribute whose value is computed on first access.
is_indexed Lazy object attribute whose value is computed on first access.
is_lsm Lazy object attribute whose value is computed on first access.
is_mdgel Lazy object attribute whose value is computed on first access.
is_mediacy Lazy object attribute whose value is computed on first access.
is_micromanager Lazy object attribute whose value is computed on first access.
is_nih Lazy object attribute whose value is computed on first access.
is_ome Lazy object attribute whose value is computed on first access.
is_rgb Lazy object attribute whose value is computed on first access.
is_scn Lazy object attribute whose value is computed on first access.
is_sem Lazy object attribute whose value is computed on first access.
is_stk Lazy object attribute whose value is computed on first access.
is_tvips Lazy object attribute whose value is computed on first access.
is_vista Lazy object attribute whose value is computed on first access.
series Lazy object attribute whose value is computed on first access.
class skimage.external.tifffile.TiffWriter(file, append=False, bigtiff=False, byteorder=None, software='tifffile.py', imagej=False) [source]
Bases: object
Write image data to TIFF file.
TiffWriter instances must be closed using the ‘close’ method, which is automatically called when using the ‘with’ context manager.
>>> data = numpy.random.rand(2, 5, 3, 301, 219)
>>> with TiffWriter('temp.tif', bigtiff=True) as tif:
... for i in range(data.shape[0]):
... tif.save(data[i], compress=6)
__init__(file, append=False, bigtiff=False, byteorder=None, software='tifffile.py', imagej=False) [source]
Open a TIFF file for writing.
Existing files are overwritten by default. Use bigtiff=True when creating files larger than 2 GB.
| Parameters: |
|
|---|
TAGS = {'bits_per_sample': 258, 'color_map': 320, 'compression': 259, 'datetime': 306, 'document_name': 269, 'extra_samples': 338, 'image_depth': 32997, 'image_description': 270, 'image_length': 257, 'image_width': 256, 'new_subfile_type': 254, 'orientation': 274, 'page_name': 285, 'photometric': 262, 'planar_configuration': 284, 'predictor': 317, 'resolution_unit': 296, 'rows_per_strip': 278, 'sample_format': 339, 'samples_per_pixel': 277, 'smax_sample_value': 341, 'smin_sample_value': 340, 'software': 305, 'strip_byte_counts': 279, 'strip_offsets': 273, 'subfile_type': 255, 'tile_byte_counts': 325, 'tile_depth': 32998, 'tile_length': 323, 'tile_offsets': 324, 'tile_width': 322, 'x_resolution': 282, 'y_resolution': 283} TYPES = {'2I': 5, '2i': 10, 'B': 1, 'H': 3, 'I': 4, 'Q': 16, 'b': 6, 'd': 12, 'f': 11, 'h': 8, 'i': 9, 'q': 17, 's': 2} close(truncate=False) [source]
Write remaining pages (if not truncate) and close file handle.
save(data, photometric=None, planarconfig=None, tile=None, contiguous=True, compress=0, colormap=None, description=None, datetime=None, resolution=None, metadata={}, extratags=()) [source]
Write image data and tags to TIFF file.
Image data are written in one stripe per plane by default. Dimensions larger than 2 to 4 (depending on photometric mode, planar configuration, and SGI mode) are flattened and saved as separate pages. The ‘sample_format’ and ‘bits_per_sample’ tags are derived from the data type.
| Parameters: |
|
|---|
class skimage.external.tifffile.TiffSequence(files, imread=<class 'skimage.external.tifffile.tifffile.TiffFile'>, pattern='axes', *args, **kwargs) [source]
Bases: object
Sequence of image files.
The data shape and dtype of all files must match.
| Attributes: |
|
|---|
__init__(files, imread=<class 'skimage.external.tifffile.tifffile.TiffFile'>, pattern='axes', *args, **kwargs) [source]
Initialize instance from multiple files.
| Parameters: |
|
|---|
asarray(memmap=False, tempdir=None, *args, **kwargs) [source]
Read image data from all files and return as single numpy array.
If memmap is True, return an array stored in a binary file on disk. The args and kwargs parameters are passed to the imread function.
Raise IndexError or ValueError if image shapes do not match.
close() [source]
© 2011 the scikit-image team
Licensed under the BSD 3-clause License.
http://scikit-image.org/docs/0.14.x/api/skimage.external.tifffile.html