microcorrelate.stitching#

This module contains functions for stitching together microscopy images

Classes#

StitchConfig

Custom TIFF tag IDs used to store acquisition metadata in stitched images.

Functions#

read_metadata(→ tuple[dict, dict])

Read acquisition metadata from a stitched TIFF image.

stitch_images(→ None)

Stitch together tiled images from a tileset acquired via the Thermo Fisher Maps

Module Contents#

class microcorrelate.stitching.StitchConfig#

Custom TIFF tag IDs used to store acquisition metadata in stitched images.

tag_metadata_common#

TIFF tag ID for the JSON-encoded metadata common to all acquired tiles. Default is 65000.

Type:

int

tag_metadata_all#

TIFF tag ID for the JSON-encoded per-tile acquisition metadata. Default is 65001.

Type:

int

microcorrelate.stitching.read_metadata(stitch_path: pathlib.Path) tuple[dict, dict]#

Read acquisition metadata from a stitched TIFF image.

Parameters:

stitch_path (Path) – Path to the stitched TIFF file produced by stitch_images().

Returns:

  • metadata_common (dict) – Metadata keys and values shared across all acquired tiles.

  • metadata_all (dict) – Per-tile metadata, keyed by original filename.

microcorrelate.stitching.stitch_images(tileset_path: pathlib.Path | str, dest_path: pathlib.Path | str, compression: bool = True, group_path: str | None = None, pyramid_levels: int = 1, verbose: bool = False) None#

Stitch together tiled images from a tileset acquired via the Thermo Fisher Maps software and save the stitched image as a single TIFF file or Zarr file. The tileset is expected to be in the directory structure produced by Maps, and have been already stitched by the acquisition software (that is, there’s no overlap or gaps between tiles).

Parameters:
  • tileset_path (Path | str) – Path to the tileset directory.

  • dest_path (Path | str) – Path to save the stitched image. It can be either a .tif file or a .zarr store.

  • compression (bool) – Save Tiff image with compression (zlib). This parameter is only used when output is TIff. Zarr files are always compressed. (default = True).

  • group_path (str | None) – Path to the group in the Zarr array where images should be saved. If None, save in root. This parameter is only used if output is Zarr. (default = None).

  • pyramid_levels (int) – Number or pyramid levels used when saving to Zarr multiscales. If 1, no downscaled levels are calculated. (default = 1).

  • verbose (bool) – Enable verbose output (default = False).

Return type:

None