Skip to main content

PyCLM

DOI

A Modular Closed-Loop Microscopy Software in Python

Please see our documentation at readthedocs

Overview

PyCLM is a python-based closed-loop microscopy software designed for running many dynamic and/or feedback-controlled optogenetic experiments simultaneously. Through PyCLM, it is possible to design spatial light patterns that change over time, follow individual cell positions, or change in response to cell features.

This approach to closed-loop microscopy is oriented around three major goals:

  1. Efficiency. Ideally, the number of possible simultaneous experiments should be limited only by the physical constraints of the microscopy system.
  • Microscope control, data export, image segmentation, and pattern generation are split into separate processes that run in parallel, minimizing unneeded microscope downtime.
  1. (Re)usability. Re-running experiments, combining multiple experiments, or changing experimental parameters should be as quick as possible, without requiring any programming experience.
  • Descriptive and intuitively organized .toml files are used for experiment configuration, and can be reused or quickly edited for later experiments.
  • Several common use-case configurations are provided for dynamic light input and feedback control experiments.
  1. Extensibility. It should be possible to implement a wide range of new segmentation and stimulation methods on top of the existing software.
  • Segmentation and stimulation methods inherit from a base class, and are required to implement three straightforward functions.

Installation

pip install "closed-loop-microscopy[gui]"

The package is closed-loop-microscopy; the import name and the command are pyclm. Leave out [gui] for a headless install (checking, previews, dry runs, reading data). For development, clone the repository and run uv sync.

Try it without a microscope:

pyclm new demo --demo
pyclm run demo --dry --gui

The demo runs two experiments on the virtual microscope with synthetic cells: a sweeping bar of light, and a closed loop that segments the cells with a method the directory brings along (demo_methods.py) and lights the outward half of each.

See First-Time Setup Guide to get started.

Hardware requirement: Micro-Manager

PyCLM controls hardware through pymmcore-plus, which wraps the Micro-Manager C++ core. The Python package installs without issue, but running a real experiment requires:

  1. Install Micro-Manager — download the nightly build for your platform from micro-manager.org.
  2. Point PyCLM at your MM installation — set the config_path field in pyclm_config.toml to your Micro-Manager .cfg hardware configuration file.

Importing the package and using the dry-run (--dry) mode work without a Micro-Manager installation.

Citation

If you use PyCLM in your research, please cite:

Oatman HR, Lad BC, Nguyen L, Gubbens JH, Toettcher JE. An optogenetic smart microscopy platform reveals signaling dynamics-dependent control over collective cell migration. Cell Systems 17(9) (2026). doi:10.1016/j.cels.2026.101674

The paper describes version 1.0.1. To record the version you used, also cite that release: every release has its own DOI on Zenodo, all listed under doi:10.5281/zenodo.20385964 (which always resolves to the latest). GitHub's "Cite this repository" button gives both, from CITATION.cff.

Metadata

Release files for closed-loop-microscopy 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for closed-loop-microscopy 1.1.0
File Size Uploaded
closed_loop_microscopy-1.1.0.tar.gz 159.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for closed-loop-microscopy 1.1.0
File Interpreter ABI Platform
closed_loop_microscopy-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 353.2 kB

Release files / closed_loop_microscopy-1.1.0.tar.gz

Download URL closed_loop_microscopy-1.1.0.tar.gz
Size 159.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0504b725663344132f610c841984dedabe717774288043a48ee42ca1418b9bf0
BLAKE2b-256 checksum
How to use checksums
f707341c770e6cbd1f34a72832144fe6352af00ed06e2e026794ded11a4e368a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / closed_loop_microscopy-1.1.0-py3-none-any.whl

Download URL closed_loop_microscopy-1.1.0-py3-none-any.whl
Size 193.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59f487956393b462f77725427ae1b4594501fcc41f520f16552b827bf77a67c5
BLAKE2b-256 checksum
How to use checksums
9c08d69fcb1f56b9fe14a8e541cd7056fd6cef3fcb104e5d22b8ecb757b27875
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page