Constants¶
All of the constants in the pymmcore library are in the top level
pymmcore namespace, making it a bit difficult to know what type
or enumeration they refer to.
All of these constants are reimplemented in the pymmcore_plus library
as enums (enum.IntEnum or enum.StrEnum) and are available in the
pymmcore_plus namespace (and are listed below).
For example, the integer corresponding to the AfterLoadSequence action type
could be accessed as pymmcore.AfterLoadSequence or
pymmcore_plus.ActionType.AfterLoadSequence.
In [1]: import pymmcore
In [2]: pymmcore.AfterLoadSequence
Out[2]: 4
In [3]: from pymmcore_plus import ActionType
In [4]: ActionType.AfterLoadSequence
Out[4]: <ActionType.AfterLoadSequence: 4>
In [5]: int(ActionType.AfterLoadSequence)
Out[5]: 4
Additionally, it becomes easier to see what constants are available for each type or enumeration.
In [6]: list(ActionType)
Out[6]:
[
<ActionType.NoAction: 0>,
<ActionType.BeforeGet: 1>,
<ActionType.AfterSet: 2>,
<ActionType.IsSequenceable: 3>,
<ActionType.AfterLoadSequence: 4>,
<ActionType.StartSequence: 5>,
<ActionType.StopSequence: 6>
]
Lastly, many of the methods that return integers in pymmcore.CMMCore
have been re-implemented in pymmcore_plus.CMMCorePlus to return the
appropriate enumeration.
import pymmcore
core = pymmcore.CMMCore()
# ... load config and devices
core.getDeviceType("Camera") # 2
import pymmcore_plus
core = pymmcore_plus.CMMCorePlus()
# ... load config and devices
core.getDeviceType("Camera") # <DeviceType.CameraDevice: 2>
DeviceType
¶
Bases: IntEnum
Type of a Micro-Manager device.
UnknownType
¶
CameraDevice
¶
ShutterDevice
¶
StateDevice
¶
StageDevice
¶
XYStageDevice
¶
SerialDevice
¶
GenericDevice
¶
AutoFocusDevice
¶
CoreDevice
¶
ImageProcessorDevice
¶
SignalIODevice
¶
MagnifierDevice
¶
SLMDevice
¶
HubDevice
¶
GalvoDevice
¶
PressurePumpDevice
¶
VolumetricPumpDevice
¶
Camera
¶
Camera = CameraDevice
Shutter
¶
Shutter = ShutterDevice
State
¶
State = StateDevice
Stage
¶
Stage = StageDevice
XYStage
¶
XYStage = XYStageDevice
Serial
¶
Serial = SerialDevice
Generic
¶
Generic = GenericDevice
AutoFocus
¶
AutoFocus = AutoFocusDevice
Core
¶
Core = CoreDevice
ImageProcessor
¶
ImageProcessor = ImageProcessorDevice
SignalIO
¶
SignalIO = SignalIODevice
Magnifier
¶
Magnifier = MagnifierDevice
Galvo
¶
Galvo = GalvoDevice
PropertyType
¶
Bases: IntEnum
Type of a device property value.
Undef
¶
FocusDirection
¶
Bases: IntEnum
Direction a focus stage moves (towards or away from the sample).
DeviceDetectionStatus
¶
Bases: IntEnum
DeviceDetectionStatus from device discovery.
Unimplemented
¶
There is as yet no mechanism to programmatically detect the device.
Misconfigured
¶
Some information needed to communicate with the device is invalid.
CanNotCommunicate
¶
Communication attributes are valid, but the device does not respond.
CanCommunicate
¶
Communication verified, parameters have been set to valid values.
DeviceInitializationState
¶
Bases: IntEnum
DeviceInitializationState returned by getDeviceInitializationState.
PixelFormat
¶
Bases: StrEnum
Subset of GeniCam Pixel Format names used by pymmcore-plus.
(This is similar to PixelType, but follows GeniCam standards.)
See https://docs.baslerweb.com/pixel-format#unpacked-and-packed-pixel-formats for helpful clarifications. Note that unpacked pixel formats (like Mono8, Mono12, Mono16) are always 8-bit aligned. Meaning Mono12 is actually a 16-bit buffer.
Attributes:
| Name | Type | Description |
|---|---|---|
MONO8 |
str
|
8-bit (unpacked) monochrome pixel format. |
MONO10 |
str
|
10-bit (unpacked) monochrome pixel format. (16-bit buffer) |
MONO12 |
str
|
12-bit (unpacked) monochrome pixel format. (16-bit buffer) |
MONO14 |
str
|
14-bit (unpacked) monochrome pixel format. (16-bit buffer) |
MONO16 |
str
|
16-bit (unpacked) monochrome pixel format |
MONO32 |
str
|
32-bit (unpacked) monochrome pixel format |
RGB8 |
str
|
8-bit RGB pixel format. (24-bit buffer) |
RGB10 |
str
|
10-bit RGB pixel format. (48-bit buffer) |
RGB12 |
str
|
12-bit RGB pixel format. (48-bit buffer) |
RGB14 |
str
|
14-bit RGB pixel format. (48-bit buffer) |
RGB16 |
str
|
16-bit RGB pixel format. (48-bit buffer) |
Keyword
¶
Bases: StrEnum
Standard property and device names (the g_Keyword_* constants).