The Squid Control software is a Python package that provides a simple interface to control the Squid microscope, integrated with the Hypha platform for remote access and distributed control.
Install from source (recommended for development)
# Clone the repository
git clone https://github.com/aicell-lab/squid-control.git
cd squid-control
# Install in development mode
pip install -e .[dev]For development, we recommend using conda:
# Create conda environment
conda create -n squid python=3.11
# Activate environment
conda activate squid
# Install in development mode
pip install -e .[dev]Command Line Interface:
The Squid Control system provides a unified command-line interface with subcommands:
# Main microscope service
python -m squid_control microscope [--simulation] [--local] [--verbose]
# Mirror service for cloud-to-local proxy
python -m squid_control mirror [--cloud-service-id ID] [--local-service-id ID] [--verbose]
# Examples:
# Run microscope in simulation mode
python -m squid_control microscope --simulation
# Run microscope in local mode
python -m squid_control microscope --local
# Run microscope with verbose logging
python -m squid_control microscope --simulation --verbose
# Get help
python -m squid_control --help
python -m squid_control microscope --help
python -m squid_control mirror --helpTo start simulation mode, use the following command:
python -m squid_control microscope --simulationThe simulation mode includes a virtual microscope sample using Zarr data archives, allowing you to test the microscope software without physical hardware. The simulated sample data is uploaded on Artifact Manager, which is a feature on the Hypha platform for managing and sharing large datasets.
The Mirror Service is a sophisticated proxy system that bridges cloud and local microscope control systems, enabling remote control of microscopes while maintaining full WebRTC video streaming capabilities.
The public Hypha server (hypha.aicell.io) may not always be stable for critical device control. The mirror service provides a solution:
- Setup local Hypha server on your workstation for stable device control
- Register local microscope service on your local Hypha server
- Run mirror service on the same workstation to mirror hardware control to remote servers
- Result: You get both stability (local control) and remote access (cloud availability)
# Run mirror service with default settings
python -m squid_control mirror
# Run with custom service IDs
python -m squid_control mirror \
--cloud-service-id "mirror-microscope-control-squid-2" \
--local-service-id "microscope-control-squid-2"
# Run with custom server URLs
python -m squid_control mirror \
--cloud-server-url "https://hypha.aicell.io" \
--cloud-workspace "reef-imaging" \
--local-server-url "http://localhost:9527" \
--local-service-id "microscope-control-squid-1"- Dynamic Method Mirroring: Automatically mirrors all available methods from local services to cloud
- WebRTC Video Streaming: Real-time video with metadata transmission via data channels
- Health Monitoring: Automatic health checks with exponential backoff reconnection
- Configurable Service IDs: Customizable cloud and local service identifiers
- Automatic Illumination Control: Manages illumination based on WebRTC connection state
The Squid Control system features advanced Zarr Canvas & Image Stitching capabilities that enable real-time creation of large field-of-view images from multiple microscope acquisitions.
- OME-Zarr Compliance: Full OME-Zarr 0.4 specification support with proper metadata
- Multi-Scale Pyramid: 4x downsampling between levels for efficient storage
- Well-Based Organization: Individual well canvases for precise control
- Real-Time Stitching: Background processing for non-blocking operation
- Quick Scan Mode: High-speed continuous scanning (up to 10fps)
ZARR_PATH: Base directory for zarr storage (default:/tmp/zarr_canvas)- Authentication token for cloud Hypha server
- Authentication token for local Hypha server (if user have)
The current branch is a fork from https://github.com/hongquanli/octopi-research/ at the following commit:
commit dbb49fc314d82d8099d5e509c0e1ad9a919245c9 (HEAD -> master, origin/master, origin/HEAD)
Author: Hongquan Li <hqlisu@gmail.com>
Date: Thu Apr 4 18:07:51 2024 -0700
add laser af characterization mode for saving images from laser af camera
