fishtank.io.read_mosaic

Contents

fishtank.io.read_mosaic#

fishtank.io.read_mosaic(path, series, colors=None, fovs=None, file_pattern='{series}/Conv_zscan_{fov}.dax', z_slices=None, z_project=False, downsample=4, filter=None, filter_args=None, microns_per_pixel=None, positions=None, flip_horizontal=False, flip_vertical=False)#

Read FOV images as a mosaic.

Parameters:
  • path (str | Path) – Path to image files.

  • series (str) – Name of a series to read

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

  • fovs (Optional[list] (default: None)) – List of field of view numbers to read.

  • file_pattern (str (default: '{series}/Conv_zscan_{fov}.dax')) – Naming pattern for image files.

  • 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.

  • downsample (int | bool (default: 4)) – Factor to downsample the image by. If False, no downsampling is performed.

  • filter (Optional[callable] (default: None)) – Function to filter the images with.

  • filter_args (Optional[dict] (default: None)) – Arguments to pass to the filter function.

  • positions (Optional[dict] (default: None)) – Dict mapping FOV number to (x, y) stage position in microns. When provided, overrides the stage positions read from image metadata.

  • flip_horizontal (bool (default: False)) – Flip each FOV image horizontally before stitching.

  • flip_vertical (bool (default: False)) – Flip each FOV image vertically before stitching.

Return type:

tuple[ndarray, ndarray]

Returns:

mosaic

a numpy array image with all FOVs stitched together.

bounds

the total bounds in microns (x_min, y_min, x_max, y_max).