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 reimplemened in the pymmcore_plus library as enum.IntEnum and are available in the pymmcore_plus namespace.

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>

PIXEL_FORMATS: dict[int, dict[int, PixelFormat]] = {1: {8: PixelFormat.MONO8, 10: PixelFormat.MONO10, 12: PixelFormat.MONO12, 14: PixelFormat.MONO14, 16: PixelFormat.MONO16, 32: PixelFormat.MONO32}, 3: {8: PixelFormat.RGB8, 10: PixelFormat.RGB10, 12: PixelFormat.RGB12, 14: PixelFormat.RGB14, 16: PixelFormat.RGB16}} module-attribute #

ActionType #

AfterLoadSequence = pymmcore.AfterLoadSequence class-attribute #

AfterSet = pymmcore.AfterSet class-attribute #

BeforeGet = pymmcore.BeforeGet class-attribute #

IsSequenceable = pymmcore.IsSequenceable class-attribute #

NoAction = pymmcore.NoAction class-attribute #

StartSequence = pymmcore.StartSequence class-attribute #

StopSequence = pymmcore.StopSequence class-attribute #

CFGCommand #

ConfigGroup = pymmcore.g_CFGCommand_ConfigGroup class-attribute #

ConfigPixelSize = pymmcore.g_CFGCommand_ConfigPixelSize class-attribute #

Configuration = pymmcore.g_CFGCommand_Configuration class-attribute #

Delay = pymmcore.g_CFGCommand_Delay class-attribute #

Device = pymmcore.g_CFGCommand_Device class-attribute #

Equipment = pymmcore.g_CFGCommand_Equipment class-attribute #

FieldDelimiters = pymmcore.g_FieldDelimiters class-attribute #

FocusDirection = pymmcore.g_CFGCommand_FocusDirection class-attribute #

ImageSynchro = pymmcore.g_CFGCommand_ImageSynchro class-attribute #

Label = pymmcore.g_CFGCommand_Label class-attribute #

ParentID = pymmcore.g_CFGCommand_ParentID class-attribute #

PixelSizeAffine = pymmcore.g_CFGCommand_PixelSizeAffine class-attribute #

PixelSize_um = pymmcore.g_CFGCommand_PixelSize_um class-attribute #

Property = pymmcore.g_CFGCommand_Property class-attribute #

CFGGroup #

PixelSizeUm = pymmcore.g_CFGGroup_PixelSizeUm class-attribute #

System = pymmcore.g_CFGGroup_System class-attribute #

System_Shutdown = pymmcore.g_CFGGroup_System_Shutdown class-attribute #

System_Startup = pymmcore.g_CFGGroup_System_Startup class-attribute #

DeviceDetectionStatus #

DeviceDetectionStatus from device discovery.

CanCommunicate = pymmcore.CanCommunicate class-attribute #

Communication verified, parameters have been set to valid values.

CanNotCommunicate = pymmcore.CanNotCommunicate class-attribute #

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

Misconfigured = pymmcore.Misconfigured class-attribute #

Some information needed to communicate with the device is invalid.

Unimplemented = pymmcore.Unimplemented class-attribute #

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

DeviceInitializationState #

DeviceInitializationState returned by getDeviceInitializationState.

InitializationFailed = pymmcore.InitializationFailed class-attribute #

InitializedSuccessfully = pymmcore.InitializedSuccessfully class-attribute #

Uninitialized = pymmcore.Uninitialized class-attribute #

DeviceNotification #

Attention = pymmcore.Attention class-attribute #

Done = pymmcore.Done class-attribute #

StatusChanged = pymmcore.StatusChanged class-attribute #

DeviceType #

Any = AnyType class-attribute #

AnyType = pymmcore.AnyType class-attribute #

AutoFocus = AutoFocusDevice class-attribute #

AutoFocusDevice = pymmcore.AutoFocusDevice class-attribute #

Camera = CameraDevice class-attribute #

CameraDevice = pymmcore.CameraDevice class-attribute #

Core = CoreDevice class-attribute #

CoreDevice = pymmcore.CoreDevice class-attribute #

Galvo = GalvoDevice class-attribute #

GalvoDevice = pymmcore.GalvoDevice class-attribute #

Generic = GenericDevice class-attribute #

GenericDevice = pymmcore.GenericDevice class-attribute #

Hub = HubDevice class-attribute #

