fishtank.io.read_img

Contents

fishtank.io.read_img#

fishtank.io.read_img(path, colors=None, z_slices=None, z_project=False, shape=None, color_order=None, frames=None, plugin=None, **plugin_args)#

Read image file.

Parameters:
  • path (str | Path) – Image file path.

  • colors (Union[int, str, list, None] (default: None)) – List of color indices to read.

  • z_slices (Union[int, list, None] (default: None)) – List of z-slice indices to read.

  • z_project (bool (default: False)) – If True, z-project the image.

  • shape (Optional[tuple] (default: None)) – Shape of a single frame.

  • color_order (Optional[list] (default: None)) – Order of colors in the image.

  • frames (Union[str, Path, None] (default: None)) – Path to a frame table CSV specifying the color and z-position of each frame. The CSV must have an index column (frame index) and columns ‘color’ and ‘z’. Rows with NaN color are treated as blank frames and skipped. When provided, overrides XML-based frame metadata for color/z mapping.

  • plugin (Optional[str] (default: None)) – Name of skimage plugin used to load image if not dax format.

  • plugin_args – Passed to the given plugin

Return type:

tuple[ndarray, dict]

Returns:

img

a numpy array, such that a gray image is (Y,X), a 3D gray image is (Z,Y,X), and 3D multi-channel image is (C,Z,Y,X).

attrs

a dictionary of image attributes.