Skip to main content

pymmcore superset providing improved APIs, event connection, and a pure python acquisition engine

Project description

pymmcore-plus

License PyPI Python Version CI codecov

pymmcore-plus extends pymmcore (python bindings for the C++ micro-manager core) with a number of features designed to facilitate working with Micro-manager in pure python/C environments.

  • pymmcore_plus.CMMCorePlus is a drop-in replacement subclass of pymmcore.CMMCore that provides a number of helpful overrides and additional convenience functions beyond the standard CMMCore API. See CMMCorePlus documentation for details.
  • CMMCorePlus includes a run_mda method (name may change) "acquisition engine" that drives micro-manager for conventional multi-dimensional experiments. It accepts an MDASequence from useq-schema for experiment design/declaration.
  • Adds a callback system that adapts the CMMCore callback object to an existing python event loop (such as Qt, or perhaps asyncio/etc...). The CMMCorePlus class also fixes a number of "missed" events that are not currently emitted by the CMMCore API.

Documentation

https://pymmcore-plus.github.io/pymmcore-plus/

Why not just use pymmcore directly?

pymmcore is (and should probably remain) a thin SWIG wrapper for the C++ code at the core of the Micro-Manager project. It is sufficient to control micromanager via python, but lacks some "niceties" that python users are accustomed to. This library:

  • extends the pymmcore.CMMCore object with additional methods
  • fixes emission of a number of events in MMCore.
  • provide proper python interfaces for various objects like Configuration and Metadata.
  • provides an object-oriented API for Devices and their properties.
  • uses more interpretable Enums rather than int for various constants
  • improves docstrings and type annotations.
  • generally feel more pythonic (note however, camelCase method names from the CMMCore API are not substituted with snake_case).

What about Pycro-Manager?

Pycro-Manager is a library designed to make it easier to work with and control the Java Micro-manager application using python. As such, it requires Java to be installed and running in the background (either via the micro-manager GUI application directly, or via a headless process). The python half communicates with the Java half using ZeroMQ messaging.

In brief: while Pycro-Manager provides a python API to control the Java Micro-manager application (which in turn controls the C++ core), pymmcore-plus provides a python API to control the C++ core directly, without the need for Java in the loop.

Quickstart

Install

# from pip
pip install pymmcore-plus

# from conda
conda install -c conda-forge pymmcore-plus

# if you also want the experimental inter-process RemoteCMMCore feature
pip install pymmcore-plus[remote]

# or from source tree
pip install git+https://github.com/pymmcore-plus/pymmcore-plus.git

Usually, you'll then want to install the device adapters (though you can also download these manually from micro-manager.org):

mmcore install

See installation documentation for more details.

Usage

Then use the core object as you would pymmcore.CMMCore... but with more features :smile:

from pymmcore_plus import CMMCorePlus

core = CMMCorePlus()
...

Examples

See a number of usage examples in the documentation.

You can find some basic python scripts in the examples directory of this repository

Contributing

Contributions are welcome! See contributing guide.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymmcore_plus-0.6.5.tar.gz (142.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymmcore_plus-0.6.5-py3-none-any.whl (64.8 kB view details)

Uploaded Python 3

File details

Details for the file pymmcore_plus-0.6.5.tar.gz.

File metadata

  • Download URL: pymmcore_plus-0.6.5.tar.gz
  • Upload date:
  • Size: 142.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pymmcore_plus-0.6.5.tar.gz
Algorithm Hash digest
SHA256 690a83eb8f9fb7e9552c06bc1533429e153da15db618b7e68c172d4fa71005f1
MD5 81ced7d1c4aca49234207ff896387fd0
BLAKE2b-256 07df5a550c3242f8177b341a3ca919f27de04d4d7f51dea81f0ebd5e89efb152

See more details on using hashes here.

File details

Details for the file pymmcore_plus-0.6.5-py3-none-any.whl.

File metadata

  • Download URL: pymmcore_plus-0.6.5-py3-none-any.whl
  • Upload date:
  • Size: 64.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pymmcore_plus-0.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8a61305fc58aa104430d0a23ed685a353413a58aed2939a7daf2b20f4449bf3b
MD5 726804e8eca4fdfa2bf20aeed9f09f1a
BLAKE2b-256 a2ced72a36a796779a8a4a0e9a1157afdcc3ef50924ff0d2a99d888052e39e93

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page