HubDevice = pymmcore.HubDevice class-attribute #

ImageProcessor = ImageProcessorDevice class-attribute #

ImageProcessorDevice = pymmcore.ImageProcessorDevice class-attribute #

Magnifier = MagnifierDevice class-attribute #

MagnifierDevice = pymmcore.MagnifierDevice class-attribute #

SLM = SLMDevice class-attribute #

SLMDevice = pymmcore.SLMDevice class-attribute #

Serial = SerialDevice class-attribute #

SerialDevice = pymmcore.SerialDevice class-attribute #

Shutter = ShutterDevice class-attribute #

ShutterDevice = pymmcore.ShutterDevice class-attribute #

SignalIO = SignalIODevice class-attribute #

SignalIODevice = pymmcore.SignalIODevice class-attribute #

Stage = StageDevice class-attribute #

StageDevice = pymmcore.StageDevice class-attribute #

State = StateDevice class-attribute #

StateDevice = pymmcore.StateDevice class-attribute #

Unknown = UnknownType class-attribute #

UnknownType = pymmcore.UnknownType class-attribute #

XYStage = XYStageDevice class-attribute #

XYStageDevice = pymmcore.XYStageDevice class-attribute #

FocusDirection #

AwayFromSample = pymmcore.FocusDirectionAwayFromSample class-attribute #

FocusDirectionAwayFromSample = AwayFromSample class-attribute #

FocusDirectionTowardSample = TowardSample class-attribute #

FocusDirectionUnknown = Unknown class-attribute #

TowardSample = pymmcore.FocusDirectionTowardSample class-attribute #

Unknown = pymmcore.FocusDirectionUnknown class-attribute #

Keyword #

ActualExposure = pymmcore.g_Keyword_ActualExposure class-attribute #

ActualInterval_ms = pymmcore.g_Keyword_ActualInterval_ms class-attribute #

AnswerTimeout = pymmcore.g_Keyword_AnswerTimeout class-attribute #

BaudRate = pymmcore.g_Keyword_BaudRate class-attribute #

Binning = pymmcore.g_Keyword_Binning class-attribute #

CCDTemperature = pymmcore.g_Keyword_CCDTemperature class-attribute #

CCDTemperatureSetPoint = pymmcore.g_Keyword_CCDTemperatureSetPoint class-attribute #

CameraChannelIndex = pymmcore.g_Keyword_CameraChannelIndex class-attribute #

CameraChannelName = pymmcore.g_Keyword_CameraChannelName class-attribute #

CameraID = pymmcore.g_Keyword_CameraID class-attribute #

CameraName = pymmcore.g_Keyword_CameraName class-attribute #

Channel = pymmcore.g_Keyword_Channel class-attribute #

Closed_Position = pymmcore.g_Keyword_Closed_Position class-attribute #

ColorMode = pymmcore.g_Keyword_ColorMode class-attribute #

CoreAutoFocus = pymmcore.g_Keyword_CoreAutoFocus class-attribute #

CoreAutoShutter = pymmcore.g_Keyword_CoreAutoShutter class-attribute #

CoreCamera = pymmcore.g_Keyword_CoreCamera class-attribute #

CoreChannelGroup = pymmcore.g_Keyword_CoreChannelGroup class-attribute #

CoreDevice = pymmcore.g_Keyword_CoreDevice class-attribute #

CoreFocus = pymmcore.g_Keyword_CoreFocus class-attribute #

CoreGalvo = pymmcore.g_Keyword_CoreGalvo class-attribute #

CoreImageProcessor = pymmcore.g_Keyword_CoreImageProcessor class-attribute #

CoreInitialize = pymmcore.g_Keyword_CoreInitialize class-attribute #

CoreSLM = pymmcore.g_Keyword_CoreSLM class-attribute #

CoreShutter = pymmcore.g_Keyword_CoreShutter class-attribute #

CoreTimeoutMs = pymmcore.g_Keyword_CoreTimeoutMs class-attribute #

CoreXYStage = pymmcore.g_Keyword_CoreXYStage class-attribute #

DataBits = pymmcore.g_Keyword_DataBits class-attribute #

Delay = pymmcore.g_Keyword_Delay class-attribute #

DelayBetweenCharsMs = pymmcore.g_Keyword_DelayBetweenCharsMs class-attribute #

Description = pymmcore.g_Keyword_Description class-attribute #

