npstreams.iload
- npstreams.iload(files, load_func, **kwargs)
Create a stream of arrays from files, which are loaded lazily.
In cases where the consumer function is much faster than data loading, consider using
pload()instead.- Parameters:
- Yields:
arr (~numpy.ndarray) – Loaded data.
See also
ploadload files from parallel processes.
Examples
To load images using scikit-image
from skimage.io import imread ims = iload('images_*.tif', imread)
Keyword arguments are passed to the
load_func; for example, to specify the scikit-image plugin'tifffile':ims = iload('images_*.tif', imread, plugin = 'tifffile')
In case the list of images is already known:
ims = iload(['im1.tif', 'im2.tif', 'im3.tif'], imread)