Image Stack Loaders
Utility functions to construct ImageStacks from different sources.
load_arrays(source, axes)
Load ImageStacks from a sequence of numpy arrays.
Parameters:
-
source(sequence of numpy.ndarray) –Source arrays of the data.
-
axes(str) –Original axes of the data, must be a subset of "STCZYX".
Returns:
-
list[InMemoryImageStack]–ImageStacks created from the input arrays.
load_custom_file(source, axes, *, read_func, read_kwargs)
Load ImageStacks from a sequence of files of a custom type.
Parameters:
-
source(sequence of Path) –Source files for the data.
-
axes(str) –Original axes of the data, must be a subset of "STCZYX".
-
read_func(ReadFunc) –A function to read the custom file type, see the
ReadFuncprotocol. -
read_kwargs(dict of {str: Any}) –Additional arguments passed to the custom
read_func.
Returns:
-
list[InMemoryImageStack]–ImageStacks created from the custom files.
load_czis(source, axes)
Load CZI image stacks from a sequence of CZI files paths.
If the CZI files contain multiple scenes, one image stack will be created for each scene.
Axes should be in the format "SC(Z/T)YX", where Z or T are optional, and S and C can be singleton dimensions, but must be provided.
Parameters:
-
source(sequence of Path) –Source files for the data.
-
axes(str) –Axes of the data, must be either "SCYX", "SCZYX" or "SCTYX". Depth axis is inferred from the axes string. If this string ends with
"ZYX"or"TYX", the data will consist of 3-D.
Returns:
-
list[CziImageStack]–Image stacks created from the CZI files.
Raises:
-
ValueError–If the provided axes are not valid.
load_iter_tiff(source, axes)
Load image stacks from a sequence of TIFF files.
Parameters:
-
source(sequence of Path) –Source files for the data.
-
axes(str) –Original axes of the data, must be a subset of "STCZYX".
Returns:
-
list[FileImageStack]–Lazily loaded ImageStacks backed by the source files.
load_tiffs(source, axes)
Load ImageStacks from a sequence of TIFF files.
Parameters:
-
source(sequence of Path) –Source files for the data.
-
axes(str) –Original axes of the data, must be a subset of "STCZYX".
Returns:
-
list[InMemoryImageStack]–ImageStacks created from the source files.
load_zarrs(source, axes)
Create a list of ZarrImageStack from a sequence of zarr file paths or URIs.
File paths must point to a zarr store (ending with .zarr) and URIs must be in the format "file://path/to/zarr_store.zarr/group/path/array_name".
If the zarr file is an OME-Zarr, the specified multiscale level will be used. Note that OME-Zarrs are only supported when providing a path to the zarr store, not when using a file URI. One can, however, provide a file URI to the specific resolution array within the OME-Zarr.
Parameters:
-
source(sequence of str or Path) –Source zarr file paths or URIs.
-
axes(str) –Original axes of the data, must be a subset of "STCZYX".
Returns:
-
list of ZarrImageStack–A list of ZarrImageStack created from the sources.