EMGain = pymmcore.g_Keyword_EMGain class-attribute #

Elapsed_Time_ms = pymmcore.g_Keyword_Elapsed_Time_ms class-attribute #

Exposure = pymmcore.g_Keyword_Exposure class-attribute #

Gain = pymmcore.g_Keyword_Gain class-attribute #

Handshaking = pymmcore.g_Keyword_Handshaking class-attribute #

HubID = pymmcore.g_Keyword_HubID class-attribute #

Interval_ms = pymmcore.g_Keyword_Interval_ms class-attribute #

Label = pymmcore.g_Keyword_Label class-attribute #

Meatdata_Exposure = pymmcore.g_Keyword_Meatdata_Exposure class-attribute #

Metadata_ImageNumber = pymmcore.g_Keyword_Metadata_ImageNumber class-attribute #

Metadata_ROI_X = pymmcore.g_Keyword_Metadata_ROI_X class-attribute #

Metadata_ROI_Y = pymmcore.g_Keyword_Metadata_ROI_Y class-attribute #

Metadata_Score = pymmcore.g_Keyword_Metadata_Score class-attribute #

Metadata_TimeInCore = pymmcore.g_Keyword_Metadata_TimeInCore class-attribute #

Name = pymmcore.g_Keyword_Name class-attribute #

Offset = pymmcore.g_Keyword_Offset class-attribute #

Parity = pymmcore.g_Keyword_Parity class-attribute #

PixelType = pymmcore.g_Keyword_PixelType class-attribute #

Port = pymmcore.g_Keyword_Port class-attribute #

Position = pymmcore.g_Keyword_Position class-attribute #

ReadoutMode = pymmcore.g_Keyword_ReadoutMode class-attribute #

ReadoutTime = pymmcore.g_Keyword_ReadoutTime class-attribute #

Speed = pymmcore.g_Keyword_Speed class-attribute #

State = pymmcore.g_Keyword_State class-attribute #

StopBits = pymmcore.g_Keyword_StopBits class-attribute #

Transpose_Correction = pymmcore.g_Keyword_Transpose_Correction class-attribute #

Transpose_MirrorX = pymmcore.g_Keyword_Transpose_MirrorX class-attribute #

Transpose_MirrorY = pymmcore.g_Keyword_Transpose_MirrorY class-attribute #

Transpose_SwapXY = pymmcore.g_Keyword_Transpose_SwapXY class-attribute #

Type = pymmcore.g_Keyword_Type class-attribute #

Version = pymmcore.g_Keyword_Version class-attribute #

PixelFormat #

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)

MONO10 = 'Mono10' class-attribute #

MONO12 = 'Mono12' class-attribute #

MONO14 = 'Mono14' class-attribute #

MONO16 = 'Mono16' class-attribute #

MONO32 = 'Mono32' class-attribute #

MONO8 = 'Mono8' class-attribute #

RGB10 = 'RGB10' class-attribute #

RGB12 = 'RGB12' class-attribute #

RGB14 = 'RGB14' class-attribute #

RGB16 = 'RGB16' class-attribute #

RGB8 = 'RGB8' class-attribute #

for_current_camera(core: pymmcore.CMMCore) -> PixelFormat classmethod #

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

PixelType #

These are pixel types, as used in MMStudio and MMCoreJ wrapper.

They are only here for supporting the legacy (and probably to-be-deprecated) taggedImages.

GRAY16 = 'GRAY16' class-attribute #

GRAY32 = 'GRAY32' class-attribute #

GRAY8 = 'GRAY8' class-attribute #

RGB32 = 'RGB32' class-attribute #

RGB64 = 'RGB64' class-attribute #

UNKNOWN = '' class-attribute #

for_bytes(depth: int, n_comp: int = 1) -> PixelType classmethod #

to_pixel_format() -> PixelFormat #

PortType #

HIDPort = pymmcore.HIDPort class-attribute #

InvalidPort = pymmcore.InvalidPort class-attribute #

SerialPort = pymmcore.SerialPort class-attribute #

USBPort = pymmcore.USBPort class-attribute #

PropertyType #

Float = pymmcore.Float class-attribute #

Integer = pymmcore.Integer class-attribute #

String = pymmcore.String class-attribute #

Undef = pymmcore.Undef class-attribute #

to_json() -> str #

to_python() -> type | None #