Package qubx :: Module tifffile :: Class TiffSequence
[hide private]
[frames] | no frames]

Class TiffSequence

source code

object --+
         |
        TiffSequence

Sequence of image files.

Properties

files : list
List of file names.
shape : tuple
Shape of image sequence.
axes : str
Labels of axes in shape.

Examples

>>> ims = TiffSequence("test.oif.files/*.tif")
>>> ims = ims.asarray()
>>> ims.shape
(2, 100, 256, 256)
Nested Classes [hide private]
  _ParseError
Instance Methods [hide private]
 
__init__(self, files, imread=<class 'qubx.tifffile.TiffFile'>, pattern='axes')
Initialize instance from multiple files.
source code
 
__str__(self)
Return string with information about image sequence.
source code
 
__len__(self) source code
 
__enter__(self) source code
 
__exit__(self, exc_type, exc_value, traceback) source code
 
close(self) source code
 
asarray(self, *args, **kwargs)
Read image data from all files and return as single numpy array.
source code
 
_parse(self)
Get axes and shape from file names.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  _axes_pattern = '\n # matches Olympus OIF and Leica TIF...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, files, imread=<class 'qubx.tifffile.TiffFile'>, pattern='axes')
(Constructor)

source code 

Initialize instance from multiple files.

Parameters

files : str, or sequence of str
Glob pattern or sequence of file names.
imread : function or class
Image read function or class with asarray function returning numpy array from single file.
pattern : str
Regular expression pattern that matches axes names and sequence indices in file names.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 
Return string with information about image sequence.
Overrides: object.__str__

asarray(self, *args, **kwargs)

source code 

Read image data from all files and return as single numpy array.

Raise IndexError if image shapes don't match.


Class Variable Details [hide private]

_axes_pattern

Value:
'''
        # matches Olympus OIF and Leica TIFF series
        _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\\d{1,4}))
        _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\\d{1,4}))?
        _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\\d{1,4}))?
        _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\\d{1,4}))?
        _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\\d{1,4}))?
        _?(?:(q|l|p|a|c|t|x|y|z|ch|tp)(\\d{1,4}))?
...