Skip to content

API reference

Everything listed here is importable from the top-level micro_reader package. Anything else, including modules whose names start with _ and the backend classes, is internal and may change without notice.

import micro_reader

Functions

Name Purpose
open(path, ...) Opens a file, folder or file set and returns a File.
group_files(paths) Sorts many files into the images they make and returns a Grouping.
read_many(requests) Reads the regions of many images in one go, each into an array you give.
memory_limit() / set_memory_limit(x) The process-wide memory limit for decoding.
cache_limit() / set_cache_limit(x) / cached_bytes() The decoded-block cache.
decode_threads() / set_decode_threads(n) The decode thread pool.

Classes

Name What it is
File An opened file, with its images, plates, backend and format.
Image One readable array, with its index, axes, metadata and pyramid.
ReadStats The counts of what an image has read so far.
Metadata Pixel sizes, position, channels and index values.
Channel The name, colour and wavelengths of one channel.
Quantity A value with an OME-Zarr unit.
Plate, Well, Field, Acquisition The plate layout and how to navigate it.
CoordinateSystem, Axis, Transformation, Collection Where the images sit, and the file's tree.
Grouping, FileGroup The result of group_files.

Errors and warnings

Name Kind
MicroReaderError The base class of the errors below.
UnsupportedFormatError Error.
CorruptFileError Error.
MemoryLimitError Error.
InvariantError Error.
DamagedFileWarning Warning.
MissingImagesWarning Warning.
CompanionWarning Warning.
CompositeWarning Warning.
PlateLayoutWarning Warning.
SkewedGridWarning Warning.
StoredValuesWarning Warning.

Constants

Name Value
INDEX_NAMES Every index name, outermost first.
PLATE_INDICES ("plate", "acquisition", "well", "field")
SAMPLED_INDICES The indices that rename can turn into axes.
BACKENDS The backend modules, in the order they are tried.
__version__ The package version, for example "0.4.4".

Conventions on these pages

  • Signatures are given as Python. A * marks the start of the keyword-only parameters.
  • A size argument accepts an int in bytes, or a str with binary units such as "8GB" or "512 MB".
  • An index is an image's dict of index names to integers, for example {"series": 0, "tile": 3}.
  • All attributes are read-only unless stated otherwise. Changing them is not supported.
  • Plate rows and columns count from 0. The row and column names of a plate, such as "C" and "3", are in Plate.row_names and Plate.column_names.