pymmcore superset providing improved APIs, event connection, and a pure python acquisition engine
Project description
pymmcore-plus
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 ofpymmcore.CMMCore
that provides a number of helpful overrides and additional convenience functions beyond the standard CMMCore API. See CMMCorePlus documentation for details.pymmcore-plus
includes an 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
andMetadata
. - provides an object-oriented API for Devices and their properties.
- uses more interpretable
Enums
rather thanint
for various constants - improves docstrings and type annotations.
- generally feel more pythonic (note however,
camelCase
method names from the CMMCore API are not substituted withsnake_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.
See migrating from pycromanager for details.
Quickstart
Install
from pip
pip install pymmcore-plus
# or, add the [cli] extra if you wish to use the `mmcore` command line tool:
pip install "pymmcore-plus[cli]"
from conda
conda install -c conda-forge pymmcore-plus
dev version from github
pip install 'pymmcore-plus[cli] @ git+https://github.com/pymmcore-plus/pymmcore-plus'
Usually, you'll then want to install the device adapters. Assuming you've
installed with pip install "pymmcore-plus[cli]"
, you can run:
mmcore install
(you can also download these manually from micro-manager.org)
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
Built Distribution
File details
Details for the file pymmcore_plus-0.8.1.tar.gz
.
File metadata
- Download URL: pymmcore_plus-0.8.1.tar.gz
- Upload date:
- Size: 93.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2467308fa289add80fd457b7eff992b1be52e009182e0c13820a68992647c7e8 |
|
MD5 | 937096fb2156e18005eb7945763e429f |
|
BLAKE2b-256 | 1a9b5b97cbc92f63d86c5ccdf76f43d13a34e47342932a26f9d0f51ae2314127 |
File details
Details for the file pymmcore_plus-0.8.1-py3-none-any.whl
.
File metadata
- Download URL: pymmcore_plus-0.8.1-py3-none-any.whl
- Upload date:
- Size: 94.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96d97f4110c540df6a2663a081146c4ccf5e9d3cdfa60e9f89c1d9bbfcd69ed8 |
|
MD5 | 0c5fc48bd5fe8cd96008308ed4b37c4b |
|
BLAKE2b-256 | 4620d01d1b3eb5d7ed3720c0cd8a079f625e01bb9202b163a8c0d064dc465c3f |