bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / io / collection / MultiImage
class
skimage.io.collection:MultiImage
source: /dev/scikit-image/src/skimage/io/collection.py :446
Signature
class MultiImage ( filename , conserve_memory = True , dtype = None , ** imread_kwargs ) Members
Summary
A class containing all frames from multi-frame TIFF images.
Parameters
load_pattern: str or list of strPattern glob or filenames to load. The path can be absolute or relative.
conserve_memory: bool, optionalWhether to conserve memory by only caching the frames of a single image. Default is True.
Notes
MultiImage returns a list of image-data arrays. In this regard, it is very similar to ImageCollection, but the two differ in their treatment of multi-frame images.
For a TIFF image containing N frames of size WxH, MultiImage stores all frames of that image as a single element of shape (N, W, H) in the list. ImageCollection instead creates N elements of shape (W, H).
For an animated GIF image, MultiImage reads only the first frame, while ImageCollection reads all frames by default.
Examples
# Where your images are locateddata_dir = os.path.join(os.path.dirname(__file__), '../data')
⚠multipage_tiff = data_dir + '/multipage.tif' multi_img = MultiImage(multipage_tiff) len(multi_img) # multi_img contains one element multi_img[0].shape # this element is a two-frame image of shape:⚠
image_col = ImageCollection(multipage_tiff) len(image_col) # image_col contains two elements for frame in image_col: print(frame.shape) # each element is a frame of shape (15, 10)⚠
Aliases
-
skimage.io.MultiImage