CMMCorePlus
¶
Bases: CMMCore
Wrapper for CMMCore with extended functionality.
CMMCorePlus is a subclass of pymmcore.CMMCore with additional functionality,
and some overrides for the sake of convenience or fixed behavior. It aims to be
a drop-in replacement. Most methods behave as they do in CMMCore, but many
return enums or Configuration objects instead of
plain integers and SWIG objects, and many setters emit
events even when the device adapter
doesn't. Additions include an acquisition engine
(run_mda) and object-oriented views onto
devices, properties and config groups (e.g.
getDeviceObject).
(registerCallback is disallowed; use events instead.)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm_path
|
str | None
|
Path to the Micro-Manager installation. If |
None
|
adapter_paths
|
Sequence[str]
|
Paths to search for device adapters, by default () |
()
|
-
API Reference
- pymmcore-plus
-
pymmcore-widgets
pymmcore_widgets-
CameraRoiWidget
API
CameraRoiWidget -
ChannelGroupWidget
API
ChannelGroupWidget -
ChannelWidget
API
ChannelWidget -
ConfigurationWidget
API
ConfigurationWidget -
CoreLogWidget
API
CoreLogWidget -
DefaultCameraExposureWidget
API
DefaultCameraExposureWidget -
HCSWizard
API
HCSWizard -
ImagePreview
API
ImagePreview -
LiveButton
API
LiveButton -
MDAWidget
API
MDAWidget -
ObjectivesPixelConfigurationWidget
API
ObjectivesPixelConfigurationWidget -
ObjectivesWidget
API
ObjectivesWidget -
PixelConfigurationWidget
API
PixelConfigurationWidget -
PresetsWidget
API
PresetsWidget -
PropertyBrowser
API
PropertyBrowser -
SnapButton
API
SnapButton -
StageExplorer
API
StageExplorer -
StageWidget
API
StageWidget
-
CameraRoiWidget
API
- Contributing How These Docs Work Who owns what
- Getting Started
-
User Guide
- Advanced Topics UniMMCore A unified controller of C++ and pure-Python devices
- Applications
- Controlling Hardware
- Running Acquisitions The Acquisition Engine Running a very simple sequence
- Troubleshooting
- Widget Gallery
-
API Reference
-
pymmcore-gui
pymmcore_gui -
pymmcore-plus
pymmcore_plus -
pymmcore-widgets
pymmcore_widgets-
config_presets ClassesConfigPresetsTablecreate_from_core -
device_properties ClassesDevicePropertyTable -
experimental ClassesStackViewer -
hcwizard -
CameraRoiWidget
API
CameraRoiWidget -
ChannelGroupWidget
API
ChannelGroupWidget -
ChannelWidget
API
ChannelWidget - ConfigGroupsEditor API
-
ConfigGroupsTree
API
create_from_core -
ConfigWizard
API
ConfigWizard -
ConfigurationWidget
API
ConfigurationWidget -
CoreLogWidget
API
CoreLogWidget -
DefaultCameraExposureWidget
API
DefaultCameraExposureWidget -
ExposureWidget
API
ExposureWidget -
GroupPresetTableWidget
API
GroupPresetTableWidget -
HCSWizard
API
HCSWizard -
ImagePreview
API
ImagePreview -
LiveButton
API
LiveButton -
MDAWidget
API
MDAWidget -
ObjectivesPixelConfigurationWidget
API
ObjectivesPixelConfigurationWidget -
ObjectivesWidget
API
ObjectivesWidget -
PixelConfigurationWidget
API
PixelConfigurationWidget -
PresetsWidget
API
PresetsWidget -
PropertyBrowser
API
PropertyBrowser -
PropertyWidget
API
PropertyWidget -
ShuttersWidget
API
ShuttersWidget -
SnapButton
API
SnapButton -
StageExplorer
API
StageExplorer -
StageWidget
API
StageWidget
-
-
pymmcore-gui
Method summary¶
The table below lists all of the methods of CMMCorePlus, including the ones it
inherits unchanged from
pymmcore.CMMCore. Use the filters
to show only what pymmcore-plus adds or overrides (each override says why it was
changed). Deprecated methods are hidden unless you tick "show deprecated".
✨ added by pymmcore-plus ·
➕ overridden ·
no icon: inherited unchanged from pymmcore.CMMCore
| Method | Origin | Category | Description |
|---|---|---|---|
addGalvoPolygonVertex(galvoLabel, polygonIndex, x, y) | Galvos | Add a vertex to a galvo polygon. | |
canSequenceEvents(e1, e2, cur_length) | ✨ | Hardware sequencing | Check whether two useq.MDAEvent are sequenceable by this core instance. |
channelGroup_pattern | ✨ | Config groups & presets | The regex pattern used to identify channel groups. |
clearCircularBuffer() | Images & buffer | Removes all images from the circular buffer. | |
clearROI() | Cameras | Set the region of interest of the current camera to the full frame. | |
debugLogEnabled() | Logging & errors | Indicates if logging of debug messages is enabled | |
defineConfig(groupName, configName, deviceLabel, propName, value) (2 overloads) | âž• | Config groups & presets | Defines a configuration. Why override? To emit a configDefined event. Also, if groupName is not a defined group, then defineConfigGroup(groupName) is called. |
defineConfigGroup(groupName) | Config groups & presets | Creates an empty configuration group. | |
definePixelSizeConfig(resolutionID) (2 overloads) | âž• | Pixel size | Defines an empty pixel size entry. Why override? To emit a pixelSizeChanged event. |
defineStateLabel(stateDeviceLabel, state, stateLabel) | State devices | Defines a label for the specific state. | |
deleteConfig(groupName, configName, deviceLabel, propName) (2 overloads) | âž• | Config groups & presets | Delete configName from groupName.Why override? To emit a configDeleted event. |
deleteConfigGroup(groupName) | âž• | Config groups & presets | Deletes an entire configuration group.Why override? To emit a configGroupDeleted event. |
deleteGalvoPolygons(galvoLabel) | Galvos | Remove all added polygons | |
deletePixelSizeConfig(resolutionID) | âž• | Pixel size | Delete the pixel size configuration for the given resolutionID.Why override? To emit a pixelSizeChanged event. |
describe(sort, show_config_groups, show_available) | ✨ | General | Print information table with the current configuration. |
detectDevice(deviceLabel) | âž• | Devices | Tries to communicate to a device through a given serial port. Why override? The returned pymmcore_plus.DeviceDetectionStatus enum is more interpretable than the raw int returned by pymmcore |
deviceBusy(label) | Devices | Checks the busy status of the specific device. | |
deviceTypeBusy(devType) | Devices | Checks the busy status for all devices of the specific type. | |
displaySLMImage(slmLabel) | SLMs | Display the waiting image on the SLM. | |
enableContinuousFocus(enable) | Autofocus | Enables or disables the operation of the continuous focusing hardware device. | |
enableDebugLog(enable) | Logging & errors | Enable or disable logging of debug messages. | |
enableFeature(name, enable) | Logging & errors | Enable or disable the given Core feature. | |
enableStderrLog(enable) | Logging & errors | Enables or disables log message display on the standard console. | |
events | ✨ | Acquisition engine & events | Signaler for core events. |
fixImage(img, ncomponents) | ✨ | Images & buffer | Fix img shape/dtype based on self.getNumberOfComponents(). |
fullFocus() | Autofocus | Performs focus acquisition and lock for the one-shot focusing device. | |
getAdapterObject(library_name) | ✨ | Devices | Return an Adapter object bound to library_name on this core. |
getAllowedBinningValues() (2 overloads) | Cameras | Returns allowed binning values for the current camera. | |
getAllowedPropertyValues(label, propName) | Properties | Returns all valid values for the specified property. | |
getAPIVersionInfo() | General | Returns the module and device interface versions. | |
getAutoFocusDevice() | Autofocus | Returns the label of the currently selected auto-focus device. | |
getAutoFocusOffset() | âž• | Autofocus | Return the current offset of the one-shot focusing device. Why override? For known autofocus devices with a separate offset device (see setAutoFocusOffset), this returns the position of that offset device. |
getAutoShutter() | Shutters | Returns the current setting of the auto-shutter option. | |
getAvailableConfigGroups() | Config groups & presets | Returns the names of all defined configuration groups | |
getAvailableConfigs(configGroup) | Config groups & presets | Returns all defined configuration (preset) names in a given group | |
getAvailableDeviceDescriptions(library) | Devices | Get descriptions for available devices from the specified library. | |
getAvailableDevices(library) | Devices | Get available devices from the specified device library. | |
getAvailableDeviceTypes(library) | Devices | Get type information for available devices from the specified library. | |
getAvailablePixelSizeConfigs() | Pixel size | Returns all defined resolution preset names | |
getBinning() (2 overloads) | Cameras | Returns the current binning factor of the camera. | |
getBufferFreeCapacity() | Images & buffer | Returns the number of images that can be added to the buffer without overflowing. | |
getBufferTotalCapacity() | Images & buffer | Returns the total number of images that can be stored in the buffer | |
getBytesPerPixel() | Cameras | How many bytes for each pixel. | |
getCameraChannelName(channelNr) | Cameras | Returns the name of the requested channel as known by the default camera | |
getCameraChannelNames() | ✨ | Cameras | Convenience method to call getCameraChannelName for all camera channels. |
getCameraDevice() | Cameras | Returns the label of the currently selected camera device. | |
getChannelGroup() | Config groups & presets | Returns the group determining the channel selection. | |
getCircularBufferMemoryFootprint() | Images & buffer | Returns the size of the Circular Buffer in MB | |
getConfigData(configGroup, configName, native) (2 overloads) | âž• | Config groups & presets | Return the configuration object for a given configGroup and configName.Why override? The pymmcore_plus.Configuration object returned when native=False (the default) provides a nicer Mapping interface. Pass native=True to get the original pymmcore.Configuration object. |
getConfigGroupObject(group_name, allow_missing) | ✨ | Config groups & presets | Return a ConfigGroup object bound to group_name on this core. |
getConfigGroupState(group, native) (2 overloads) | âž• | Config groups & presets | Return the state of the devices included in the specified group.Why override? The pymmcore_plus.Configuration object returned when native=False (the default) provides a nicer Mapping interface. Pass native=True to get the original pymmcore.Configuration object. |
getConfigGroupStateFromCache(group, native) (2 overloads) | âž• | Config groups & presets | Return the state of the system cache, for the devices in the specified group. Why override? The pymmcore_plus.Configuration object returned when native=False (the default) provides a nicer Mapping interface. Pass native=True to get the original pymmcore.Configuration object. |
getConfigState(group, config, native) | âž• | Config groups & presets | Return state of devices included in the specified configuration. Why override? The pymmcore_plus.Configuration object returned when native=False (the default) provides a nicer Mapping interface. Pass native=True to get the original pymmcore.Configuration object. |
getCoreErrorText(code) | Logging & errors | Returns a pre-defined error test with the given error code | |
getCurrentConfig(groupName) | Config groups & presets | Returns the current configuration (preset) for a given group. | |
getCurrentConfigFromCache(groupName) | Config groups & presets | Returns the configuration for a given group based on the data in the cache. | |
getCurrentDeviceOfType(device_type) | ✨ | Devices | Return the current device of type device_type. |
getCurrentFocusScore() | Autofocus | Returns the focus score from the default focusing device measured at the current Z position. | |
getCurrentPixelSizeConfig() (2 overloads) | Pixel size | Get the current pixel configuration name | |
getDeviceAdapterNames() | Devices | Return the names of discoverable device adapters. | |
getDeviceAdapterSearchPaths() | Devices | Return the current device adapter search paths. | |
getDeviceDelayMs(label) | Devices | Reports action delay in milliseconds for the specific device. | |
getDeviceDescription(label) | Devices | Returns description text for a given device label. "Description" is determined by the library and is immutable. | |
getDeviceInitializationState(label) | âž• | Devices | Queries the initialization state of the given device. Why override? The returned pymmcore_plus.DeviceInitializationState enum is more interpretable than the raw int returned by pymmcore |
getDeviceLibrary(label) | Devices | Returns device library (aka module, device adapter) name. | |
getDeviceName(label) | Devices | Returns device name for a given device label. | |
getDeviceObject(device_label, device_type) (17 overloads) | ✨ | Devices | Return a Device object bound to device_label on this core. |
getDevicePropertyNames(label) | Properties | Returns all property names supported by the device. | |
getDeviceSchema(device_label) | ✨ | Devices | Return JSON-schema describing device device_label and its properties. |
getDeviceTimeoutMs(label) | Devices | Returns the per-device timeout in milliseconds, or the default if not set. | |
getDeviceType(label) | âž• | Devices | Return device type for a given device. Why override? The returned pymmcore_plus.DeviceType enum is more interpretable than the raw int returned by pymmcore |
getExposure() (2 overloads) | Cameras | Returns the current exposure setting of the camera in milliseconds. | |
getExposureSequenceMaxLength(cameraLabel) | Hardware sequencing | Gets the maximum length of a camera's exposure sequence. | |
getFocusDevice() | Stages | Returns the label of the currently selected focus device. | |
getFocusDirection(stageLabel) | âž• | Stages | Return the focus direction of a stage. Why override? The returned pymmcore_plus.FocusDirection enum is more interpretable than the raw int returned by pymmcore |
getGalvoChannel(galvoLabel) | Galvos | Get the name of the active galvo channel (for a multi-laser galvo device). | |
getGalvoDevice() | Galvos | Returns the label of the currently selected Galvo device. | |
getGalvoPosition(galvoDevice) (2 overloads) | Galvos | Get x,y position of the galvo device. | |
getGalvoXMinimum(galvoLabel) | Galvos | Get the Galvo x minimum | |
getGalvoXRange(galvoLabel) | Galvos | Get the Galvo x range | |
getGalvoYMinimum(galvoLabel) | Galvos | Get the Galvo y minimum | |
getGalvoYRange(galvoLabel) | Galvos | Get the Galvo y range | |
getImage(numChannel, fix) (2 overloads) | âž• | Images & buffer | Return the internal image buffer. Why override? To fix the shape of images with n_components > 1 (like RGB images) |
getImageBitDepth() | Images & buffer | How many bits of dynamic range are to be expected from the camera. | |
getImageBufferSize() | Images & buffer | Returns the size of the internal image buffer. | |
getImageHeight() | Images & buffer | Vertical dimension of the image buffer in pixels. | |
getImageProcessorDevice() | Cameras | Returns the label of the currently selected image processor device. | |
getImageWidth() | Images & buffer | Horizontal dimension of the image buffer in pixels. | |
getInstalledDeviceDescription(hubLabel, peripheralLabel) | Devices | Returns description from the specified peripheral on hubLabel device. | |
getInstalledDevices(hubLabel) | Devices | Performs auto-detection and loading of child devices that are attached to a Hub device. | |
getLastFocusScore() | Autofocus | Returns the latest focus score from the focusing device. | |
getLastImage() | Images & buffer | Gets the last image from the circular buffer. | |
getLastImageAndMD(channel, slice, fix) (2 overloads) | ✨ | Images & buffer | Return last image from the circular buffer along with metadata. |
getLastImageMD(channel, slice, md) (2 overloads) | Images & buffer | Returns a pointer to the pixels of the image that was last inserted into the circular buffer. Also provides all metadata associated with that image | |
getLoadedDevices() | Devices | Returns an array of labels for currently loaded devices. | |
getLoadedDevicesOfType(devType) | Devices | Returns an array of labels for currently loaded devices of specific type. | |
getLoadedPeripheralDevices(hubLabel) | Devices | Return labels of all loaded peripherals of hubLabel device. | |
getMagnificationFactor() | Pixel size | Returns the product of all Magnifiers in the system or 1.0 when none is found. This is used internally by GetPixelSizeUm | |
getMMCoreVersionMajor() | General | ||
getMMCoreVersionMinor() | General | ||
getMMCoreVersionPatch() | General | ||
getMMDeviceDeviceInterfaceVersion() | General | ||
getMMDeviceModuleInterfaceVersion() | General | ||
getMultiROI() | âž• | Cameras | Get multiple ROIs from the current camera device. Why override? So that the user doesn't need to pass in four empty pymmcore.UnsignedVector() objects. |
getNBeforeLastImageAndMD(n, fix) | ✨ | Images & buffer | Return image taken n images ago along with associated metadata. |
getNBeforeLastImageMD(n, md) | Images & buffer | Returns a pointer to the pixels of the image that was inserted n images ago. Also provides all metadata associated with that image | |
getNumberOfCameraChannels() | Cameras | Returns the number of simultaneous channels the default camera is returning. | |
getNumberOfComponents() | Cameras | Returns the number of components the default camera is returning. | |
getNumberOfStates(stateDeviceLabel) | State devices | Returns the total number of available positions (states). | |
getOrGuessChannelGroup() | ✨ | Config groups & presets | Get the channelGroup or find a likely set of candidates. |
getParentLabel(peripheralLabel) | Devices | Returns parent device. Returns empty string if no parent is found. | |
getPhysicalCameraDevice(channel_index) | ✨ | Cameras | Return the name of the actual camera device for a given channel index. |
getPixelSizeAffine() (2 overloads) | Pixel size | Returns the current Affine Transform to related camera pixels with stage movement. | |
getPixelSizeAffineByID(resolutionID) | Pixel size | Returns the Affine Transform to related camera pixels with stage movement for the requested pixel size group. The raw affine transform without correction for binning and magnification will be returned. | |
getPixelSizeConfigData(configName, native) (2 overloads) | âž• | Pixel size | Return the configuration object for a given pixel size preset configName.Why override? The pymmcore_plus.Configuration object returned when native=False (the default) provides a nicer Mapping interface. Pass native=True to get the original pymmcore.Configuration object. |
getPixelSizedxdz() (3 overloads) | Pixel size | Returns the angle between the camera's x axis and the axis (direction) of the z drive. | |
getPixelSizedydz() (3 overloads) | Pixel size | Returns the angle between the camera's y axis and the axis (direction) of the z drive. | |
getPixelSizeOptimalZUm() (3 overloads) | Pixel size | Returns the optimal z step size in um, optionally using cached pixel configuration. | |
getPixelSizeUm() (2 overloads) | Pixel size | Returns the current pixel size in microns. | |
getPixelSizeUmByID(resolutionID) | Pixel size | Returns the pixel size in um for the requested pixel size group | |
getPosition() (2 overloads) | Stages | Returns the current position of the current FocusDevice in microns. | |
getPrimaryLogFile() | Logging & errors | Return the name of the primary Core log file. | |
getPrimaryLogLevel() | Logging & errors | Return the current primary log file level. | |
getProperty(label, propName) | Properties | Returns the property value for the specified device. | |
getPropertyFromCache(deviceLabel, propName) | Properties | Returns the cached property value for the specified device. | |
getPropertyLowerLimit(label, propName) | Properties | Returns the property lower limit value, if the property has limits - 0 otherwise. | |
getPropertyObject(device_label, property_name) | ✨ | Properties | Return a DeviceProperty object bound to a device/property on this core. |
getPropertySequenceMaxLength(label, propName) | Hardware sequencing | Queries device property for the maximum number of events that can be put in a sequence | |
getPropertyType(label, propName) | âž• | Properties | Return the intrinsic property type for a given device and property. Why override? The returned pymmcore_plus.PropertyType enum is more interpretable than the raw int returned by pymmcore |
getPropertyUpperLimit(label, propName) | Properties | Returns the property upper limit value, if the property has limits - 0 otherwise. | |
getPumpFlowrate(pumpLabel) | Pumps | Return the flowrate of the pump in uL per second | |
getPumpMaxVolume(pumpLabel) | Pumps | Return max volume of the pump in uL | |
getPumpPressureKPa(pumpLabel) | Pumps | Return the pressure of the pump in kPa. | |
getPumpVolume(pumpLabel) | Pumps | Return the fluid volume in the pump in uL | |
getRemainingImageCount() | Images & buffer | Returns number ofimages available in the Circular Buffer | |
getROI() (2 overloads) | Cameras | Return the current hardware region of interest for a camera. | |
getSerialPortAnswer(portLabel, term) | Serial ports | Continuously read from the serial port until the terminating sequence is encountered. | |
getShutterDevice() | Shutters | Returns the label of the currently selected shutter device. | |
getShutterOpen() (2 overloads) | Shutters | Returns the state of the currently selected (default) shutter. | |
getSLMBytesPerPixel(slmLabel) | SLMs | Returns the number of bytes per SLM pixel | |
getSLMDevice() | SLMs | Returns the label of the currently selected SLM device. | |
getSLMExposure(slmLabel) | SLMs | Returns the exposure time that will be used by the SLM for illumination | |
getSLMHeight(slmLabel) | SLMs | Returns the height (in "pixels") of the SLM | |
getSLMNumberOfComponents(slmLabel) | SLMs | Returns the number of components (usually these depict colors) of the SLM. | |
getSLMSequenceMaxLength(slmLabel) | SLMs | For SLMs that support sequences, returns the maximum length of the sequence that can be uploaded to the device | |
getSLMWidth(slmLabel) | SLMs | Returns the width (in "pixels") of the SLM | |
getStageSequenceMaxLength(stageLabel) | Hardware sequencing | Gets the maximum length of a stage's position sequence. | |
getState(stateDeviceLabel) | State devices | Returns the current state (position) on the specific device. | |
getStateFromLabel(stateDeviceLabel, stateLabel) | State devices | Obtain the state for a given label. | |
getStateLabel(stateDeviceLabel) | State devices | Returns the current state as the label (string). | |
getStateLabels(stateDeviceLabel) | State devices | Return labels for all states | |
getStderrLogLevel() | Logging & errors | Return the current stderr log level. | |
getSystemState(native) | âž• | System state & config files | Return the entire system state. Why override? The pymmcore_plus.Configuration object returned when native=False (the default) provides a nicer Mapping interface. Pass native=True to get the original pymmcore.Configuration object. |
getSystemStateCache(native) (2 overloads) | âž• | System state & config files | Return the entire system state from cache. Why override? The pymmcore_plus.Configuration object returned when native=False (the default) provides a nicer Mapping interface. Pass native=True to get the original pymmcore.Configuration object. |
getTaggedImage(channel_index) | ✨ | Images & buffer | Return getImage as named tuple with metadata. |
getTags(meta, channel_index) | ✨ | Images & buffer | Return a dict of metadata tags for the state of the core. |
getTimeoutMs() | Devices | Get the timeout for all wait commands. | |
getVersionInfo() | General | Displays core version. | |
getXPosition() (2 overloads) | Stages | Obtains the current position of the X axis of the XY stage in microns. | |
getXYPosition() (2 overloads) | Stages | Obtains the current position of the XY stage in microns. | |
getXYStageDevice() | Stages | Returns the label of the currently selected XYStage device. | |
getXYStageSequenceMaxLength(xyStageLabel) | Hardware sequencing | Gets the maximum length of an XY stage's position sequence. | |
getYPosition() (2 overloads) | Stages | Obtains the current position of the Y axis of the XY stage in microns. | |
getZPosition() | ✨ | Stages | Obtains the current position of the Z axis of the Z stage in microns. |
guessObjectiveDevices() | ✨ | State devices | Find any loaded devices that are likely to be an Objective/Nosepiece. |
hasDeviceTimeout(label) | Devices | Returns True if a per-device timeout has been set for the given device. | |
hasProperty(label, propName) | Properties | Checks if device has a property with a specified name. | |
hasPropertyLimits(label, propName) | Properties | Queries device if the specific property has limits. | |
home(xyOrZStageLabel) | Stages | Perform a hardware homing operation for an XY or focus/Z stage. | |
incrementalFocus() | Autofocus | Performs incremental focus for the one-shot focusing device. | |
initializeAllDevices() | Devices | Calls Initialize() method for each loaded device. | |
initializeCircularBuffer() | Images & buffer | Initialize circular buffer based on the current camera settings. | |
initializeDevice(label) | Devices | Initializes specific device. | |
instance() | ✨ | General | Return the global singleton instance of CMMCorePlus. |
invertPumpDirection(pumpLabel, invert) | Pumps | Sets whether the pump direction needs to be inverted | |
isBufferOverflowed() | Images & buffer | Indicates whether the circular buffer is overflowed | |
isConfigDefined(groupName, configName) | Config groups & presets | Checks if the configuration already exists within a group. | |
isContinuousFocusDrive(stageLabel) | Autofocus | Check if a stage has continuous focusing capability. | |
isContinuousFocusEnabled() | Autofocus | Checks if the continuous focusing hardware device is ON or OFF. | |
isContinuousFocusLocked() | Autofocus | Returns the lock-in status of the continuous focusing device. | |
isExposureSequenceable(cameraLabel) | Hardware sequencing | Queries camera if exposure can be used in a sequence | |
isFeatureEnabled(name) | Logging & errors | Return whether the given Core feature is currently enabled. | |
isGroupDefined(groupName) | Config groups & presets | Checks if the group already exists. | |
isMultiROIEnabled() | Cameras | Queries the camera to determine if multiple ROIs are currently set. | |
isMultiROISupported() | Cameras | Queries the camera to determine if it supports multiple ROIs. | |
isPixelSizeConfigDefined(resolutionID) | Pixel size | Checks if the Pixel Size Resolution already exists | |
isPropertyPreInit(label, propName) | Properties | Tells us whether the property must be defined prior to initialization. | |
isPropertyReadOnly(label, propName) | Properties | Tells us whether the property can be modified. | |
isPropertySequenceable(label, propName) | Hardware sequencing | Queries device if the specified property can be used in a sequence | |
isPumpDirectionInverted(pumpLabel) | Pumps | Return True if pump direction needs to be inverted | |
isSequenceRunning() (2 overloads) | Images & buffer | Check if the current camera is acquiring the sequence. | |
isStageLinearSequenceable(stageLabel) | Hardware sequencing | Queries if the stage can be used in a linear sequence. | |
isStageSequenceable(stageLabel) | Hardware sequencing | Queries stage if it can be used in a sequence | |
isStageUsingCallbacks(stageLabel) | Stages | Queries whether the stage uses callbacks to signal position changes. | |
isXYStageSequenceable(xyStageLabel) | Hardware sequencing | Queries XY stage if it can be used in a sequence | |
isXYStageUsingCallbacks(xyStageLabel) | Stages | Queries whether the XY stage uses callbacks to signal position changes. | |
iterConfigGroups() | ✨ | Config groups & presets | Iterate ConfigGroup objects for all configs. |
iterDeviceAdapters(adapter_pattern, as_object) (2 overloads) | ✨ | Devices | Iterate over all available device adapters. |
iterDevices(device_type, device_label, device_adapter, as_object) (2 overloads) | ✨ | Devices | Iterate over currently loaded devices. |
iterProperties(property_type, property_name_pattern, device_type, device_label, has_limits, is_read_only, is_sequenceable, as_object) (2 overloads) | ✨ | Properties | Iterate over currently loaded (device_label, property_name) pairs. |
loadDevice(label, moduleName, deviceName) | âž• | Devices | Load a device from the plugin library. Why override? To add much better error messages in the case of failure. |
loadExposureSequence(cameraLabel, exposureSequence_ms) | Hardware sequencing | Transfer a sequence of exposure times to the camera. | |
loadGalvoPolygons(galvoLabel) | Galvos | Load a set of galvo polygons to the device | |
loadPropertySequence(label, propName, eventSequence) | Hardware sequencing | Transfer a sequence of events/states/whatever to the device. | |
loadSLMSequence(slmLabel, imageSequence) | SLMs | Load a sequence of images into the SLM | |
loadStageSequence(stageLabel, positionSequence) | Hardware sequencing | Transfer a sequence of events/states/whatever to the device. | |
loadSystemConfiguration(fileName) | âž• | System state & config files | Load a system config file conforming to the MM .cfg format.Why override? This method overrides the default implementation to A) allow loading the MMConfig_demo.cfg file by default, B) to provide more flexible path declarations and C) better error messages when the file cannot be found. |
loadSystemState(fileName) | System state & config files | Loads the system configuration from the text file conforming to the MM specific format. | |
loadXYStageSequence(xyStageLabel, xSequence, ySequence) | Hardware sequencing | Transfer a sequence of stage positions to the xy stage. | |
log(msg, level) (2 overloads) | Logging & errors | Log a message at the given level. | |
logMessage(msg) (2 overloads) | Logging & errors | Record text message in the log file. | |
mda | ✨ | Acquisition engine & events | Return the MDARunner for this CMMCorePlus instance. |
noop() | General | A static method that does nothing. | |
objective_device_pattern | ✨ | State devices | Pattern used to guess objective device labels. |
pointGalvoAndFire(galvoLabel, x, y, pulseTime_us) | Galvos | Set the Galvo to an x,y position and fire the laser for a predetermined duration. | |
popNextImage(fix) | âž• | Images & buffer | Gets and removes the next image from the circular buffer. Why override? to add the fix parameter, which reshapes multi-component images (like RGB images) to (w, h, n_components) using fixImage by default. |
popNextImageAndMD(channel, slice, fix) (2 overloads) | ✨ | Images & buffer | Gets and removes the next image (and metadata) from the circular buffer. |
popNextImageMD(channel, slice, md) (2 overloads) | Images & buffer | Gets and removes the next image (and metadata) from the circular buffer | |
popNextTaggedImage(channel_index) | ✨ | Images & buffer | Return popNextImageAndMD as named tuple with metadata. |
prepareSequenceAcquisition(cameraLabel) | Images & buffer | Prepare the camera for the sequence acquisition to save the time in the | |
pressurePumpCalibrate(pumpLabel) | Pumps | Calibrates the pressure pump. | |
pressurePumpRequiresCalibration(pumpLabel) | Pumps | Return True if pump requires calibration before operation. | |
pressurePumpStop(pumpLabel) | Pumps | Stops the pressure pump. | |
pumpDispenseDurationSeconds(pumpLabel, seconds) | Pumps | Dispenses for the provided duration (in seconds) at the set flowrate. | |
pumpDispenseVolumeUl(pumpLabel, microLiter) | Pumps | Dispenses the provided volume (in uL) at the set flowrate. | |
pumpStart(pumpLabel) | Pumps | Start dispensing until syringe is empty, or manually stopped. | |
readFromSerialPort(portLabel) | Serial ports | Reads the contents of the Rx buffer. | |
register_mda_engine(engine) | ✨ | Acquisition engine & events | Set the MDA Engine to be used on run_mda. |
registerCallback() | âž• | Acquisition engine & events | registerCallback is disallowed in pymmcore-plus! |
renameConfig(groupName, oldConfigName, newConfigName) | Config groups & presets | Renames a configuration within a specified group. | |
renameConfigGroup(oldGroupName, newGroupName) | Config groups & presets | Renames a configuration group. | |
renamePixelSizeConfig(oldConfigName, newConfigName) | Pixel size | Renames a pixel size configuration. | |
reset() | General | Unloads all devices from the core, clears all configuration data and property blocks. | |
run_mda(events, output, block, dimension_overrides) | ✨ | Acquisition engine & events | Run a sequence of useq.MDAEvent on a new thread. |
runGalvoPolygons(galvoLabel) | Galvos | Run a loop of galvo polygons | |
runGalvoSequence(galvoLabel) | Galvos | Run a sequence of galvo positions | |
saveSystemConfiguration(filename) | âž• | System state & config files | Saves the current system configuration to a text file. Why override? To also save pixel size configurations. |
saveSystemState(fileName) | System state & config files | Saves the current system state to a text file of the MM specific format. | |
setAdapterOrigin(newZUm) (2 overloads) | Stages | Enable software translation of coordinates for the current focus/Z stage. | |
setAdapterOriginXY(newXUm, newYUm) (2 overloads) | Stages | Enable software translation of coordinates for the current XY stage. | |
setAutoFocusDevice(focusLabel) | Autofocus | Sets the current auto-focus device. | |
setAutoFocusOffset(offset) | âž• | Autofocus | Applies offset the one-shot focusing device. |
setAutoShutter(state) | âž• | Shutters | Set shutter to automatically open and close when an image is acquired. Why override? To emit an autoShutterSet event. |
setBinning(binning) (2 overloads) | Cameras | Sets the binning factor of the current camera. | |
setCameraDevice(cameraLabel) | Cameras | Sets the current camera device. | |
setChannelGroup(channelGroup) | âž• | Config groups & presets | Specifies the group determining the channel selection. |
setCircularBufferMemoryFootprint(sizeMB) | Images & buffer | Reserve memory for the circular buffer. | |
setConfig(groupName, configName) | âž• | Config groups & presets | Applies a configuration to a group. Why override? The native onConfigGroupChanged callback is not always called whenever CMMCore.setConfig has been called. We override here to emit a configSet event whenever setConfig is called. See <https://github.com/micro-manager/mmCoreAndDevices/issues/25> for details. |
setContext(**kwargs) | ✨ | System state & config files | Set core properties in a context restoring the initial values on exit. |
setDeviceAdapterSearchPaths(paths) | âž• | Devices | Set the device adapter search paths. Why override? In cases where MM device adapters use dynamically loaded libraries, the device adapter search paths must also be added to the PATH environment variable (e.g. <https://github.com/micro-manager/pymmcore/issues/28>). This method overrides the default implementation to ensure that the PATH environment variable is updated when the device adapter search paths are changed. |
setDeviceDelayMs(label, delayMs) | Devices | Overrides the built-in value for the action delay. | |
setDeviceTimeoutMs(label, timeoutMs) | Devices | Sets a per-device timeout in milliseconds. | |
setExposure(exp) (2 overloads) | Cameras | Sets the exposure setting of the current camera in milliseconds. | |
setFocusDevice(focusLabel) | âž• | Stages | Set the current Focus Device and emit a propertyChanged signal. |
setFocusDirection(stageLabel, sign) | Stages | Set the focus direction of a stage. | |
setGalvoDevice(galvoLabel) | Galvos | Sets the current galvo device. | |
setGalvoIlluminationState(galvoLabel, on) | Galvos | Set the galvo's illumination state to on or off | |
setGalvoPolygonRepetitions(galvoLabel, repetitions) | Galvos | Set the number of times to loop galvo polygons | |
setGalvoPosition(galvoLabel, x, y) | Galvos | Set the Galvo to an x,y position. | |
setGalvoSpotInterval(galvoLabel, pulseTime_us) | Galvos | Set the SpotInterval for the specified galvo device. | |
setImageProcessorDevice(procLabel) | Cameras | Sets the current image processor device. | |
setMultiROI(xs, ys, widths, heights) | Cameras | Set multiple ROIs for the current camera device. | |
setOrigin() (2 overloads) | Stages | Zero the current focus/Z stage's coordinates at the current position. | |
setOriginX() (2 overloads) | Stages | Zero the given XY stage's X coordinate at the current position. | |
setOriginXY() (2 overloads) | Stages | Zero the current XY stage's coordinates at the current position. | |
setOriginY() (2 overloads) | Stages | Zero the given XY stage's Y coordinate at the current position. | |
setParentLabel(deviceLabel, parentHubLabel) | Devices | Sets parent device label | |
setPixelSizeAffine(resolutionID, affine) | Pixel size | Sets the raw affine transform for the specific pixel size configuration. | |
setPixelSizeConfig(resolutionID) | Pixel size | Applies a Pixel Size Configuration. | |
setPixelSizedxdz(resolutionID, dXdZ) | Pixel size | Sets the pixel size in the X direction in microns. | |
setPixelSizedydz(resolutionID, dYdZ) | Pixel size | Sets the pixel size in the Y direction in microns. | |
setPixelSizeOptimalZUm(resolutionID, optimalZ) | Pixel size | Sets the pixel size in the Z direction in microns. | |
setPixelSizeUm(resolutionID, pixSize) | âž• | Pixel size | Set pixel size in microns for the specified resolutionID.Why override? To emit a pixelSizeChanged event. |
setPosition(position) (2 overloads) | Stages | Sets the position of the current FocusDevice in microns. | |
setPrimaryLogFile(filename) (2 overloads) | Logging & errors | Set the primary Core log file. | |
setPrimaryLogFileRotation(maxFileSize, maxBackupCount) | Logging & errors | Set the primary log file rotation parameters. | |
setPrimaryLogLevel(level) | Logging & errors | Set the log level for the primary log file. | |
setProperty(label, propName, propValue) | âž• | Properties | Set property named propName on device label to propValue.Why override? In MMCore, the calling of the onPropertyChanged callback is left to the underlying device adapter, which means it is not always called. This method overrides the default implementation to ensure that events.propertyChanged is *always* emitted when setProperty has been called and the property Value has actually changed. |
setPumpFlowrate(pumpLabel, volume) | Pumps | Set the flowrate of the pump in uL per second | |
setPumpMaxVolume(pumpLabel, volume) | Pumps | Set the max volume of the pump in uL | |
setPumpPressureKPa(pumpLabel, pressure) | Pumps | Sets the pressure of the pump in kPa. | |
setPumpVolume(pumpLabel, volume) | Pumps | Sets the volume of fluid in the pump in uL. | |
setRelativePosition(d) (2 overloads) | Stages | Sets the relative position of the stage in microns. | |
setRelativeXYPosition(dx, dy) (2 overloads) | Stages | Sets the relative position of the XY stage in microns. | |
setRelativeXYZPosition(dx, dy, dz) | ✨ | Stages | Sets the relative XYZ position in microns. |
setROI(x, y, width, height) (2 overloads) | âž• | Cameras | Set the camera Region of Interest (ROI). Why override? To emit a roiSet event. |
setSerialPortCommand(portLabel, command, term) | Serial ports | Send string to the serial device and return an answer. | |
setSerialProperties(portName, answerTimeout, baudRate, delayBetweenCharsMs, handshaking, parity, stopBits) | Serial ports | Sets all com port properties in a single call. | |
setShutterDevice(shutterLabel) | Shutters | the current shutter device. | |
setShutterOpen(state) (2 overloads) | âž• | Shutters | Open or close the currently selected or shutterLabel shutter.Why override? To emit a propertyChanged event. |
setSLMDevice(slmLabel) | SLMs | Sets the current slm device. | |
setSLMExposure(slmLabel, exposure_ms) | SLMs | For SLM devices with build-in light source (such as projectors), this will set the exposure time, but not (yet) start the illumination | |
setSLMImage(slmLabel, pixels) (2 overloads) | SLMs | Write an image to the SLM . | |
setSLMPixelsTo(slmLabel, intensity) (2 overloads) | SLMs | Set all SLM pixels to a single 8-bit intensity. | |
setStageLinearSequence(stageLabel, dZ_um, nSlices) | Hardware sequencing | Loads a linear sequence (defined by stepsize and nr. of steps) into the device. | |
setState(stateDeviceLabel, state) | âž• | State devices | Set state (by position) on stateDeviceLabel, with reliable event emission.Why override? In MMCore, the calling of the onPropertyChanged callback is left to the underlying device adapter, which means it is not always called. This method overrides the default implementation to ensure that events.propertyChanged is *always* emitted when setProperty has been called and the property Value has actually changed. |
setStateLabel(stateDeviceLabel, stateLabel) | âž• | State devices | Set state (by label) on stateDeviceLabel, with reliable event emission.Why override? In MMCore, the calling of the onPropertyChanged callback is left to the underlying device adapter, which means it is not always called. This method overrides the default implementation to ensure that events.propertyChanged is *always* emitted when setProperty has been called and the property Value has actually changed. |
setStderrLogLevel(level) | Logging & errors | Set the stderr log level. | |
setSystemState(conf) | System state & config files | Sets all properties contained in the Configuration object. | |
setTimeoutMs(timeoutMs) | Devices | Sets the timeout for all wait commands. | |
setXYPosition(x, y) (2 overloads) | âž• | Stages | Sets the position of the XY stage in microns. Why override? to store the last commanded stage position internally. |
setXYStageDevice(xyStageLabel) | Stages | Sets the current XY device. | |
setZPosition(val) | ✨ | Stages | Set the position of the current focus device in microns. |
sleep(intervalMs) | General | Waits (blocks the calling thread) for specified time in milliseconds. | |
snap(numChannel, fix) | ✨ | Images & buffer | Snap and return an image. |
snapImage() | âž• | Images & buffer | Acquires a single image with current settings. Why override? To emit the imageSnapped event after snapping an image, and to emit shutter property changes if getAutoShutter is True. |
startContinuousSequenceAcquisition(intervalMs) | âž• | Images & buffer | Start a ContinuousSequenceAcquisition. Why override? To emit the continuousSequenceAcquisitionStarting and continuousSequenceAcquisitionStarted events. |
startExposureSequence(cameraLabel) | Hardware sequencing | Starts an ongoing sequence of triggered exposures in a camera. | |
startPropertySequence(label, propName) | Hardware sequencing | Starts an ongoing sequence of triggered events in a property of a device. | |
startSecondaryLogFile(filename, enableDebug) (3 overloads) | Logging & errors | Start capturing logging output into an additional file. | |
startSequenceAcquisition(numImages, intervalMs, stopOnOverflow) (2 overloads) | âž• | Images & buffer | Starts streaming camera sequence acquisition. Why override? To emit the sequenceAcquisitionStarting and sequenceAcquisitionStarted events. |
startSLMSequence(slmLabel) | SLMs | Starts the sequence previously uploaded to the SLM | |
startStageSequence(stageLabel) | Hardware sequencing | Starts an ongoing sequence of triggered events in a stage. | |
startXYStageSequence(xyStageLabel) | Hardware sequencing | Starts an ongoing sequence of triggered events in an XY stage. | |
state(cached, include_time) | ✨ | General | Return info on the current state of the core. |
stderrLogEnabled() | Logging & errors | Indicates whether logging output goes to stdErr | |
stop(xyOrZStageLabel) | Stages | Stop the XY or focus/Z stage motors | |
stopExposureSequence(cameraLabel) | Hardware sequencing | Stops an ongoing sequence of triggered exposures in a camera. | |
stopPropertySequence(label, propName) | Hardware sequencing | Stops an ongoing sequence of triggered events in a property of a device. | |
stopSecondaryLogFile(handle) | Logging & errors | Stop capturing logging output into an additional file. | |
stopSequenceAcquisition(cameraLabel) | âž• | Images & buffer | Stops streaming camera sequence acquisition. Why override? To emit a sequenceAcquisitionStopped event. |
stopSLMSequence(slmLabel) | SLMs | Stops the SLM sequence if previously started | |
stopStageSequence(stageLabel) | Hardware sequencing | Stops an ongoing sequence of triggered events in a stage. | |
stopXYStageSequence(xyStageLabel) | Hardware sequencing | Stops an ongoing sequence of triggered events in an XY stage. | |
supportsDeviceDetection(deviceLabel) | Devices | Return whether or not the device supports automatic device detection (i.e. | |
systemBusy() | Devices | Checks the busy status of the entire system. | |
systemConfigurationFile() | ✨ | System state & config files | Return the path to the last loaded system configuration file, or None. |
unloadAllDevices() | âž• | Devices | Unload all devices from the core and reset all configuration data. Why override? To add logging. |
unloadDevice(label) | Devices | Unloads the device from the core and adjusts all configuration data. | |
unloadLibrary(moduleName) | Devices | Forcefully unload a library. | |
unsetDeviceTimeout(label) | Devices | Removes any per-device timeout, restoring the default. | |
updateCoreProperties() | Properties | Updates CoreProperties (currently all Core properties are devices types) with the loaded hardware. | |
updateSystemStateCache() | System state & config files | Updates the state of the entire hardware. | |
usesDeviceDelay(label) | Devices | Signals if the device will use the delay setting or not. | |
volumetricPumpHome(pumpLabel) | Pumps | Homes the volumetric pump. | |
volumetricPumpRequiresHoming(pumpLabel) | Pumps | Return True if the volumetric pump requires homing. | |
volumetricPumpStop(pumpLabel) | Pumps | Stops the volumetric pump. | |
waitForConfig(group, configName) | Config groups & presets | Blocks until all devices included in the configuration become ready. | |
waitForDevice(label) | Devices | Waits (blocks the calling thread) until the specified device becomes non-busy. | |
waitForDeviceType(devType) | Devices | Blocks until all devices of the specific type become ready (not-busy). | |
waitForSystem() | System state & config files | Blocks until all devices in the system become ready (not-busy). | |
writeToSerialPort(portLabel, data) | Serial ports | Sends an array of characters to the serial port and returns immediately. |
General¶
describe
¶
describe(
sort: str | None = None,
show_config_groups: bool = False,
show_available: bool = False,
) -> None
Print information table with the current configuration.
Intended to provide a quick overview of the microscope configuration during interactive terminal usage.
instance
classmethod
¶
instance() -> CMMCorePlus
Return the global singleton instance of CMMCorePlus.
In many cases, a single instance of CMMCorePlus is all that will be created
in a given session. This class method provides a convenient way to access
that instance.
Tip
Creating/accessing a CMMCorePlus object using CMMCorePlus.instance() is
a convenient way to access the same core instance from multiple places in
your code. All widgets in
pymmcore-widgets also
use CMMCorePlus.instance() by default, so any widgets you use will
automatically connect to the same core instance without any additional
configuration.
Attempts are made to make it thread-safe. But please open an issue if you find any problems.
-
API Reference
pymmcore-widgets
pymmcore_widgets-
CameraRoiWidget
API
CameraRoiWidget -
ChannelGroupWidget
API
ChannelGroupWidget -
ChannelWidget
API
ChannelWidget -
ConfigurationWidget
API
ConfigurationWidget -
CoreLogWidget
API
CoreLogWidget -
DefaultCameraExposureWidget
API
DefaultCameraExposureWidget -
HCSWizard
API
HCSWizard -
ImagePreview
API
ImagePreview -
LiveButton
API
LiveButton -
MDAWidget
API
MDAWidget -
ObjectivesPixelConfigurationWidget
API
ObjectivesPixelConfigurationWidget -
ObjectivesWidget
API
ObjectivesWidget -
PixelConfigurationWidget
API
PixelConfigurationWidget -
PresetsWidget
API
PresetsWidget -
PropertyBrowser
API
PropertyBrowser -
SnapButton
API
SnapButton -
StageExplorer
API
StageExplorer -
StageWidget
API
StageWidget
-
CameraRoiWidget
API
- Getting Started
-
User Guide
- Applications
- Controlling Hardware Using Your Own Microscope Making a configuration file
- Running Acquisitions The Acquisition Engine
- Widget Gallery Building a Custom GUI
reset
¶
Unloads all devices from the core, clears all configuration data and property blocks.
sleep
¶
sleep(intervalMs: float) -> None
Waits (blocks the calling thread) for specified time in milliseconds.
state
¶
state(
*, cached: bool = True, include_time: bool = False, **_kwargs: Any
) -> SummaryMetaV1
Return info on the current state of the core.
Acquisition engine & events¶
events
property
¶
events: PCoreSignaler
Signaler for core events.
This attribute is new in
CMMCorePlus.
This attribute allows connecting callbacks to various events that occur within
the core. See pymmcore_plus.core.events.PCoreSignaler documentation for
details of the available signals, and how to connect to them.
mda
property
¶
mda: MDARunner
Return the MDARunner for this CMMCorePlus instance.
This attribute is new in
CMMCorePlus.
-
API Reference
pymmcore-plus
pymmcore_plusmda ClassesMDARunner -
User Guide
- Controlling Hardware Events and Callbacks
- Running Acquisitions The Acquisition Engine
register_mda_engine
¶
register_mda_engine(engine: PMDAEngine) -> None
Set the MDA Engine to be used on run_mda.
This will unregister the previous engine and emit an mdaEngineRegistered
signal. The current Engine must not be running an MDA in order to register a new
engine.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
engine
|
PMDAEngine
|
Any object conforming to the PMDAEngine protocol. |
required |
- User Guide Running Acquisitions Custom Acquisition Engines Customizing the MDAEngine
registerCallback
¶
registerCallback is disallowed in pymmcore-plus!
If you want to connect callbacks to events, use the
CMMCorePlus.events property instead.
run_mda
¶
run_mda(
events: Iterable[MDAEvent],
*,
output: SingleOutput | Sequence[SingleOutput] | None = None,
block: bool = False,
dimension_overrides: dict[str, DimensionOverride] | None = None,
) -> Thread
Run a sequence of useq.MDAEvent on a new thread.
The currently registered MDAEngine (core.mda.engine) will be responsible for
executing the acquisition.
After starting the sequence you can pause or cancel the mda with the
mda object's set_paused and cancel methods.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
events
|
Iterable[MDAEvent]
|
An iterable of useq.MDAEvent to execute. This may be an instance of useq.MDASequence, or any other iterable of useq.MDAEvent. |
required |
output
|
SingleOutput | Sequence[SingleOutput] | None
|
Where to send the data. If None (the default), nothing is saved. This is
passed on to
Note that |
None
|
block
|
bool
|
If True, block until the sequence is complete, by default False. |
False
|
dimension_overrides
|
dict[str, DimensionOverride] | None
|
Per-dimension storage overrides, keyed by dimension name.
See |
None
|
Returns:
| Type | Description |
|---|---|
Thread
|
The thread the sequence is running on. Use |
-
API Reference
pymmcore-plus
pymmcore_plus - Getting Started Your First Acquisition Running it
-
User Guide
- Controlling Hardware Events and Callbacks Threads
- Running Acquisitions
- Troubleshooting Troubleshooting Qt and Widgets The GUI freezes
- Widget Gallery
System state & config files¶
getSystemState
¶
getSystemState(*, native: bool = False) -> Configuration | Configuration
Return the entire system state.
Why Override? The pymmcore_plus.Configuration object returned
when native=False (the default) provides a nicer Mapping interface. Pass
native=True to get the original pymmcore.Configuration object.
getSystemStateCache
¶
getSystemStateCache(*, native: Literal[True]) -> Configuration
getSystemStateCache(*, native: Literal[False] = False) -> Configuration
getSystemStateCache(*, native: bool = False) -> Configuration | Configuration
Return the entire system state from cache.
Why Override? The pymmcore_plus.Configuration object returned
when native=False (the default) provides a nicer Mapping interface. Pass
native=True to get the original pymmcore.Configuration object.
loadSystemConfiguration
¶
Load a system config file conforming to the MM .cfg format.
https://micro-manager.org/Micro-Manager_Configuration_Guide#configuration-file-syntax
For relative paths, the current working directory is first checked, then the then device adapter path is checked.
Why Override? This method overrides the default implementation to A) allow
loading the MMConfig_demo.cfg file by default, B) to provide more flexible
path declarations and C) better error messages when the file cannot be found.
-
User Guide
- Controlling Hardware Using Your Own Microscope Loading it
- Running Acquisitions The Acquisition Engine
loadSystemState
¶
loadSystemState(fileName: str) -> None
Loads the system configuration from the text file conforming to the MM specific format.
saveSystemConfiguration
¶
saveSystemConfiguration(filename: str) -> None
Saves the current system configuration to a text file.
Why Override? To also save pixel size configurations.
saveSystemState
¶
saveSystemState(fileName: str) -> None
Saves the current system state to a text file of the MM specific format.
setContext
¶
Set core properties in a context restoring the initial values on exit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Any
|
Keyword arguments may be any |
{}
|
Examples:
core = CMMCorePlus.instance()
with core.setContext(autoShutter=False):
assert not core.getAutoShutter()
# do other stuff
...
# autoShutter is restored to its original value when the context exits
assert core.getAutoShutter()
- User Guide Controlling Hardware Devices and Properties Temporarily changing settings
setSystemState
¶
Sets all properties contained in the Configuration object.
systemConfigurationFile
¶
systemConfigurationFile() -> str | None
Return the path to the last loaded system configuration file, or None.
waitForSystem
¶
Blocks until all devices in the system become ready (not-busy).
Devices¶
detectDevice
¶
detectDevice(deviceLabel: str) -> DeviceDetectionStatus
Tries to communicate to a device through a given serial port.
Used to automate discovery of correct serial port. Also configures the serial port correctly.
Why Override? The returned pymmcore_plus.DeviceDetectionStatus enum
is more interpretable than the raw int returned by pymmcore
deviceBusy
¶
Checks the busy status of the specific device.
deviceTypeBusy
¶
deviceTypeBusy(devType: DeviceType) -> bool
Checks the busy status for all devices of the specific type.
getAdapterObject
¶
getAdapterObject(library_name: str) -> DeviceAdapter
Return an Adapter object bound to library_name on this core.
Adapter objects are a convenient object
oriented way to interact with device adapters. They allow you to call any method
on CMMCore that normally requires a library_name as the first argument as an
argument-free method on the Adapter object.
getAvailableDeviceDescriptions
¶
Get descriptions for available devices from the specified library.
getAvailableDevices
¶
Get available devices from the specified device library.
getAvailableDeviceTypes
¶
Get type information for available devices from the specified library.
getCurrentDeviceOfType
¶
getCurrentDeviceOfType(
device_type: DeviceTypesWithCurrent,
) -> DeviceLabel | Literal[""]
Return the current device of type device_type.
Only the following device types have a "current" device: - CameraDevice - ShutterDevice - StageDevice - XYStageDevice - AutoFocusDevice - SLMDevice - GalvoDevice - ImageProcessorDevice
Calling this method with any other device type will raise a ValueError.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_type
|
DeviceType
|
The type of device to get the current device for.
See |
required |
Returns:
| Type | Description |
|---|---|
str
|
The label of the current device of type |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the core does not have the concept of a "current" device of the provided
|
getDeviceAdapterNames
¶
getDeviceAdapterNames() -> tuple[AdapterName, ...]
Return the names of discoverable device adapters.
getDeviceAdapterSearchPaths
¶
Return the current device adapter search paths.
getDeviceDelayMs
¶
Reports action delay in milliseconds for the specific device.
getDeviceDescription
¶
Returns description text for a given device label. "Description" is determined by the library and is immutable.
getDeviceInitializationState
¶
getDeviceInitializationState(label: str) -> DeviceInitializationState
Queries the initialization state of the given device.
Why Override? The returned pymmcore_plus.DeviceInitializationState
enum is more interpretable than the raw int returned by pymmcore
getDeviceLibrary
¶
getDeviceLibrary(label: DeviceLabel | str) -> AdapterName
Returns device library (aka module, device adapter) name.
- User Guide Controlling Hardware Devices and Properties
getDeviceName
¶
getDeviceName(label: DeviceLabel | str) -> DeviceName
Returns device name for a given device label.
getDeviceObject
¶
getDeviceObject(
device_label: str, device_type: Literal[Camera]
) -> CameraDevice
getDeviceObject(device_label: str, device_type: Literal[Stage]) -> StageDevice
getDeviceObject(device_label: str, device_type: Literal[State]) -> StateDevice
getDeviceObject(
device_label: str, device_type: Literal[Shutter]
) -> ShutterDevice
getDeviceObject(
device_label: str, device_type: Literal[XYStage]
) -> XYStageDevice
getDeviceObject(
device_label: str, device_type: Literal[Serial]
) -> SerialDevice
getDeviceObject(
device_label: str, device_type: Literal[Generic]
) -> GenericDevice
getDeviceObject(
device_label: str, device_type: Literal[AutoFocus]
) -> AutoFocusDevice
getDeviceObject(
device_label: str, device_type: Literal[ImageProcessor]
) -> ImageProcessorDevice
getDeviceObject(
device_label: str, device_type: Literal[SignalIO]
) -> SignalIODevice
getDeviceObject(
device_label: str, device_type: Literal[Magnifier]
) -> MagnifierDevice
getDeviceObject(device_label: str, device_type: Literal[Galvo]) -> GalvoDevice
getDeviceObject(
device_label: Literal[CoreDevice], device_type: Literal[Core]
) -> CoreDevice
getDeviceObject(device_label: str, device_type: DeviceType = ...) -> Device
getDeviceObject(
device_label: str, device_type: type[_DT] | DeviceType = Any
) -> _DT | Device
Return a Device object bound to device_label on this core.
Device objects are a convenient object oriented way to
interact with devices. They allow you to call any method on CMMCore that
normally requires a deviceLabel as the first argument as an argument-free
method on the Device object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_label
|
str
|
Device label to get a device object for. |
required |
Examples:
>>> core = CMMCorePlus()
>>> cam = core.getDeviceObject("DemoCamera")
>>> cam.isLoaded()
False
>>> cam.load("DemoCamera", "DCam")
>>> cam.isLoaded()
True
>>> cam.initialize()
get the device schema
>>> cam.schema()
{
'title': 'DCam',
'description': 'Demo camera',
'type': 'object',
'properties': {
'HubID': {'type': 'string', 'readOnly': True, 'default': ''},
'MaximumExposureMs': {'type': 'number', 'preInit': True},
'TransposeCorrection': {'type': 'boolean'},
'TransposeMirrorX': {'type': 'boolean'},
'TransposeMirrorY': {'type': 'boolean'},
'TransposeXY': {'type': 'boolean'}
}
}
getDeviceSchema
¶
getDeviceSchema(device_label: str) -> DeviceSchema
Return JSON-schema describing device device_label and its properties.
This method is new in
CMMCorePlus. It provides a convenient way to
get all of the information about a device in a single call.
Returns:
| Type | Description |
|---|---|
DeviceSchema
|
JSON-schema describing device |
Examples:
>>> core = CMMCorePlus()
>>> core.loadDevice("DemoCamera", "DemoCamera", "DCam")
>>> core.getDeviceSchema("DemoCamera")
{
'title': 'DCam',
'description': 'Demo camera',
'type': 'object',
'properties': {
'HubID': {'type': 'string', 'readOnly': True, 'default': ''},
'MaximumExposureMs': {'type': 'number', 'preInit': True},
'TransposeCorrection': {'type': 'boolean'},
'TransposeMirrorX': {'type': 'boolean'},
'TransposeMirrorY': {'type': 'boolean'},
'TransposeXY': {'type': 'boolean'}
}
}
getDeviceTimeoutMs
¶
Returns the per-device timeout in milliseconds, or the default if not set.
getDeviceType
¶
getDeviceType(label: str) -> DeviceType
Return device type for a given device.
Why Override? The returned pymmcore_plus.DeviceType enum is more
interpretable than the raw int returned by pymmcore
- User Guide Controlling Hardware Devices and Properties
getInstalledDeviceDescription
¶
getInstalledDeviceDescription(
hubLabel: DeviceLabel | str, peripheralLabel: DeviceName | str
) -> str
Returns description from the specified peripheral on hubLabel device.
getInstalledDevices
¶
Performs auto-detection and loading of child devices that are attached to a Hub device.
Raises RuntimeError if hubLabel is not a hub device.
getLoadedDevices
¶
getLoadedDevices() -> tuple[DeviceLabel, ...]
Returns an array of labels for currently loaded devices.
getLoadedDevicesOfType
¶
getLoadedDevicesOfType(devType: DeviceType) -> tuple[DeviceLabel, ...]
Returns an array of labels for currently loaded devices of specific type.
getLoadedPeripheralDevices
¶
Return labels of all loaded peripherals of hubLabel device.
Returns empty tuple if hubLabel is not a hub device, or even if hubLabel is not the name of any device.
getParentLabel
¶
Returns parent device. Returns empty string if no parent is found.
hasDeviceTimeout
¶
Returns True if a per-device timeout has been set for the given device.
initializeAllDevices
¶
Calls Initialize() method for each loaded device.
See ParallelDeviceInitialization feature flag for controlling the order of
initialization.
iterDeviceAdapters
¶
iterDeviceAdapters(
adapter_pattern: str | Pattern | None = ...,
*,
as_object: Literal[True] = ...,
) -> Iterator[DeviceAdapter]
iterDeviceAdapters(
adapter_pattern: str | Pattern | None = None, *, as_object: bool = True
) -> Iterator[DeviceAdapter] | Iterator[str]
Iterate over all available device adapters.
It offers a convenient way to iterate over available device adaptor libraries,
optionally filtering adapter library name. It can also yield
Adapter objects if as_object is True (the
default)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
adapter_pattern
|
str | None
|
Device adapter name or pattern to filter by, by default all device adapters will be yielded. |
None
|
as_object
|
bool
|
If |
True
|
Yields:
| Type | Description |
|---|---|
Device | str
|
|
iterDevices
¶
iterDevices(
device_type: int | Iterable[int] | None = None,
device_label: str | Pattern | None = None,
device_adapter: str | Pattern | None = None,
*,
as_object: bool = True,
) -> Iterator[Device] | Iterator[str]
Iterate over currently loaded devices.
It offers a convenient way to iterate over loaded devices, optionally filtering
by DeviceType and/or device label. It can also
yield Device objects if as_object is
True (the default).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_type
|
DeviceType | None
|
DeviceType to filter by, by default all device types will be yielded. |
None
|
device_label
|
str | None
|
Device label to filter by, by default all device labels will be yielded. |
None
|
device_adapter
|
str | None
|
Device adapter library to filter by, by default devices from all libraries will be yielded. |
None
|
as_object
|
bool
|
If |
True
|
Yields:
| Type | Description |
|---|---|
Device | str
|
|
- User Guide Controlling Hardware Devices and Properties
loadDevice
¶
Load a device from the plugin library.
Why Override? To add much better error messages in the case of failure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
Name to be assigned to the device during this core session. |
required |
moduleName
|
str
|
The name of the device adapter module (short name, not full file name).
See |
required |
deviceName
|
str
|
the name of the device. The name must correspond to one of the names
recognized by the specific plugin library. See
|
required |
setDeviceAdapterSearchPaths
¶
Set the device adapter search paths.
Why Override? In cases where MM device adapters use dynamically loaded
libraries, the device adapter search paths must also be added to the PATH
environment variable (e.g.
https://github.com/micro-manager/pymmcore/issues/28). This method overrides
the default implementation to ensure that the PATH environment variable is
updated when the device adapter search paths are changed.
setDeviceDelayMs
¶
Overrides the built-in value for the action delay.
setDeviceTimeoutMs
¶
Sets a per-device timeout in milliseconds.
setParentLabel
¶
Sets parent device label
setTimeoutMs
¶
setTimeoutMs(timeoutMs: int) -> None
Sets the timeout for all wait commands.
(Default is 5000 ms)
supportsDeviceDetection
¶
Return whether or not the device supports automatic device detection (i.e.
unloadAllDevices
¶
Unload all devices from the core and reset all configuration data.
Why Override? To add logging.
unloadDevice
¶
unloadDevice(label: DeviceLabel | str) -> None
Unloads the device from the core and adjusts all configuration data.
unsetDeviceTimeout
¶
unsetDeviceTimeout(label: DeviceLabel | str) -> None
Removes any per-device timeout, restoring the default.
usesDeviceDelay
¶
Signals if the device will use the delay setting or not.
waitForDevice
¶
waitForDevice(label: DeviceLabel | str) -> None
Waits (blocks the calling thread) until the specified device becomes non-busy.
- User Guide Controlling Hardware Devices and Properties
waitForDeviceType
¶
Blocks until all devices of the specific type become ready (not-busy).
Properties¶
getAllowedPropertyValues
¶
getAllowedPropertyValues(
label: DeviceLabel | str, propName: PropertyName | str
) -> tuple[str, ...]
Returns all valid values for the specified property.
getDevicePropertyNames
¶
Returns all property names supported by the device.
getProperty
¶
Returns the property value for the specified device.
The return value will always be a string. Use getPropertyType to determine the correct type.
- User Guide Controlling Hardware Devices and Properties
getPropertyFromCache
¶
Returns the cached property value for the specified device.
getPropertyLowerLimit
¶
Returns the property lower limit value, if the property has limits - 0 otherwise.
getPropertyObject
¶
getPropertyObject(device_label: str, property_name: str) -> DeviceProperty
Return a DeviceProperty object bound to a device/property on this core.
DeviceProperty objects are a convenient object
oriented way to interact with a specific device properties. They allow you to
call any method on CMMCore that normally requires a deviceLabel and
propertyName as the first two arguments as an argument-free method on the
DeviceProperty object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_label
|
str
|
Device label to get a property object for. |
required |
property_name
|
str
|
Property name to get a property object for. |
required |
Examples:
>>> core = CMMCorePlus()
>>> core.loadDevice("DemoCamera", "DemoCamera", "DCam")
>>> core.initializeDevice("DemoCamera")
>>> core.setCameraDevice("DemoCamera")
>>> exposure = core.getPropertyObject("DemoCamera", "Exposure")
>>> exposure.type()
<PropertyType.Float: 2>
>>> exposure.upperLimit()
10000.0
get/set property values easily:
>>> exposure.value
10.0
>>> exposure.value = 5.0
>>> exposure.value
5.0
>>> core.getExposure() # changes reflected in core
5.0
getPropertyType
¶
getPropertyType(label: str, propName: str) -> PropertyType
Return the intrinsic property type for a given device and property.
Why Override? The returned pymmcore_plus.PropertyType enum is more
interpretable than the raw int returned by pymmcore
getPropertyUpperLimit
¶
Returns the property upper limit value, if the property has limits - 0 otherwise.
hasProperty
¶
Checks if device has a property with a specified name.
hasPropertyLimits
¶
Queries device if the specific property has limits.
isPropertyPreInit
¶
Tells us whether the property must be defined prior to initialization.
isPropertyReadOnly
¶
Tells us whether the property can be modified.
- User Guide Controlling Hardware Devices and Properties
iterProperties
¶
iterProperties(
property_type: int | Iterable[int] | None = ...,
property_name_pattern: str | Pattern | None = ...,
*,
device_type: int | Iterable[int] | None = ...,
device_label: str | Pattern | None = ...,
has_limits: bool | None = None,
is_read_only: bool | None = None,
is_sequenceable: bool | None = None,
as_object: Literal[False],
) -> Iterator[tuple[str, str]]
iterProperties(
property_type: int | Iterable[int] | None = ...,
property_name_pattern: str | Pattern | None = ...,
*,
device_type: int | Iterable[int] | None = ...,
device_label: str | Pattern | None = ...,
has_limits: bool | None = None,
is_read_only: bool | None = None,
is_sequenceable: bool | None = None,
as_object: Literal[True] = ...,
) -> Iterator[DeviceProperty]
iterProperties(
property_type: int | Iterable[int] | None = None,
property_name_pattern: str | Pattern | None = None,
*,
device_type: int | Iterable[int] | None = None,
device_label: str | Pattern | None = None,
has_limits: bool | None = None,
is_read_only: bool | None = None,
is_sequenceable: bool | None = None,
as_object: bool = True,
) -> Iterator[DeviceProperty] | Iterator[tuple[str, str]]
Iterate over currently loaded (device_label, property_name) pairs.
It offers a convenient way to iterate over loaded devices, optionally filtering
by DeviceType and/or device label. It can also
yields DeviceProperty objects if
as_object is True (the default).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
property_type
|
int | Sequence[int] | None
|
PropertyType (or types) to filter by, by default all property types will be yielded. |
None
|
property_name_pattern
|
str | Pattern | None
|
Property name to filter by, by default all property names will be yielded.
May be a compiled regular expression or a string, in which case it will be
compiled with |
None
|
device_type
|
DeviceType | None
|
DeviceType to filter by, by default all device types will be yielded. |
None
|
device_label
|
str | None
|
Device label to filter by, by default all device labels will be yielded. |
None
|
has_limits
|
bool | None
|
If provided, only properties with |
None
|
is_read_only
|
bool | None
|
If provided, only properties with |
None
|
is_sequenceable
|
bool | None
|
If provided only properties with |
None
|
as_object
|
bool
|
If |
True
|
Yields:
| Type | Description |
|---|---|
DeviceProperty | tuple[str, str]
|
|
-
API Reference
pymmcore-widgets
pymmcore_widgets PropertiesWidget APIPropertiesWidget - User Guide Controlling Hardware Devices and Properties
setProperty
¶
Set property named propName on device label to propValue.
Why Override? In MMCore, the calling of the onPropertyChanged
callback is left to the underlying device adapter, which means it is not always
called. This method overrides the default implementation to ensure that
events.propertyChanged is always emitted when setProperty has been called
and the property Value has actually changed.
updateCoreProperties
¶
Updates CoreProperties (currently all Core properties are devices types) with the loaded hardware.
Config groups & presets¶
channelGroup_pattern
property
writable
¶
channelGroup_pattern: Pattern
The regex pattern used to identify channel groups.
It is the regex used by
getOrGuessChannelGroup to
find a config group likely to be a channel group in getAvailableConfigGroups
if getChannelGroup returns None.
By default:
re.compile("(chan{1,2}(el)?|filt(er)?)s?", re.IGNORECASE)
defineConfig
¶
defineConfig(
groupName: str,
configName: str,
deviceLabel: str | None = None,
propName: str | None = None,
value: str | None = None,
) -> None
Defines a configuration.
Why Override? To emit a configDefined event. Also, if groupName is
not a defined group, then defineConfigGroup(groupName) is called.
- User Guide Controlling Hardware Configuration and Groups Defining presets
deleteConfig
¶
deleteConfig(
groupName: str,
configName: str,
deviceLabel: str | None = None,
propName: str | None = None,
) -> None
Delete configName from groupName.
Why Override? To emit a configDeleted event.
deleteConfigGroup
¶
deleteConfigGroup(groupName: str) -> None
Deletes an entire configuration group.
Why Override? To emit a configGroupDeleted event.
getAvailableConfigGroups
¶
getAvailableConfigGroups() -> tuple[ConfigGroupName, ...]
Returns the names of all defined configuration groups
getAvailableConfigs
¶
Returns all defined configuration (preset) names in a given group
getChannelGroup
¶
getChannelGroup() -> ConfigGroupName | Literal['']
Returns the group determining the channel selection.
Returns empty string if no channel group is selected.
getConfigData
¶
getConfigData(
configGroup: str, configName: str, *, native: Literal[False] = False
) -> Configuration
getConfigData(
configGroup: str, configName: str, *, native: bool = False
) -> Configuration | Configuration
Return the configuration object for a given configGroup and configName.
Why Override? The pymmcore_plus.Configuration object returned
when native=False (the default) provides a nicer Mapping interface. Pass
native=True to get the original pymmcore.Configuration object.
getConfigGroupObject
¶
getConfigGroupObject(
group_name: str, allow_missing: bool = False
) -> ConfigGroup
Return a ConfigGroup object bound to group_name on this core.
ConfigGroup objects are a convenient object
oriented way to interact with configuration groups (i.e. groups of
Configuration
Presets
in Micro-Manager). They allow you to call any method on CMMCore that normally
requires a groupName as the first argument as an argument-free method on the
ConfigGroup object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group_name
|
str
|
Configuration group name to get a config group object for. |
required |
allow_missing
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
ConfigGroup
|
|
-
API Reference
pymmcore-plus
pymmcore_plus ClassesConfigGroup - User Guide Controlling Hardware Configuration and Groups pymmcore-plus objects
getConfigGroupState
¶
getConfigGroupState(
group: str, *, native: Literal[False] = False
) -> Configuration
getConfigGroupState(
group: str, *, native: bool = False
) -> Configuration | Configuration
Return the state of the devices included in the specified group.
Why Override? The pymmcore_plus.Configuration object returned
when native=False (the default) provides a nicer Mapping interface. Pass
native=True to get the original pymmcore.Configuration object.
getConfigGroupStateFromCache
¶
getConfigGroupStateFromCache(
group: str, *, native: Literal[False] = False
) -> Configuration
getConfigGroupStateFromCache(
group: str, *, native: bool = False
) -> Configuration | Configuration
Return the state of the system cache, for the devices in the specified group.
Why Override? The pymmcore_plus.Configuration object returned
when native=False (the default) provides a nicer Mapping interface. Pass
native=True to get the original pymmcore.Configuration object.
getConfigState
¶
getConfigState(
group: str, config: str, *, native: bool = False
) -> Configuration | Configuration
Return state of devices included in the specified configuration.
Why Override? The pymmcore_plus.Configuration object returned
when native=False (the default) provides a nicer Mapping interface. Pass
native=True to get the original pymmcore.Configuration object.
getCurrentConfig
¶
Returns the current configuration (preset) for a given group.
Returns empty string if no configuration is selected.
getCurrentConfigFromCache
¶
Returns the configuration for a given group based on the data in the cache.
getOrGuessChannelGroup
¶
Get the channelGroup or find a likely set of candidates.
If the group is not defined via .getChannelGroup then likely candidates
will be found by searching for config groups with names that match this
object's channelGroup_pattern property. This is a settable property
with a default value of:
reg = re.compile("(chan{1,2}(el)?|filt(er)?)s?", re.IGNORECASE)
isConfigDefined
¶
Checks if the configuration already exists within a group.
If either the groupName or configName are not recognized, returns False.
iterConfigGroups
¶
iterConfigGroups() -> Iterator[ConfigGroup]
Iterate ConfigGroup objects for all configs.
Yields:
| Type | Description |
|---|---|
ConfigGroup
|
|
renameConfig
¶
renameConfig(
groupName: ConfigGroupName | str,
oldConfigName: ConfigPresetName | str,
newConfigName: str,
) -> None
Renames a configuration within a specified group.
The command will fail if the configuration was not previously defined.
renameConfigGroup
¶
Renames a configuration group.
setChannelGroup
¶
setChannelGroup(channelGroup: str) -> None
Specifies the group determining the channel selection.
...and send a channelGroupChanged signal.
setConfig
¶
Applies a configuration to a group.
Why Override? The native onConfigGroupChanged callback is not always
called whenever CMMCore.setConfig has been called. We override here to emit
a configSet event whenever setConfig is called.
See https://github.com/micro-manager/mmCoreAndDevices/issues/25 for details.
waitForConfig
¶
Blocks until all devices included in the configuration become ready.
Cameras¶
getCameraChannelName
¶
Returns the name of the requested channel as known by the default camera
getCameraChannelNames
¶
Convenience method to call getCameraChannelName for all camera channels.
getCameraDevice
¶
getCameraDevice() -> DeviceLabel | Literal['']
Returns the label of the currently selected camera device.
Returns empty string if no camera device is selected.
getExposure
¶
getExposure() -> float
Returns the current exposure setting of the camera in milliseconds.
getImageProcessorDevice
¶
getImageProcessorDevice() -> DeviceLabel | Literal['']
Returns the label of the currently selected image processor device.
Returns empty string if no image processor device is selected.
getMultiROI
¶
Get multiple ROIs from the current camera device.
Will fail if the camera does not support multiple ROIs. Will return empty vectors if multiple ROIs are not currently being used.
Why Override? So that the user doesn't need to pass in four empty pymmcore.UnsignedVector() objects.
getNumberOfCameraChannels
¶
getNumberOfCameraChannels() -> int
Returns the number of simultaneous channels the default camera is returning.
getNumberOfComponents
¶
getNumberOfComponents() -> int
Returns the number of components the default camera is returning.
getPhysicalCameraDevice
¶
Return the name of the actual camera device for a given channel index.
This method is new in
CMMCorePlus. It provides a convenience
for accessing the name of the actual camera device when using the multi-camera
utility.
getROI
¶
getROI(label: DeviceLabel | str) -> Rectangle
Return the current hardware region of interest for a camera.
If multiple ROIs are set, this method instead returns a rectangle that describes the image that the camera will generate. The coordinates are in units of binned pixels. That is, conceptually, binning is applied before the ROI.
Returns [0,0,0,0] if no camera is selected.
isMultiROIEnabled
¶
isMultiROIEnabled() -> bool
Queries the camera to determine if multiple ROIs are currently set.
isMultiROISupported
¶
isMultiROISupported() -> bool
Queries the camera to determine if it supports multiple ROIs.
setCameraDevice
¶
setCameraDevice(cameraLabel: DeviceLabel | str) -> None
Sets the current camera device.
setExposure
¶
setExposure(exp: float) -> None
Sets the exposure setting of the current camera in milliseconds.
setImageProcessorDevice
¶
setImageProcessorDevice(procLabel: DeviceLabel | str) -> None
Sets the current image processor device.
setMultiROI
¶
setMultiROI(
xs: Sequence[int],
ys: Sequence[int],
widths: Sequence[int],
heights: Sequence[int],
) -> None
Set multiple ROIs for the current camera device.
Will fail if the camera does not support multiple ROIs, any widths or heights are non-positive, or if the vectors do not all have the same length.
setROI
¶
setROI(*args: Any) -> None
Set the camera Region of Interest (ROI).
Why Override? To emit a roiSet event.
Images & buffer¶
fixImage
¶
Fix img shape/dtype based on self.getNumberOfComponents().
convert images with n_components > 1
to a shape (w, h, num_components) and dtype img.dtype.itemsize//ncomp
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
img
|
ndarray
|
input image |
required |
ncomponents
|
int
|
number of components in the image, by default |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
output image (possibly new shape and dtype) |
getBufferFreeCapacity
¶
getBufferFreeCapacity() -> int
Returns the number of images that can be added to the buffer without overflowing.
getBufferTotalCapacity
¶
getBufferTotalCapacity() -> int
Returns the total number of images that can be stored in the buffer
getCircularBufferMemoryFootprint
¶
getCircularBufferMemoryFootprint() -> int
Returns the size of the Circular Buffer in MB
getImage
¶
Return the internal image buffer.
Why Override? To fix the shape of images with n_components > 1 (like RGB images)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
numChannel
|
int
|
The camera channel to get the image from. If None, (the default), then Multi-Channel cameras will return the content of the first channel. |
None
|
fix
|
bool
|
If |
True
|
getImageBitDepth
¶
getImageBitDepth() -> int
How many bits of dynamic range are to be expected from the camera.
getLastImageAndMD
¶
getLastImageAndMD(
channel: int | None = None, slice: int | None = None, *, fix: bool = True
) -> tuple[ndarray, Metadata]
Return last image from the circular buffer along with metadata.
This is a convenience method that is very similar to getLastImageMD, except
that it doesn't require instantiating a MetaData object first. It returns a
tuple containing the image and a pymmcore_plus.Metadata object.
It also adds a fix parameter, which reshapes multi-component
images (like RGB images) to (w, h, n_components) using
fixImage by default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
int
|
Channel index, by default None |
None
|
slice
|
int
|
Slice index, by default None |
None
|
fix
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, Metadata]
|
Image and metadata |
getLastImageMD
¶
getLastImageMD(md: Metadata) -> ndarray
Returns a pointer to the pixels of the image that was last inserted into the circular buffer. Also provides all metadata associated with that image
getNBeforeLastImageAndMD
¶
Return image taken n images ago along with associated metadata.
This is a convenience method that is very similar to getNBeforeLastImageMD,
except that it doesn't require instantiating a MetaData object first. It
returns a tuple containing the image and a pymmcore_plus.Metadata object.
It also adds a fix parameter, which reshapes multi-component
images (like RGB images) to (w, h, n_components) using
fixImage by default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The number of images ago to retrieve. 0 is the last image, 1 is the image before that, etc. |
required |
fix
|
bool
|
If |
True
|
getNBeforeLastImageMD
¶
Returns a pointer to the pixels of the image that was inserted n images ago. Also provides all metadata associated with that image
getRemainingImageCount
¶
getRemainingImageCount() -> int
Returns number ofimages available in the Circular Buffer
getTaggedImage
¶
getTaggedImage(channel_index: int = 0) -> TaggedImage
Return getImage as named tuple with metadata.
This method is new in
CMMCorePlus. It returns an object
similar to MMCoreJ.getTaggedImage().
getTags
¶
Return a dict of metadata tags for the state of the core.
NOTE: this function is pretty slow, and is potentially called on every frame of an acquisition. It would be nice to determine what is absolutely necessary, and possible allow the user to specify what they want to include.
This method is new in
CMMCorePlus. It returns only the .tags
attribute of what you would get with getTaggedImage() or
popNextTaggedImage().
initializeCircularBuffer
¶
Initialize circular buffer based on the current camera settings.
isBufferOverflowed
¶
isBufferOverflowed() -> bool
Indicates whether the circular buffer is overflowed
isSequenceRunning
¶
isSequenceRunning() -> bool
Check if the current camera is acquiring the sequence.
Returns false when the sequence is done
popNextImage
¶
Gets and removes the next image from the circular buffer.
Why Override? to add the fix parameter, which reshapes multi-component
images (like RGB images) to (w, h, n_components) using
fixImage by default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fix
|
bool
|
If |
True
|
popNextImageAndMD
¶
popNextImageAndMD(
channel: int = 0, slice: int = 0, *, fix: bool = True
) -> tuple[ndarray, Metadata]
Gets and removes the next image (and metadata) from the circular buffer.
This is a convenience method that is very similar to popNextImageMD, except
that it doesn't require instantiating a MetaData object first. It returns a
tuple containing the image and a pymmcore_plus.Metadata object.
It also adds a fix parameter, which reshapes multi-component
images (like RGB images) to (w, h, n_components) using
fixImage by default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
int
|
Channel index, by default None |
0
|
slice
|
int
|
Slice index, by default None |
0
|
fix
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, Metadata]
|
Image and metadata |
popNextImageMD
¶
popNextImageMD(md: Metadata) -> ndarray
Gets and removes the next image (and metadata) from the circular buffer
popNextTaggedImage
¶
popNextTaggedImage(channel_index: int = 0) -> TaggedImage
Return popNextImageAndMD as named tuple with metadata.
This method is new in
CMMCorePlus. It returns an object
similar to MMCoreJ.popNextTaggedImage().
prepareSequenceAcquisition
¶
prepareSequenceAcquisition(cameraLabel: DeviceLabel | str) -> None
Prepare the camera for the sequence acquisition to save the time in the
StartSequenceAcqusition() call which is supposed to come next.
setCircularBufferMemoryFootprint
¶
setCircularBufferMemoryFootprint(sizeMB: int) -> None
Reserve memory for the circular buffer.
snap
¶
Snap and return an image.
Convenience for calling self.snapImage() followed by returning the value
of self.getImage().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
numChannel
|
int
|
The camera channel to get the image from. If None, (the default), then Multi-Channel cameras will return the content of the first channel. |
None
|
fix
|
bool
|
If |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
img |
ndarray
|
|
snapImage
¶
Acquires a single image with current settings.
Why Override? To emit the imageSnapped event after snapping an image,
and to emit shutter property changes if getAutoShutter is True.
startContinuousSequenceAcquisition
¶
startContinuousSequenceAcquisition(intervalMs: float = 0) -> None
Start a ContinuousSequenceAcquisition.
Why Override? To emit the continuousSequenceAcquisitionStarting and
continuousSequenceAcquisitionStarted events.
startSequenceAcquisition
¶
startSequenceAcquisition(*args: Any) -> None
Starts streaming camera sequence acquisition.
This command does not block the calling thread for the duration of the acquisition.
Why Override? To emit the sequenceAcquisitionStarting and
sequenceAcquisitionStarted events.
stopSequenceAcquisition
¶
stopSequenceAcquisition(cameraLabel: str | None = None) -> None
Stops streaming camera sequence acquisition.
(for a specified camera if cameraLabel is provided.)
Why Override? To emit a sequenceAcquisitionStopped event.
Stages¶
getFocusDevice
¶
getFocusDevice() -> DeviceLabel | Literal['']
Returns the label of the currently selected focus device.
Returns empty string if no focus device is selected.
getFocusDirection
¶
getFocusDirection(stageLabel: str) -> FocusDirection
Return the focus direction of a stage.
Why Override? The returned pymmcore_plus.FocusDirection enum is more
interpretable than the raw int returned by pymmcore
getPosition
¶
getPosition() -> float
Returns the current position of the current FocusDevice in microns.
getXPosition
¶
getXPosition() -> float
Obtains the current position of the X axis of the XY stage in microns.
getXYStageDevice
¶
getXYStageDevice() -> DeviceLabel | Literal['']
Returns the label of the currently selected XYStage device.
Returns empty string if no XYStage device is selected.
getYPosition
¶
getYPosition() -> float
Obtains the current position of the Y axis of the XY stage in microns.
getZPosition
¶
getZPosition() -> float
Obtains the current position of the Z axis of the Z stage in microns.
This method is new in
CMMCorePlus:
added to complement getXPosition and getYPosition
Note
This is simply an alias for getPosition], which returns the position of
the current focus device when called without arguments.
home
¶
home(xyOrZStageLabel: DeviceLabel | str) -> None
Perform a hardware homing operation for an XY or focus/Z stage.
isStageUsingCallbacks
¶
Queries whether the stage uses callbacks to signal position changes.
isXYStageUsingCallbacks
¶
Queries whether the XY stage uses callbacks to signal position changes.
setAdapterOrigin
¶
setAdapterOrigin(newZUm: float) -> None
setAdapterOrigin(newZUm: float) -> None
Enable software translation of coordinates for the current focus/Z stage.
setAdapterOriginXY
¶
Enable software translation of coordinates for the current XY stage.
The current position of the stage becomes (newXUm, newYUm). It is recommended that setOriginXY() be used instead where available.
setFocusDevice
¶
setFocusDevice(focusLabel: str) -> None
Set the current Focus Device and emit a propertyChanged signal.
setFocusDirection
¶
Set the focus direction of a stage.
setOrigin
¶
setOrigin(stageLabel: DeviceLabel | str) -> None
Zero the current focus/Z stage's coordinates at the current position.
setOriginX
¶
setOriginX(xyStageLabel: DeviceLabel | str) -> None
Zero the given XY stage's X coordinate at the current position.
setOriginXY
¶
setOriginXY(xyStageLabel: DeviceLabel | str) -> None
Zero the current XY stage's coordinates at the current position.
setOriginY
¶
setOriginY(xyStageLabel: DeviceLabel | str) -> None
Zero the given XY stage's Y coordinate at the current position.
setPosition
¶
setPosition(position: float) -> None
setPosition(position: float) -> None
Sets the position of the current FocusDevice in microns.
setRelativePosition
¶
setRelativePosition(d: float) -> None
setRelativePosition(d: float) -> None
Sets the relative position of the stage in microns.
setRelativeXYZPosition
¶
Sets the relative XYZ position in microns.
This is a convenience method that calls setXYPosition and setZPosition
with the current position as the starting point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dx
|
float
|
The relative change in X position, by default 0 |
0
|
dy
|
float
|
The relative change in Y position, by default 0 |
0
|
dz
|
float
|
The relative change in Z position, by default 0 |
0
|
setXYPosition
¶
setXYPosition(*args: Any) -> None
Sets the position of the XY stage in microns.
Why Override? to store the last commanded stage position internally.
setXYStageDevice
¶
setXYStageDevice(xyStageLabel: DeviceLabel | str) -> None
Sets the current XY device.
setZPosition
¶
setZPosition(val: float) -> None
Set the position of the current focus device in microns.
This method is new in
CMMCorePlus:
added to complement setXYPosition
Note
This is simply an alias for setPosition, which returns the position of the
current focus device when called with a single argument.
Shutters¶
getShutterDevice
¶
getShutterDevice() -> DeviceLabel | Literal['']
Returns the label of the currently selected shutter device.
Returns empty string if no shutter device is selected.
getShutterOpen
¶
getShutterOpen() -> bool
Returns the state of the currently selected (default) shutter.
setAutoShutter
¶
setAutoShutter(state: bool) -> None
Set shutter to automatically open and close when an image is acquired.
Why Override? To emit an autoShutterSet event.
setShutterDevice
¶
setShutterDevice(shutterLabel: DeviceLabel | str) -> None
the current shutter device.
setShutterOpen
¶
setShutterOpen(*args: Any) -> None
Open or close the currently selected or shutterLabel shutter.
Why Override? To emit a propertyChanged event.
State devices¶
defineStateLabel
¶
Defines a label for the specific state.
getNumberOfStates
¶
Returns the total number of available positions (states).
getState
¶
Returns the current state (position) on the specific device.
getStateFromLabel
¶
Obtain the state for a given label.
getStateLabel
¶
getStateLabel(stateDeviceLabel: DeviceLabel | str) -> StateLabel
Returns the current state as the label (string).
getStateLabels
¶
Return labels for all states
guessObjectiveDevices
¶
Find any loaded devices that are likely to be an Objective/Nosepiece.
Likely matches are loaded StateDevices with names that match this object's
objective_device_pattern property. This is a settable property
with a default value of::
re.compile("(.+)?(nosepiece|obj(ective)?)(turret)?s?", re.IGNORECASE)
objective_device_pattern
property
writable
¶
objective_device_pattern: Pattern
Pattern used to guess objective device labels.
It is the regex used by
guessObjectiveDevices to
find any devices that are likely to be objective devices.
By default:
re.compile("(.+)?(nosepiece|obj(ective)?)(turret)?s?", re.IGNORECASE)
setState
¶
Set state (by position) on stateDeviceLabel, with reliable event emission.
Why Override? In MMCore, the calling of the onPropertyChanged
callback is left to the underlying device adapter, which means it is not always
called. This method overrides the default implementation to ensure that
events.propertyChanged is always emitted when setProperty has been called
and the property Value has actually changed.
setStateLabel
¶
Set state (by label) on stateDeviceLabel, with reliable event emission.
Why Override? In MMCore, the calling of the onPropertyChanged
callback is left to the underlying device adapter, which means it is not always
called. This method overrides the default implementation to ensure that
events.propertyChanged is always emitted when setProperty has been called
and the property Value has actually changed.
Autofocus¶
enableContinuousFocus
¶
enableContinuousFocus(enable: bool) -> None
Enables or disables the operation of the continuous focusing hardware device.
fullFocus
¶
Performs focus acquisition and lock for the one-shot focusing device.
getAutoFocusDevice
¶
getAutoFocusDevice() -> DeviceLabel | Literal['']
Returns the label of the currently selected auto-focus device.
Returns empty string if no auto-focus device is selected.
getAutoFocusOffset
¶
getAutoFocusOffset() -> float
Return the current offset of the one-shot focusing device.
Why Override? For known autofocus devices with a separate offset device
(see setAutoFocusOffset),
this returns the position of that offset device.
getCurrentFocusScore
¶
getCurrentFocusScore() -> float
Returns the focus score from the default focusing device measured at the current Z position.
getLastFocusScore
¶
getLastFocusScore() -> float
Returns the latest focus score from the focusing device.
incrementalFocus
¶
Performs incremental focus for the one-shot focusing device.
isContinuousFocusDrive
¶
Check if a stage has continuous focusing capability.
(positions can be set while continuous focus runs).
isContinuousFocusEnabled
¶
isContinuousFocusEnabled() -> bool
Checks if the continuous focusing hardware device is ON or OFF.
isContinuousFocusLocked
¶
isContinuousFocusLocked() -> bool
Returns the lock-in status of the continuous focusing device.
setAutoFocusDevice
¶
setAutoFocusDevice(focusLabel: DeviceLabel | str) -> None
Sets the current auto-focus device.
setAutoFocusOffset
¶
setAutoFocusOffset(offset: float) -> None
Applies offset the one-shot focusing device.
In micro-manager, there is some variability in the way that autofocus devices
are implemented. Some have a separate offset device, while others can directly
set the offset of an associated device. As a result, calling
setAutoFocusOffset, may or may not do anything depending on the current
autofocus device.
This method attempts to detect known autofocus devices that have a separate offset device, and for those it also sets the position of the offset device.
Pixel size¶
definePixelSizeConfig
¶
definePixelSizeConfig(resolutionID: str) -> None
Defines an empty pixel size entry.
Why Override? To emit a pixelSizeChanged event.
- User Guide Controlling Hardware Configuration and Groups Defining presets
deletePixelSizeConfig
¶
deletePixelSizeConfig(resolutionID: str) -> None
Delete the pixel size configuration for the given resolutionID.
Why Override? To emit a pixelSizeChanged event.
getAvailablePixelSizeConfigs
¶
getAvailablePixelSizeConfigs() -> tuple[PixelSizeConfigName, ...]
Returns all defined resolution preset names
getCurrentPixelSizeConfig
¶
getCurrentPixelSizeConfig(cached: bool) -> PixelSizeConfigName
Get the current pixel configuration name
- User Guide Controlling Hardware Configuration and Groups Defining presets
getMagnificationFactor
¶
getMagnificationFactor() -> float
Returns the product of all Magnifiers in the system or 1.0 when none is found. This is used internally by GetPixelSizeUm
getPixelSizeAffine
¶
getPixelSizeAffine(cached: bool) -> AffineTuple
Returns the current Affine Transform to related camera pixels with stage movement.
getPixelSizeAffineByID
¶
getPixelSizeAffineByID(resolutionID: PixelSizeConfigName | str) -> AffineTuple
Returns the Affine Transform to related camera pixels with stage movement for the requested pixel size group. The raw affine transform without correction for binning and magnification will be returned.
getPixelSizeConfigData
¶
getPixelSizeConfigData(
configName: str, *, native: Literal[False] = False
) -> Configuration
getPixelSizeConfigData(
configName: str, *, native: bool = False
) -> Configuration | Configuration
Return the configuration object for a given pixel size preset configName.
Why Override? The pymmcore_plus.Configuration object returned
when native=False (the default) provides a nicer Mapping interface. Pass
native=True to get the original pymmcore.Configuration object.
-
API Reference
pymmcore-plus
pymmcore_plus ClassesConfiguration - User Guide Controlling Hardware Configuration and Groups Defining presets
getPixelSizedxdz
¶
getPixelSizedxdz() -> float
getPixelSizedxdz() -> float
Returns the angle between the camera's x axis and the axis (direction) of the z drive.
This angle is dimensionless (i.e. the ratio of the translation in x caused by a translation in z, i.e. dx / dz). This angle can be different for different z drives (if there are multiple Z drives in the system, please add the Core-Focus device to the pixel size configuration). See: https://github.com/micro-manager/micro-manager/issues/1984
getPixelSizedydz
¶
getPixelSizedydz() -> float
getPixelSizedydz() -> float
Returns the angle between the camera's y axis and the axis (direction) of the z drive.
This angle is dimensionless (i.e. the ratio of the translation in x caused by a translation in z, i.e. dy / dz). This angle can be different for different z drives (if there are multiple Z drives in the system, please add the Core-Focus device to the pixel size configuration). See: https://github.com/micro-manager/micro-manager/issues/1984
getPixelSizeOptimalZUm
¶
getPixelSizeOptimalZUm() -> float
getPixelSizeOptimalZUm() -> float
Returns the optimal z step size in um, optionally using cached pixel configuration.
There is no magic to this number, but lets the system configuration communicate to the end user what the optimal Z step size is for this pixel size configuration
getPixelSizeUm
¶
getPixelSizeUm() -> float
Returns the current pixel size in microns.
- User Guide Controlling Hardware Configuration and Groups Defining presets
getPixelSizeUmByID
¶
Returns the pixel size in um for the requested pixel size group
isPixelSizeConfigDefined
¶
Checks if the Pixel Size Resolution already exists
renamePixelSizeConfig
¶
Renames a pixel size configuration.
setPixelSizeAffine
¶
Sets the raw affine transform for the specific pixel size configuration.
The affine transform consists of the first two rows of a 3x3 matrix, the third row is always assumed to be 0.0 0.0 1.0.
setPixelSizeConfig
¶
setPixelSizeConfig(resolutionID: PixelSizeConfigName | str) -> None
Applies a Pixel Size Configuration.
setPixelSizedxdz
¶
Sets the pixel size in the X direction in microns.
setPixelSizedydz
¶
Sets the pixel size in the Y direction in microns.
setPixelSizeOptimalZUm
¶
Sets the pixel size in the Z direction in microns.
setPixelSizeUm
¶
Set pixel size in microns for the specified resolutionID.
Why Override? To emit a pixelSizeChanged event.
Hardware sequencing¶
canSequenceEvents
¶
Check whether two useq.MDAEvent are sequenceable by this core instance.
Deprecated
canSequenceEvents is deprecated. To see how this core will combine a
list of events into SequencedEvent
objects, use
iter_sequenced_events:
list(iter_sequenced_events(core, [e1, e2])).
Micro-Manager calls hardware triggering "sequencing". Two events can be sequenced if all device properties that are changing between the first and second event support sequencing.
If cur_length is provided, it is used to determine if the sequence is
"full" (i.e. the sequence is already at the maximum length) as determined by
the ...SequenceMaxLength() method corresponding to the device property.
See: https://micro-manager.org/Hardware-based_Synchronization_in_Micro-Manager
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
e1
|
MDAEvent
|
The first event. |
required |
e2
|
MDAEvent
|
The second event. |
required |
cur_length
|
int
|
The current length of the sequence. Used when checking
|
-1
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the events can be sequenced, False otherwise. |
Examples:
Note
The results here will depend on the current state of the core and devices.
>>> from useq import MDAEvent
>>> core = CMMCorePlus.instance()
>>> core.loadSystemConfiguration()
>>> core.canSequenceEvents(MDAEvent(), MDAEvent())
True
>>> core.canSequenceEvents(MDAEvent(x_pos=1), MDAEvent(x_pos=2))
False
>>> core.canSequenceEvents(
... MDAEvent(channel={'config': 'DAPI'}),
... MDAEvent(channel={'config': 'FITC'})
... )
False
getExposureSequenceMaxLength
¶
Gets the maximum length of a camera's exposure sequence.
getPropertySequenceMaxLength
¶
Queries device property for the maximum number of events that can be put in a sequence
getStageSequenceMaxLength
¶
Gets the maximum length of a stage's position sequence.
getXYStageSequenceMaxLength
¶
Gets the maximum length of an XY stage's position sequence.
isExposureSequenceable
¶
Queries camera if exposure can be used in a sequence
- User Guide Running Acquisitions The Acquisition Engine Hardware-triggered sequences
isPropertySequenceable
¶
Queries device if the specified property can be used in a sequence
-
User Guide
- Controlling Hardware Devices and Properties
- Running Acquisitions The Acquisition Engine Hardware-triggered sequences
isStageLinearSequenceable
¶
Queries if the stage can be used in a linear sequence.
A linear sequence is defined by a stepsize and number of slices
isStageSequenceable
¶
Queries stage if it can be used in a sequence
- User Guide Running Acquisitions The Acquisition Engine Hardware-triggered sequences
isXYStageSequenceable
¶
Queries XY stage if it can be used in a sequence
- User Guide Running Acquisitions The Acquisition Engine Hardware-triggered sequences
loadExposureSequence
¶
loadExposureSequence(
cameraLabel: DeviceLabel | str, exposureSequence_ms: Sequence[float]
) -> None
Transfer a sequence of exposure times to the camera.
loadPropertySequence
¶
loadPropertySequence(
label: DeviceLabel | str,
propName: PropertyName | str,
eventSequence: Sequence[str],
) -> None
Transfer a sequence of events/states/whatever to the device.
This should only be called for device-properties that are sequenceable
loadStageSequence
¶
Transfer a sequence of events/states/whatever to the device.
This should only be called for device-properties that are sequenceable
loadXYStageSequence
¶
loadXYStageSequence(
xyStageLabel: DeviceLabel | str,
xSequence: Sequence[float],
ySequence: Sequence[float],
) -> None
Transfer a sequence of stage positions to the xy stage.
xSequence and ySequence must have the same length. This should only be called for XY stages that are sequenceable
setStageLinearSequence
¶
Loads a linear sequence (defined by stepsize and nr. of steps) into the device.
startExposureSequence
¶
startExposureSequence(cameraLabel: DeviceLabel | str) -> None
Starts an ongoing sequence of triggered exposures in a camera.
This should only be called for cameras where exposure time is sequenceable
startPropertySequence
¶
Starts an ongoing sequence of triggered events in a property of a device.
This should only be called for device-properties that are sequenceable
startStageSequence
¶
startStageSequence(stageLabel: DeviceLabel | str) -> None
Starts an ongoing sequence of triggered events in a stage.
This should only be called for stages
startXYStageSequence
¶
startXYStageSequence(xyStageLabel: DeviceLabel | str) -> None
Starts an ongoing sequence of triggered events in an XY stage.
This should only be called for stages
stopExposureSequence
¶
stopExposureSequence(cameraLabel: DeviceLabel | str) -> None
Stops an ongoing sequence of triggered exposures in a camera.
This should only be called for cameras where exposure time is sequenceable
stopPropertySequence
¶
Stops an ongoing sequence of triggered events in a property of a device.
This should only be called for device-properties that are sequenceable
stopStageSequence
¶
stopStageSequence(stageLabel: DeviceLabel | str) -> None
Stops an ongoing sequence of triggered events in a stage.
This should only be called for stages that are sequenceable
stopXYStageSequence
¶
stopXYStageSequence(xyStageLabel: DeviceLabel | str) -> None
Stops an ongoing sequence of triggered events in an XY stage.
This should only be called for stages that are sequenceable
Logging & errors¶
enableDebugLog
¶
enableDebugLog(enable: bool) -> None
Enable or disable logging of debug messages.
- User Guide Troubleshooting Logging Customizing logging
enableFeature
¶
Enable or disable the given Core feature.
Core features control whether experimental functionality (which is subject to breaking changes) is exposed, or whether stricter API usage is enforced.
Currently switchable features:
- "StrictInitializationChecks" (default: disabled) When enabled, an exception is thrown when an operation requiring an initialized device is attempted on a device that is not successfully initialized. When disabled, no exception is thrown and a warning is logged (and the operation may potentially cause incorrect behavior or a crash).
- "ParallelDeviceInitialization" (default: enabled) When enabled, serial ports are initialized in serial order, and all other devices are in parallel, using multiple threads, one per device module. Early testing shows this to be reliable, but switch this off when issues are encountered during device initialization.
enableStderrLog
¶
enableStderrLog(enable: bool) -> None
Enables or disables log message display on the standard console.
getCoreErrorText
¶
Returns a pre-defined error test with the given error code
getPrimaryLogFile
¶
getPrimaryLogFile() -> str
Return the name of the primary Core log file.
isFeatureEnabled
¶
Return whether the given Core feature is currently enabled.
See enableFeature() for the available features.
Raises RuntimeError if the feature name is not recognized.
setPrimaryLogFileRotation
¶
Set the primary log file rotation parameters.
setPrimaryLogLevel
¶
Set the log level for the primary log file.
- User Guide Troubleshooting Logging Customizing logging
stopSecondaryLogFile
¶
stopSecondaryLogFile(handle: int) -> None
Stop capturing logging output into an additional file.
SLMs¶
displaySLMImage
¶
displaySLMImage(slmLabel: DeviceLabel | str) -> None
Display the waiting image on the SLM.
getSLMBytesPerPixel
¶
Returns the number of bytes per SLM pixel
getSLMDevice
¶
getSLMDevice() -> DeviceLabel | Literal['']
Returns the label of the currently selected SLM device.
Returns empty string if no SLM device is selected.
getSLMExposure
¶
Returns the exposure time that will be used by the SLM for illumination
getSLMHeight
¶
Returns the height (in "pixels") of the SLM
getSLMNumberOfComponents
¶
Returns the number of components (usually these depict colors) of the SLM.
For instance, an RGB projector will return 3, but a grey scale SLM returns 1
getSLMSequenceMaxLength
¶
For SLMs that support sequences, returns the maximum length of the sequence that can be uploaded to the device
getSLMWidth
¶
Returns the width (in "pixels") of the SLM
loadSLMSequence
¶
Load a sequence of images into the SLM
setSLMExposure
¶
For SLM devices with build-in light source (such as projectors), this will set the exposure time, but not (yet) start the illumination
setSLMImage
¶
Write an image to the SLM .
When passing a numpy array, pixels must be one of the following:
- a 2D numpy array [h,w] of uint8s, representing a grayscale image to write to the SLM.
- a 3D numpy array [h,w,3] of uint8s with 3 color channels [R,G,B], representing an imgRGB32 image to write to the SLM.
In both cases, the dimensions of the array should match the width and height of the SLM.
Warning
SLM might convert grayscale to binary internally.
startSLMSequence
¶
startSLMSequence(slmLabel: DeviceLabel | str) -> None
Starts the sequence previously uploaded to the SLM
stopSLMSequence
¶
stopSLMSequence(slmLabel: DeviceLabel | str) -> None
Stops the SLM sequence if previously started
Galvos¶
addGalvoPolygonVertex
¶
Add a vertex to a galvo polygon.
deleteGalvoPolygons
¶
deleteGalvoPolygons(galvoLabel: DeviceLabel | str) -> None
Remove all added polygons
getGalvoChannel
¶
Get the name of the active galvo channel (for a multi-laser galvo device).
getGalvoDevice
¶
getGalvoDevice() -> DeviceLabel | Literal['']
Returns the label of the currently selected Galvo device.
Returns empty string if no Galvo device is selected.
loadGalvoPolygons
¶
loadGalvoPolygons(galvoLabel: DeviceLabel | str) -> None
Load a set of galvo polygons to the device
pointGalvoAndFire
¶
Set the Galvo to an x,y position and fire the laser for a predetermined duration.
runGalvoPolygons
¶
runGalvoPolygons(galvoLabel: DeviceLabel | str) -> None
Run a loop of galvo polygons
runGalvoSequence
¶
runGalvoSequence(galvoLabel: DeviceLabel | str) -> None
Run a sequence of galvo positions
setGalvoDevice
¶
setGalvoDevice(galvoLabel: DeviceLabel | str) -> None
Sets the current galvo device.
setGalvoIlluminationState
¶
Set the galvo's illumination state to on or off
setGalvoPolygonRepetitions
¶
Set the number of times to loop galvo polygons
setGalvoPosition
¶
Set the Galvo to an x,y position.
setGalvoSpotInterval
¶
Set the SpotInterval for the specified galvo device.
Serial ports¶
getSerialPortAnswer
¶
Continuously read from the serial port until the terminating sequence is encountered.
readFromSerialPort
¶
Reads the contents of the Rx buffer.
setSerialPortCommand
¶
Send string to the serial device and return an answer.
setSerialProperties
¶
setSerialProperties(
portName: str,
answerTimeout: str,
baudRate: str,
delayBetweenCharsMs: str,
handshaking: str,
parity: str,
stopBits: str,
) -> None
Sets all com port properties in a single call.
writeToSerialPort
¶
Sends an array of characters to the serial port and returns immediately.
Pumps¶
getPumpFlowrate
¶
Return the flowrate of the pump in uL per second
getPumpPressureKPa
¶
Return the pressure of the pump in kPa.
invertPumpDirection
¶
Sets whether the pump direction needs to be inverted
isPumpDirectionInverted
¶
Return True if pump direction needs to be inverted
pressurePumpRequiresCalibration
¶
Return True if pump requires calibration before operation.
pumpDispenseDurationSeconds
¶
Dispenses for the provided duration (in seconds) at the set flowrate.
pumpDispenseVolumeUl
¶
Dispenses the provided volume (in uL) at the set flowrate.
pumpStart
¶
pumpStart(pumpLabel: str) -> None
Start dispensing until syringe is empty, or manually stopped.
(whichever occurs first).
setPumpFlowrate
¶
Set the flowrate of the pump in uL per second
setPumpMaxVolume
¶
Set the max volume of the pump in uL
setPumpPressureKPa
¶
Sets the pressure of the pump in kPa.
setPumpVolume
¶
Sets the volume of fluid in the pump in uL.
Note it does not withdraw upto this amount. It is merely to inform MM of the volume in a prefilled pump.
volumetricPumpRequiresHoming
¶
Return True if the volumetric pump requires homing.
Typed dictionaries¶
These are the return types of getDeviceSchema.