Skip to content

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.

AnyType

AnyType = pymmcore.AnyType

CameraDevice

CameraDevice = pymmcore.CameraDevice

ShutterDevice

ShutterDevice = pymmcore.ShutterDevice

StateDevice

StateDevice = pymmcore.StateDevice

StageDevice

StageDevice = pymmcore.StageDevice

XYStageDevice

XYStageDevice = pymmcore.XYStageDevice

SerialDevice

SerialDevice = pymmcore.SerialDevice

GenericDevice

GenericDevice = pymmcore.GenericDevice

AutoFocusDevice

AutoFocusDevice = pymmcore.AutoFocusDevice

CoreDevice

CoreDevice = pymmcore.CoreDevice

ImageProcessorDevice

ImageProcessorDevice = pymmcore.ImageProcessorDevice

SignalIODevice

SignalIODevice = pymmcore.SignalIODevice

MagnifierDevice

MagnifierDevice = pymmcore.MagnifierDevice

SLMDevice

SLMDevice = pymmcore.SLMDevice

HubDevice

HubDevice = pymmcore.HubDevice

GalvoDevice

GalvoDevice = pymmcore.GalvoDevice

PressurePumpDevice

PressurePumpDevice = pymmcore.PressurePumpDevice

VolumetricPumpDevice

VolumetricPumpDevice = pymmcore.VolumetricPumpDevice

Unknown

Unknown = UnknownType

PressurePump

PressurePump = PressurePumpDevice

VolumetricPump

VolumetricPump = VolumetricPumpDevice

ActionType

Bases: IntEnum

Action that triggered a device property handler.

NoAction

NoAction = pymmcore.NoAction

BeforeGet

BeforeGet = pymmcore.BeforeGet

AfterSet

AfterSet = pymmcore.AfterSet

IsSequenceable

IsSequenceable = pymmcore.IsSequenceable

AfterLoadSequence

AfterLoadSequence = pymmcore.AfterLoadSequence

StartSequence

StartSequence = pymmcore.StartSequence

StopSequence

StopSequence = pymmcore.StopSequence

PortType

Bases: IntEnum

Type of a port device (serial, USB, HID).

InvalidPort

InvalidPort = pymmcore.InvalidPort

SerialPort

SerialPort = pymmcore.SerialPort

USBPort

USBPort = pymmcore.USBPort

HIDPort

HIDPort = pymmcore.HIDPort

DeviceDetectionStatus

Bases: IntEnum

DeviceDetectionStatus from device discovery.

Unimplemented

Unimplemented = pymmcore.Unimplemented

There is as yet no mechanism to programmatically detect the device.

Misconfigured

Misconfigured = pymmcore.Misconfigured

Some information needed to communicate with the device is invalid.

CanNotCommunicate

CanNotCommunicate = pymmcore.CanNotCommunicate

Communication attributes are valid, but the device does not respond.

CanCommunicate

CanCommunicate = pymmcore.CanCommunicate

Communication verified, parameters have been set to valid values.

DeviceInitializationState

Bases: IntEnum

DeviceInitializationState returned by getDeviceInitializationState.

Uninitialized

Uninitialized = pymmcore.Uninitialized

InitializedSuccessfully

InitializedSuccessfully = pymmcore.InitializedSuccessfully

InitializationFailed

InitializationFailed = pymmcore.InitializationFailed

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)

MONO8

MONO8 = 'Mono8'

MONO10

MONO10 = 'Mono10'

MONO12

MONO12 = 'Mono12'

MONO14

MONO14 = 'Mono14'

MONO16

MONO16 = 'Mono16'

MONO32

MONO32 = 'Mono32'

RGB8

RGB8 = 'RGB8'

RGB10

RGB10 = 'RGB10'

RGB12

RGB12 = 'RGB12'

RGB14

RGB14 = 'RGB14'

RGB16

RGB16 = 'RGB16'

pick classmethod

pick(bit_depth: int, n_comp: int = 1) -> PixelFormat

for_current_camera classmethod

for_current_camera(core: CMMCore) -> PixelFormat

Keyword

Bases: StrEnum

Standard property and device names (the g_Keyword_* constants).

Name

Name = pymmcore.g_Keyword_Name

Description

Description = pymmcore.g_Keyword_Description

CameraName

CameraName = pymmcore.g_Keyword_CameraName

CameraChannelName

CameraChannelName = pymmcore.g_Keyword_CameraChannelName

CameraChannelIndex

CameraChannelIndex = pymmcore.g_Keyword_CameraChannelIndex

ActualExposure

ActualExposure = pymmcore.g_Keyword_ActualExposure

ActualInterval_ms

ActualInterval_ms = pymmcore.g_Keyword_ActualInterval_ms

Interval_ms

Interval_ms = pymmcore.g_Keyword_Interval_ms

Elapsed_Time_ms

Elapsed_Time_ms = pymmcore.g_Keyword_Elapsed_Time_ms

PixelType

PixelType = pymmcore.g_Keyword_PixelType

ReadoutTime

ReadoutTime = pymmcore.g_Keyword_ReadoutTime

ReadoutMode

ReadoutMode = pymmcore.g_Keyword_ReadoutMode

CCDTemperature

CCDTemperature = pymmcore.g_Keyword_CCDTemperature

CCDTemperatureSetPoint

CCDTemperatureSetPoint = pymmcore.g_Keyword_CCDTemperatureSetPoint

State

State = pymmcore.g_Keyword_State

Label

Label = pymmcore.g_Keyword_Label

Position

Position = pymmcore.g_Keyword_Position

Type

Type = pymmcore.g_Keyword_Type

Delay

Delay = pymmcore.g_Keyword_Delay

BaudRate

BaudRate = pymmcore.g_Keyword_BaudRate

