A Python-based control system for microscopes using Micro-Manager (MMCore) with remote procedure call (RPC) capabilities.
This system provides a robust interface for controlling microscope hardware through Micro-Manager, with the following features:
- Remote control capabilities through RPC
- Configurable hardware settings
- Safe hardware initialization and cleanup
- Environment-based configuration management
- Python 3.7+
- Micro-Manager 2.0 gamma or later
- Required Python packages:
- pymmcore
- rpyc
- typing
-
Clone this repository:
git clone <repository-url> -
Install the required Python packages:
pip install -r requirements.txt -
Set up your Micro-Manager installation:
- Install Micro-Manager in your preferred location
- Update the
MM_DIRenvironment variable or use the default inconfigs.py - Place your microscope configuration file in the
mmconfigsdirectory or updateMM_CONFIG
The system can be configured through environment variables or default values in configs.py:
MM_DIR: Path to Micro-Manager installation- Default:
C:\Program Files\Micro-Manager-2.0gamma
- Default:
MM_CONFIG: Path to microscope configuration file- Default:
./mmconfigs/Bright_Star.cfg
- Default:
- Server settings:
- Port: 18861
- Hostname: localhost
-
Start the microscope server:
python start_server.py -
The server will initialize the MMCore instance and wait for client connections
The system includes robust error handling for:
- MMCore initialization
- Configuration loading
- Directory management
- Hardware connections
- Client connections/disconnections
configs.py: Configuration managementstart_server.py: Main server implementation with MMCore controlmmconfigs/: Directory for microscope configuration files