MicroscopeControl.jl is a Julia package for control of optical microscopy hardware, providing a flexible and high-performance solution for microscope developers.
MicroscopeControl.jl utilizes three layers of code: high-level, low-level, and user-level. High-level code is generic, providing interfaces for stages, light sources, cameras, etc. Low-level code handles hardware-specific implementations, defining functions for individual microscope components. This design heavily leverages Julia’s multiple dispatch, enabling different behaviors for the same function based on argument types. The user-level code integrates these layers to control the microscope system.
MicroscopeControl.jl is organized to ensure scalability and easy integration of new hardware:
- Defines basic functions and properties common across all device types (e.g., cameras, light sources, stages).
- Each abstract interface (e.g.,
CameraInterface,LightSourceInterface,StageInterface) outlines the required methods, such asinitialize,shutdown, andexport_state.
- Provides concrete modules for each hardware device model (e.g.,
TCubeLaserControl,DCAM4Camera,MCLStage). - These modules implement the abstract interfaces and add device-specific functionality.
-
Constructor Methods
Each hardware component has a constructor that takes relevant parameters (like serial numbers or device addresses). After constructing the device object, you can callinitializeor other methods to start interacting with the hardware. -
Export State
The functionexport_stategives you a structured overview of the device’s current settings:- Attributes: Key-value pairs with the device’s configuration.
- Data: Measurement or imaging data.
- Children: Nested hardware components or linked instruments.
-
Graphical User Interface
Many modules provide a simple GUI for controlling hardware, created using GLMakie. This interface often allows for easy on/off toggling, parameter changes, and live readouts.
- Hamamatsu DCAM4 compatible cameras
- Thorlabs Scientific Cameras (CSC series)
- Simulated camera for testing
- Mad City Labs nanopositioning stages
- Physik Instrumente (PI) stages
- PI N-472 linear stage
- Simulated stage for testing
- Thorlabs TCube laser diode controller
- CrystaLaser 561nm
- Vortran 488nm laser
- Simulated light source for testing
- National Instruments DAQ cards
- Opal Kelly XEM FPGA boards
- DAQ-based transmission light control
Since this package is under active development and not yet registered, install it pinned to a released tag:
using Pkg
Pkg.add(url="https://github.com/LidkeLab/MicroscopeControl.jl.git", rev="v0.1.0")Advance the pinned tag deliberately when you want a newer release. Pkg.develop (tracking main directly, no tag) is for contributors working on the package itself, not for rig code that depends on it.
This package follows a 0.x versioning policy: every merge to main is tagged (.github/workflows/TagOnMerge.yml), a minor bump (0.x.0) means an interface change, and a patch bump (0.0.x) is everything else. Hardware verification is not tracked here; it is recorded by the downstream rig repo that pins to a given tag.
Contributions are welcome! We encourage pull requests that add support for new hardware or improve existing modules.