Python bindings for MMCore, Micro-Manager's device control layer
Project description
pymmcore: Python bindings for MMCore
The pymmcore package provides Python 3.x bindings to Micro-Manager's MMCore (the low-level device control/acquisition interface).
Using pymmcore, you can control and acquire images from all of the microscope devices supported by Micro-Manager, but without the GUI application or a Java runtime.
Not to be confused with pycro-manager, which allows control of the entire Java Micro-Manager application, including its Java APIs, and more.
You might also be interested in pymmcore-plus which wraps this library and provides extra functionality including an acquisition engine.
Note: pymmcore is similar to the legacy MMCorePy module (Python 2.x only),
previously distributed with the Micro-Manager application. However, the Python
package for pymmcore is named pymmcore
instead of MMCorePy
. This is in part
to avoid importing the wrong package on systems where pymmcore
(usually
installed via pip
) and MMCorePy
(installed with the Micro-Manager app or
built by the user) both exist.
Because pymmcore is distributed separately from Micro-Manager, it needs to be "pointed" at an existing Micro-Manager installation to access device adapters. (See the example below.)
Installing
Suports Python 3.9 or later and Windows, macOS, and Linux (all 64-bit).
pip install pymmcore
Or install via conda:
conda install -c conda-forge pymmcore
You also need a working installation of the Micro-Manager device adapters.
(for a convenient way to install that programmatically, see
the mmcore install
command in pymmcore plus)
Quick example
import pymmcore
import os.path
import os
mm_dir = "C:/Program Files/Micro-Manager-2.0.x"
mmc = pymmcore.CMMCore()
os.environ["PATH"] += os.pathsep.join(["", mm_dir]) # adviseable on Windows
mmc.setDeviceAdapterSearchPaths([mm_dir])
mmc.loadSystemConfiguration(os.path.join(mm_dir, "MMConfig_demo.cfg"))
mmc.snapImage()
mmc.getImage()
We do not currently have Python-specific documentation for MMCore, but the pymmcore-plus documentation includes the pymmcore.CMMCore class. There is also C++ documentation.
Matching Micro-Manager and pymmcore versions
The version number of pymmcore is independent of the Micro-Manager version number; instead it tracks the MMCore and device interface versions.
In order to use a given Micro-Manager installation, the device interface
version must match between pymmcore and the Micro-Manager device adapters
(mmgr_dal_*.dll
on Windows).
The device interface version of a given Micro-Manager installation can be viewed in Help > About Micro-Manager.
The device interface version of a given pymmcore version is the fourth part in the version number, and can also be viewed as follows:
import pymmcore
pymmcore.CMMCore().getAPIVersionInfo()
Note that getAPIVersionInfo()
should not be confused with getVersionInfo()
,
which returns the version number of MMCore. (The MMCore version is the first 3
parts of the pymmcore version.)
- For example, pymmcore
10.1.1.69.0
is based on MMCore10.1.1
and has device interface version69
. - The device interface version can change independently of the MMCore version, although it is less common for the device interface version to be incremented without a corresponding version change of MMCore.
- Older versions of pymmcore did not include the device interface version in their version number.
For a list of device interface versions for each pymmcore version, see the Releases page.
Loading device adapters on Windows
The majority of device adapters should load once
setDeviceAdapterSearchPaths()
has been called with the correct directories,
as in the above example. However, you may have trouble with device adapters
that in turn depend on external DLLs (typically equipment vendor libraries).
To fix this, first ensure that the Micro-Manager application can correctly load all the devices using the same configuration file. Then, use one of the following:
-
Temporarily change the current directory to the Micro-Manager installation when loading the configuration file (use
os.chdir()
). -
Add the Micro-Manager directory to the
PATH
environment variable.
The first method mimics how the Micro-Manager application works (it always run with the current directory set to the installation directory). However, the second method may be more robust in case the external DLLs in turn load additional DLLs at a later time.
Please report any cases where the Micro-Manager application can load a configuration but pymmcore cannot, even when using the above methods.
Code of Conduct
This project is covered by the Micro-Manager Code of Conduct.
License
The license for pymmcore itself is LGPL 2.1 (see LICENSE.txt
). The MMCore
component of Micro-Manager (which gets built into pymmcore) is also under the
same license. Other parts of Micro-Manager are under different licenses.
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 Distributions
File details
Details for the file pymmcore-11.1.1.71.3.tar.gz
.
File metadata
- Download URL: pymmcore-11.1.1.71.3.tar.gz
- Upload date:
- Size: 190.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e163bc4412d45e361405ecb80cd135be7648ae308b6dc579c0c7e12139227204 |
|
MD5 | 3d8638266604e0397d377e76aa7b4f11 |
|
BLAKE2b-256 | 28b562dd1859d013be8a6e415fe4c8dae6a9d8bc66e7619f1523eb36ff2d197e |
File details
Details for the file pymmcore-11.1.1.71.3-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 583.1 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 501eb729e16ef8fc9a9a00371086f039790f77d1ee8f909dcef6dadc42e0e426 |
|
MD5 | b24625a0d3cd0094c3b666b50b9409e7 |
|
BLAKE2b-256 | 8ccf1354c7a208fe4cc540b693bbcf0a25b6efa353e9446c8187593046309da0 |
File details
Details for the file pymmcore-11.1.1.71.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c284898eb41af0ecd320bf14c9d3f28de4a06615a4800983d8788b6c7bf2fe4e |
|
MD5 | 5dfe8b10a15cec719316faec69e4bbfb |
|
BLAKE2b-256 | 43883d36e49c5cb321591025a396e61290fb0615e08b86e92c1f33f34f92baef |
File details
Details for the file pymmcore-11.1.1.71.3-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 885.5 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b92eb362f6eb382e9267066f666aba91645b03962579f892efafe6ebd340d8a9 |
|
MD5 | 6dfe8b89b516adbc87a25703c8615ac5 |
|
BLAKE2b-256 | 8c6f5d2244424ee268bc8f281b58eb07a7f7124da483557af9f91d1f776a5b43 |
File details
Details for the file pymmcore-11.1.1.71.3-cp312-cp312-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp312-cp312-macosx_10_9_x86_64.whl
- Upload date:
- Size: 950.9 kB
- Tags: CPython 3.12, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ca03e6c1a15adb4500d3c2b9f5436f071a2d8f2d59e2bf1113bee8d2f927d48 |
|
MD5 | a0f14b7643d83ac0a4eb67314508823f |
|
BLAKE2b-256 | b0fbd5248648a641896ecf25124711d6bad1d1e5140f25b50005e115d202657c |
File details
Details for the file pymmcore-11.1.1.71.3-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 582.5 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dfdbe00e9c7d22a48f4e2cc03162bb359189f3934285c655d3351fe10af3506 |
|
MD5 | 04243ef5537c098a37081b895e3dc9fb |
|
BLAKE2b-256 | eee49e3960a27d3c68d33905c633976ccca99a44e00c80427fca1aaceb378dcb |
File details
Details for the file pymmcore-11.1.1.71.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87287f99b64053940b2f5189470769f91043915e642e7fef8897679b10b27b4b |
|
MD5 | 2222d323afbe5e6f3716e11030224d39 |
|
BLAKE2b-256 | 3c49e0decfd8495381fcae48b8ed315b69402e2aea2241d3276b745a37cd5077 |
File details
Details for the file pymmcore-11.1.1.71.3-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 882.3 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31d49684c8e9934f5ccf59f3e4f0119a21b45d5271cc39cdeaebad4fd1266bef |
|
MD5 | 011ed84880f31c186840721958f4188a |
|
BLAKE2b-256 | 6bece1f7f290540c50d745618510b2fdf261e7acd43836334d0c64b56045c90d |
File details
Details for the file pymmcore-11.1.1.71.3-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 945.6 kB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07587f497f4e2f3475bbc0d8715554f6118a5b586114a22941e8696687468e2f |
|
MD5 | e9d3f6c5f355c71a4c70cec140c50c9d |
|
BLAKE2b-256 | 82db3768693b215f6e52e8a28e5347fcefe20fd737b0d8f6533254dce42d3453 |
File details
Details for the file pymmcore-11.1.1.71.3-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 582.5 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd101428d768259892d6b2924c71418e1a86a35b6be75a8f0104a3e77ee1327b |
|
MD5 | 359a1fcf2c50326dd992c0b09eb30b2e |
|
BLAKE2b-256 | 55bf32d67999065b4840a976fdc5adcba3da62054ce2516c58f1ee33f6e75393 |
File details
Details for the file pymmcore-11.1.1.71.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c051ffe4b8e290e0d11f707c983557aaa8e6a7d506f292aebb38f4dd0831472b |
|
MD5 | 38a61b89ee7d77bb11ef51c7bac914e4 |
|
BLAKE2b-256 | 2005b549104eea850ce6e58140c5a900ad649ea23d1e17f968006e309d8b95d0 |
File details
Details for the file pymmcore-11.1.1.71.3-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 881.9 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d7b76a59f233c7c2303193456f3cd6fe34eaf90d44082105884381e5746ae81 |
|
MD5 | fb94c6c7b592a27f92de16316e66ec15 |
|
BLAKE2b-256 | f604c5dcebaafafed1f8c8bfa1659ed8d08488d1923caa829347276562c4fb6d |
File details
Details for the file pymmcore-11.1.1.71.3-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 945.6 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99fd7e068a0721fde517ebd0104d297100483f23134d6de62d29c2c96e3f9bc8 |
|
MD5 | 3f1e22406368afe0328d49708cbeafc0 |
|
BLAKE2b-256 | 46884a46e0366652433c676c9826e484d0dad703a5e64506ca7897a52c39b9a6 |
File details
Details for the file pymmcore-11.1.1.71.3-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 582.5 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdc057369e5350e92f08e62e63e10d1183cb4a718e9b88f3d06a9a5fabbf31f3 |
|
MD5 | 56a9fd09af02e025b6d10e12b3151d90 |
|
BLAKE2b-256 | caccd1a88f856d1758b2b428d316be354eabfe67d104d25b4ce6849885c768bc |
File details
Details for the file pymmcore-11.1.1.71.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4fc093579d0a93e4d7edcd93aaf7079c3a62d3c7e99ba01a97d6d77edf29bc3 |
|
MD5 | 7f5159898ca859e0860e1bae0c34e06d |
|
BLAKE2b-256 | b8a7892221311dbf8c971755a3ac91d18e8f295ad7850de62a8d5ee7d68bcd0d |
File details
Details for the file pymmcore-11.1.1.71.3-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 882.0 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a3b78c657021392fbdbec16245cf1d3629c97649aed1e4aa5ad1be7301c704a |
|
MD5 | 279c8f00cf5035f101e32be1be12a8f4 |
|
BLAKE2b-256 | d2eaa119caa4ee1b4d6092bcd08d7d9377883845db6b804a0dd25d613dd26186 |
File details
Details for the file pymmcore-11.1.1.71.3-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pymmcore-11.1.1.71.3-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 945.3 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bbe53d9c82677cc17829c71fea849e516e8bf1579f6022956bd0cade945d003 |
|
MD5 | 07cfdaa5233f05679f5d9e62cb563f32 |
|
BLAKE2b-256 | af070ee9ff1b089ca6966ce9428ee4eccaa37b705b337e8cee924e57935ab38d |