scallops.io.read_experiment

scallops.io.read_experiment(image_path, files_pattern=None, group_by=('well', 'tile'), subset=None, dask=False, scenes=False, **kwargs)

Read in an experiment from a directory of tiff, nd2, other Bio-Formats supported images or a zarr file.

If the file pattern contains c or t, images belonging to the same group will be stacked along these dimensions.

Parameters:
  • image_path (str | Path | list[str | Path]) – Path(s) to search for images

  • files_pattern (str | Pattern | None) – pattern of the image. For example, {mag}X_c{t}-{skip}_{well}_Tile-{tile}.{data_type}.tif. Ignored if input is in zarr format.

  • group_by (tuple[str, ...]) – Groups (in files_pattern) to group by. Ignored if input is in zarr format.

  • subset (Callable[[str], bool] | Sequence[str | Pattern] | None) – Image keys to include. Use * for wildcard. For example A2-* will include all tiles in well A2.

  • dask (bool) – Whether image in image DataArray is dask or numpy array

  • scenes (bool | list[str]) – Whether to read all scenes in an image or a list of scene ids

  • kwargs – Additional arguments to pass to bioio.BioImage constructor

Returns:

Experiment mapping keys to images. Each image has the dimensions (t,c,z,y,x).

Return type:

Experiment