Microscope Implementations

This module contains implementations of microscope-specific functionality.

ImageXpress

class ezstitcher.microscopes.imagexpress.ImageXpressFilenameParser

Filename parser for ImageXpress microscopes.

classmethod can_parse(cls, filename)

Check if this parser can parse the given filename.

Parameters:

filename (str) – Filename to check

Returns:

True if this parser can parse the filename, False otherwise

Return type:

bool

parse_filename(filename)

Parse an ImageXpress filename into its components.

Parameters:

filename (str) – Filename to parse

Returns:

Dictionary with extracted components or None if parsing fails

Return type:

dict or None

construct_filename(well, site=None, channel=None, z_index=None, extension='.tif', site_padding=3, z_padding=3)

Construct an ImageXpress filename from components.

Parameters:
  • well (str) – Well ID (e.g., ‘A01’)

  • site (int or str, optional) – Site number or placeholder string (e.g., ‘{iii}’)

  • channel (int, optional) – Channel/wavelength number

  • z_index (int or str, optional) – Z-index or placeholder string (e.g., ‘{zzz}’)

  • extension (str, optional) – File extension

  • site_padding (int, optional) – Width to pad site numbers to

  • z_padding (int, optional) – Width to pad Z-index numbers to

Returns:

Constructed filename

Return type:

str

class ezstitcher.microscopes.imagexpress.ImageXpressMetadataHandler

Metadata handler for ImageXpress microscopes.

find_metadata_file(plate_path)

Find the metadata file for an ImageXpress plate.

Parameters:

plate_path (str or Path) – Path to the plate folder

Returns:

Path to the metadata file, or None if not found

Return type:

Path or None

get_grid_dimensions(plate_path)

Get grid dimensions for stitching from ImageXpress metadata.

Parameters:

plate_path (str or Path) – Path to the plate folder

Returns:

Tuple of (grid_size_x, grid_size_y)

Return type:

tuple

get_pixel_size(plate_path)

Get the pixel size from ImageXpress metadata.

Parameters:

plate_path (str or Path) – Path to the plate folder

Returns:

Pixel size in micrometers, or None if not available

Return type:

float or None

Opera Phenix

class ezstitcher.microscopes.opera_phenix.OperaPhenixFilenameParser

Filename parser for Opera Phenix microscopes.

classmethod can_parse(cls, filename)

Check if this parser can parse the given filename.

Parameters:

filename (str) – Filename to check

Returns:

True if this parser can parse the filename, False otherwise

Return type:

bool

parse_filename(filename)

Parse an Opera Phenix filename into its components.

Parameters:

filename (str) – Filename to parse

Returns:

Dictionary with extracted components or None if parsing fails

Return type:

dict or None

construct_filename(well, site=None, channel=None, z_index=None, extension='.tiff', site_padding=1, z_padding=1)

Construct an Opera Phenix filename from components.

Parameters:
  • well (str) – Well ID (e.g., ‘A01’)

  • site (int or str, optional) – Site number or placeholder string (e.g., ‘{iii}’)

  • channel (int, optional) – Channel/wavelength number

  • z_index (int or str, optional) – Z-index or placeholder string (e.g., ‘{zzz}’)

  • extension (str, optional) – File extension

  • site_padding (int, optional) – Width to pad site numbers to

  • z_padding (int, optional) – Width to pad Z-index numbers to

Returns:

Constructed filename

Return type:

str

class ezstitcher.microscopes.opera_phenix.OperaPhenixMetadataHandler

Metadata handler for Opera Phenix microscopes.

find_metadata_file(plate_path)

Find the metadata file for an Opera Phenix plate.

Parameters:

plate_path (str or Path) – Path to the plate folder

Returns:

Path to the metadata file, or None if not found

Return type:

Path or None

get_grid_dimensions(plate_path)

Get grid dimensions for stitching from Opera Phenix metadata.

Parameters:

plate_path (str or Path) – Path to the plate folder

Returns:

Tuple of (grid_size_x, grid_size_y)

Return type:

tuple

get_pixel_size(plate_path)

Get the pixel size from Opera Phenix metadata.

Parameters:

plate_path (str or Path) – Path to the plate folder

Returns:

Pixel size in micrometers, or None if not available

Return type:

float or None