Skip to main content

An easy-to-use microscopy image stitching and processing tool

Project description

EZStitcher

EZStitcher is a Python library designed to simplify the processing and stitching of microscopy images. It provides a flexible pipeline architecture that allows researchers to easily process large microscopy datasets, create composite images, flatten Z-stacks, and stitch tiled images together. The stitching process is powered by the robust Ashlar backend.

Key Features

  • Multi-channel fluorescence support: Process and stitch multiple fluorescence channels
  • Z-stack Handling & Focus Detection: Process 3D image stacks with various projection methods, advanced focus detection, and support for per-plane 3D stitching.
  • Flexible Preprocessing: Apply custom image processing functions within the pipeline.
  • Microscope Support & Auto-Detection: Supports ImageXpress and Opera Phenix formats with automatic detection of microscope type and image organization.
  • Parallel Processing: Built-in multithreading support (PipelineConfig) for faster execution on multi-core systems.
  • Extensible & Integratable: Clean, object-oriented API facilitates customization and integration with other Python microscopy/image analysis packages.

Installation

The package is typically installed by cloning the Git repository and running the following command within the repository's root directory (after setting up a suitable Python 3.11 environment and virtual environment):

pip install -e .

This command installs the package in editable mode and handles dependencies listed in requirements.txt.

Basic Usage

The following example demonstrates a basic pipeline that normalizes images and then stitches them. Intermediate output directories for steps are managed automatically by default, typically within structured intermediate folders. The final pipeline output directory also defaults to a location based on the input plate name (e.g., [plate_name]_stitched next to the original plate folder). You can specify custom output_dir for individual steps or the overall pipeline if manual control over output locations is needed.

from ezstitcher.core.config import PipelineConfig
from ezstitcher.core.pipeline_orchestrator import PipelineOrchestrator
from ezstitcher.core.pipeline import Pipeline
from ezstitcher.core.steps import Step, PositionGenerationStep, ImageStitchingStep
from ezstitcher.core.image_processor import ImageProcessor as IP
from pathlib import Path

# Create configuration (e.g., single-threaded)
config = PipelineConfig(num_workers=1)

# Path to your plate folder (replace with actual path)
plate_path = Path("/path/to/your/plate")

# Create orchestrator
orchestrator = PipelineOrchestrator(
    config=config,
    plate_path=plate_path
)

# Define the pipeline steps
# The final output directory defaults to '[plate_name]_stitched' next to the plate folder
pipeline = Pipeline(
    input_dir=orchestrator.workspace_path,  # Use workspace managed by orchestrator
    steps=[
        # Step 1: Normalize image intensities
        # Output is implicitly stored in an automatically managed intermediate directory
        Step(
            name="Normalize Images",
            func=IP.stack_percentile_normalize
        ),
        # Step 2: Generate positions for stitching (uses output from Step 1)
        PositionGenerationStep(),
        # Step 3: Stitch images (uses output from Step 2 by default)
        ImageStitchingStep()
    ],
    name="Basic Processing Pipeline"
)

# Run the pipeline
success = orchestrator.run(pipelines=[pipeline])

Core Concepts

EZStitcher uses a hierarchical pipeline architecture: the PipelineOrchestrator coordinates plate-level operations and manages the execution of Pipelines (sequences of processing Steps) across multiple wells.

Documentation

For more detailed information, please refer to the full documentation hosted on Read the Docs (replace with actual link if different). The source files for the documentation are located in the docs/source directory, with the main index page at docs/source/index.rst.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezstitcher-0.1.0.tar.gz (137.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezstitcher-0.1.0-py3-none-any.whl (71.9 kB view details)

Uploaded Python 3

File details

Details for the file ezstitcher-0.1.0.tar.gz.

File metadata

  • Download URL: ezstitcher-0.1.0.tar.gz
  • Upload date:
  • Size: 137.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for ezstitcher-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a1f9906a9499f83469aa752f6bd9a6a7e4bcaf04ef76eed574e21870fcb35ecc
MD5 e2814e4b7645bbde4d42da7781eea255
BLAKE2b-256 b7451d1c407fc61e74f6e1fa94f9177b0945490ea38f902c6f555d1dfb978d62

See more details on using hashes here.

File details

Details for the file ezstitcher-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ezstitcher-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 71.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for ezstitcher-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21a5c149bb4d1a1279a12d73ae02e70508922dfbeabf7a270a2f72a8c93b2f2f
MD5 be10ae2118fb48ea75ee80f2ea339753
BLAKE2b-256 6c9e773bb433a0080098cb750322422f6c6e477bd892949cdb92cb69c97904bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page