Skip to content

Control microscopes with Python

A set of Python packages for running a microscope through Micro-Manager's C++ core and device adapters, with no Java process involved. Script your hardware, run multi-dimensional acquisitions, build your own GUI, or just use one of ours.

Get started User guide

import useq
from pymmcore_plus import CMMCorePlus

core = CMMCorePlus()
core.loadSystemConfiguration()  # demo devices

sequence = useq.MDASequence(
    channels=["DAPI", "FITC"],
    time_plan={"interval": 1, "loops": 5},
)
core.mda.run(sequence, output="data.ome.zarr")

Where to start

  • Script a microscope


    Load a configuration, move stages, snap images, and connect callbacks to changes in the core, from a script or a notebook.

    First steps

  • Run acquisitions


    Describe time-lapses, z-stacks, channels and positions with useq, run them with an acquisition engine you can customize, and save to OME-Zarr or OME-TIFF.

    Your first acquisition

  • Build a GUI


    Combine Qt widgets (property browsers, stage controls, MDA editors, image previews, etc...) into your own application.

    Your first GUI

  • Just use an app


    Point-and-click microscope control with pymmcore-gui, or inside napari with napari-micromanager.

    Applications

Getting Started goes through these in order, using Micro-Manager's demo devices (no microscope required). If you already know Micro-Manager, Coming from Micro-Manager maps what you know onto these packages.

How the pieces fit together

Each package builds on the ones below it. You only need to go as far up the stack as you want (pymmcore-plus on its own is enough to script a microscope).

Applications
Desktop applications for running a microscope.
Widgets
Qt widgets for devices, properties, configurations and acquisitions.
Control & acquisition
The core, extended with events and an acquisition engine, a schema for describing experiments, and writers for OME-Zarr and OME-TIFF.
Micro-Manager
The C++ core and drivers for hundreds of cameras, stages, shutters, lasers, etc...
Your microscope

  Micro-Manager's demo devices, or your own hardware

Community