How aicell-lab/squid-control works
Major Components
• Squid Control Core:
• Includes the primary control logic found in the squid_control directory.
• Contains modules for controlling different cameras (e.g., camera_TIS.py, camera_default.py, camera_flir.py, camera_toupcam.py), GUI components, device configuration utility, and hardware interfacing (microcontroller, spectrometer, etc.).
• Houses configuration files (such as configuration_HCS_v2.ini, focus_camera_configurations.xml, uc2_fucci_illumination_configurations.xml) to configure device behavior.
• Hypha Integration Layer:
• Located in hypha_tools as well as the start_hypha_service.py script.
• Provides services for artifact management (e.g., dataset creation, image tile collection) and chatbot functions to register remote procedure calls via Hypha-RPC.
• Serves as the bridge to the external Hypha framework, enabling advanced automation and extensibility.
• CLI/Entry Points and Scripts:
• The squid_control/__main__.py acts as the entry point when executing “python -m squid_control”.
• Scripts in the scripts directory offer additional functionality for desktop launcher setup, camera listing, processing coordinates, and other custom utilities.
• Deployment and CI/CD:
• Docker-related files (Dockerfile in the docker directory) and GitHub workflows (.github/workflows) indicate containerization and CI/CD pipeline to deploy or publish the package (including PyPi publication).
• Documentation and Resources:
• The docs directory contains installation guides, tutorials (including the Hypha tutorial), and additional resources (like sample coordinates CSV) that explain usage and set up.
Relationships and Interactions
• The user interacts with the application via the CLI (or via GUI modules inside squid_control/control/gui.py) which then calls into the Squid Control Core for microscope operation.
• The control modules (in squid_control/control) communicate with various hardware drivers for cameras, microcontrollers, and peripherals.
• In simulation mode, the application can modify its behavior (triggered via command-line switches) but still follows the same control flow, using simulated data (as evidenced by sample CSVs and XML configurations).
• The Hypha integration layer (via hypha_tools and start_hypha_service.py) registers a Hypha service and supports a chatbot to allow remote procedure calls and advanced automation.
• Auxiliary scripts provide support and tooling that can be used independently or as part of the control flow to generate configurations, stitch images, or publish artifacts.
Architectural Patterns and Design Principles
• Modular Breakdown: The clear separation between the device control (squid_control), integration tools (hypha_tools), and utility scripts highlights a modular design that follows separation of concerns.
• Extensibility: The inclusion of custom multipoint script functionality and plugin-like integration of Hypha services shows design for extensibility.
• Configuration-Driven Behavior: The usage of various configuration files (INI, XML) and scripts for dynamic configuration indicates a flexible, configurable system.
• Containerization and CI/CD: The Docker and GitHub Actions configuration underline modern DevOps practices.