Stitcher
This module contains the Stitcher class for handling image stitching operations.
For comprehensive information about the stitching process, including:
Position generation
Image assembly
Typical stitching workflows
Best practices for stitching
See the ImageStitchingStep class in the Steps documentation.
Stitcher
- class ezstitcher.core.stitcher.Stitcher(config=None, filename_parser=None)
Class for handling image stitching operations.
- Parameters:
config (
StitcherConfig, optional) – Configuration for stitchingfilename_parser (
FilenameParser, optional) – Parser for microscopy filenames
- generate_positions(image_dir, image_pattern, positions_path, grid_size_x, grid_size_y)
Generate positions for stitching using Ashlar.
- Parameters:
- Returns:
True if successful, False otherwise
- Return type:
- assemble_image(positions_path, images_dir, output_path, override_names=None)
Assemble a stitched image using subpixel positions from a CSV file.
- Parameters:
- Returns:
True if successful, False otherwise
- Return type:
- generate_positions_df(image_dir, image_pattern, positions, grid_size_x, grid_size_y)
Given an image_dir, an image_pattern (with ‘{iii}’ or similar placeholder) and a list of (x, y) tuples ‘positions’, build a DataFrame with lines like: file: <filename>; position: (x, y); grid: (col, row);
- Parameters:
- Returns:
DataFrame with positions
- Return type:
- static parse_positions_csv(csv_path)
Parse a CSV file with lines of the form: file: <filename>; grid: (col, row); position: (x, y)
- static save_positions_df(df, positions_path)
Save a positions DataFrame to CSV.
- Parameters:
df (pandas.DataFrame) – DataFrame to save
positions_path (str or Path) – Path to save the CSV file
- Returns:
True if successful, False otherwise
- Return type:
StitcherConfig
- class ezstitcher.core.stitcher.StitcherConfig
Configuration for the Stitcher class.