DataBits

DataBits = pymmcore.g_Keyword_DataBits

StopBits

StopBits = pymmcore.g_Keyword_StopBits

Parity

Parity = pymmcore.g_Keyword_Parity

Handshaking

Handshaking = pymmcore.g_Keyword_Handshaking

DelayBetweenCharsMs

DelayBetweenCharsMs = pymmcore.g_Keyword_DelayBetweenCharsMs

Port

Port = pymmcore.g_Keyword_Port

AnswerTimeout

AnswerTimeout = pymmcore.g_Keyword_AnswerTimeout

Speed

Speed = pymmcore.g_Keyword_Speed

CoreDevice

CoreDevice = pymmcore.g_Keyword_CoreDevice

CoreInitialize

CoreInitialize = pymmcore.g_Keyword_CoreInitialize

CoreCamera

CoreCamera = pymmcore.g_Keyword_CoreCamera

CoreShutter

CoreShutter = pymmcore.g_Keyword_CoreShutter

CoreXYStage

CoreXYStage = pymmcore.g_Keyword_CoreXYStage

CoreFocus

CoreFocus = pymmcore.g_Keyword_CoreFocus

CoreAutoFocus

CoreAutoFocus = pymmcore.g_Keyword_CoreAutoFocus

CoreAutoShutter

CoreAutoShutter = pymmcore.g_Keyword_CoreAutoShutter

CoreChannelGroup

CoreChannelGroup = pymmcore.g_Keyword_CoreChannelGroup

CoreImageProcessor

CoreImageProcessor = pymmcore.g_Keyword_CoreImageProcessor

CoreSLM

CoreSLM = pymmcore.g_Keyword_CoreSLM

CoreGalvo

CoreGalvo = pymmcore.g_Keyword_CoreGalvo

CoreTimeoutMs

CoreTimeoutMs = pymmcore.g_Keyword_CoreTimeoutMs

Channel

Channel = pymmcore.g_Keyword_Channel

Version

Version = pymmcore.g_Keyword_Version

ColorMode

ColorMode = pymmcore.g_Keyword_ColorMode

Transpose_SwapXY

Transpose_SwapXY = pymmcore.g_Keyword_Transpose_SwapXY

Transpose_MirrorX

Transpose_MirrorX = pymmcore.g_Keyword_Transpose_MirrorX

Transpose_MirrorY

Transpose_MirrorY = pymmcore.g_Keyword_Transpose_MirrorY

Transpose_Correction

Transpose_Correction = pymmcore.g_Keyword_Transpose_Correction

Closed_Position

Closed_Position = pymmcore.g_Keyword_Closed_Position

HubID

HubID = pymmcore.g_Keyword_HubID

Metadata_CameraLabel

Metadata_CameraLabel = pymmcore.g_Keyword_Metadata_CameraLabel

Metadata_Exposure

Metadata_Exposure = pymmcore.g_Keyword_Metadata_Exposure

Metadata_Height

Metadata_Height = pymmcore.g_Keyword_Metadata_Height

Metadata_ImageNumber

Metadata_ImageNumber = pymmcore.g_Keyword_Metadata_ImageNumber

Metadata_ROI_X

Metadata_ROI_X = pymmcore.g_Keyword_Metadata_ROI_X

Metadata_ROI_Y

Metadata_ROI_Y = pymmcore.g_Keyword_Metadata_ROI_Y

Metadata_Score

Metadata_Score = pymmcore.g_Keyword_Metadata_Score

Metadata_TimeInCore

Metadata_TimeInCore = pymmcore.g_Keyword_Metadata_TimeInCore

Metadata_Width

Metadata_Width = pymmcore.g_Keyword_Metadata_Width

CFGCommand

Bases: StrEnum

Commands used in Micro-Manager configuration (.cfg) files.

Device

Device = pymmcore.g_CFGCommand_Device

Label

Label = pymmcore.g_CFGCommand_Label

Property

Property = pymmcore.g_CFGCommand_Property

Configuration

Configuration = pymmcore.g_CFGCommand_Configuration

ConfigGroup

ConfigGroup = pymmcore.g_CFGCommand_ConfigGroup

Equipment

Equipment = pymmcore.g_CFGCommand_Equipment

Delay

Delay = pymmcore.g_CFGCommand_Delay

ImageSynchro

ImageSynchro = pymmcore.g_CFGCommand_ImageSynchro

ConfigPixelSize

ConfigPixelSize = pymmcore.g_CFGCommand_ConfigPixelSize

PixelSize_um

PixelSize_um = pymmcore.g_CFGCommand_PixelSize_um

PixelSizeAffine

PixelSizeAffine = pymmcore.g_CFGCommand_PixelSizeAffine

ParentID

ParentID = pymmcore.g_CFGCommand_ParentID

FocusDirection

FocusDirection = pymmcore.g_CFGCommand_FocusDirection

PixelSize_dxdz

PixelSize_dxdz = pymmcore.g_CFGCommand_PixelSizedxdz

PixelSize_dydz

PixelSize_dydz = pymmcore.g_CFGCommand_PixelSizedydz

PixelSize_OptimalZUm

PixelSize_OptimalZUm = pymmcore.g_CFGCommand_PixelSizeOptimalZUm

FieldDelimiters

FieldDelimiters = pymmcore.g_FieldDelimiters

CFGGroup

Bases: StrEnum

Names of built-in config groups and presets (System, Startup, etc...).

System

System = pymmcore.g_CFGGroup_System

System_Startup

System_Startup = pymmcore.g_CFGGroup_System_Startup

System_Shutdown

System_Shutdown = pymmcore.g_CFGGroup_System_Shutdown

PixelSizeUm

PixelSizeUm = pymmcore.g_CFGGroup_PixelSizeUm