Package: pymmcore-plus
pymmcore-pluspymmcore-plusextendspymmcore(python bindings for the C++micro-manager
core) with a number of
features designed to facilitate working withMicro-manager in pure python/C
environments.pymmcore_plus.CMMCorePlusis a drop-in replacement subclass ofpymmcore.CMMCorethat provides a number of helpful overrides and additional
convenience functions beyond the standardCMMCore
API. SeeCMMCorePlus
documentationfor details.pymmcore-plusincludes anacquisition enginethat drives micro-manager for conventional multi-dimensional experiments. It accepts anMDASequencefromuseq-schemafor
experiment design/declaration.Adds acallback
systemthat adapts
the CMMCore callback object to an existing python event loop (such as Qt, or
perhaps asyncio/etc...). TheCMMCorePlusclass also fixes a number of
"missed" events that are not currently emitted by the CMMCore API.Documentationhttps://pymmcore-plus.github.io/pymmcore-plus/Why not just usepymmcoredirectly?pymmcoreis (and should probably
remain) a thin SWIG wrapper for the C++ code at the core of theMicro-Managerproject. It
is sufficient to control micromanager via python, but lacks some "niceties" that
python users are accustomed to. This library:extends thepymmcore.CMMCoreobject withadditional
methodsfixes emission of a number of events inMMCore.provide proper python interfaces for various objects likeConfigurationandMetadata.provides anobject-oriented
APIfor Devices
and their properties.uses more interpretableEnumsrather thanintforvarious
constantsimproves docstrings and type annotations.generally feel more pythonic (note however,camelCasemethod names from the
CMMCore API arenotsubstituted withsnake_case).How does this relate toPycro-Manager?Pycro-Manageris an impressive
library written by Henry Pinkard 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: whilePycro-Managerprovides a python API to control the Java
Micro-manager application (which in turn controls the C++ core),pymmcore-plusprovides a python API to control the C++ core directly, without the need for
Java in the loop.  Each has its own advantages and disadvantages!  With
pycro-manager you immediately get the entire existing micro-manager ecosystem
and GUI application. With pymmcore-plus you don't need to install Java, and you
have direct access to the memory buffers used by the C++ core, but the GUI
side of things is far less mature.QuickstartInstallfrom pippipinstallpymmcore-plus# or, add the [cli] extra if you wish to use the `mmcore` command line tool:pipinstall"pymmcore-plus[cli]"from condacondainstall-cconda-forgepymmcore-plusdev version from githubpipinstall'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 withpip install "pymmcore-plus[cli]", you can run:mmcoreinstall(you can also download these manually frommicro-manager.org)Seeinstallation documentationfor more details.UsageThen use the core object as you wouldpymmcore.CMMCore...
but withmore features:smile:frompymmcore_plusimportCMMCorePluscore=CMMCorePlus()...ExamplesSee a number ofusage examples in the
documentation.You can find some basic python scripts in theexamplesdirectory of
this repositoryContributingContributions are welcome! Seecontributing guide.