Skip to content

Bridge

Bases: object

The Bridge class is the main class of The Inscoper API.

It is the entry point for most applications.

__init__()

Default constructor.

Constructs the Bridge object.

setLibraryPaths(libraryPaths)

Set the library paths where to find external libraries (MicroManager, Custom driver etc).

Sets the paths to search for external libraries.

Parameters:

Name Type Description Default
libraryPaths list[string]

The list of library paths

required

loadConfigFile(*args)

Load configuration based on its file path.

Loads the configuration from the specified file path.

Parameters:

Name Type Description Default
path string

The directory path where the file config.xml is located

required

Raises:

Type Description
InscoperException

if an error occurred

readConfigFile(*args)

Read the configuration file and return the corresponding configuration.

Reads and parses the configuration file.

Parameters:

Name Type Description Default
path string

The directory path where the file config.xml is located

required

Returns:

Type Description
Config

The configuration

Raises:

Type Description
InscoperException

if an error occurred

loadConfig(config)

Load the configuration.

Loads the provided configuration.

Parameters:

Name Type Description Default
config Config

The configuration

required

Raises:

Type Description
InscoperException

if an error occurred

saveConfig(path, config)

Save the configuration to an XML file.

Saves the provided configuration to the specified path.

Parameters:

Name Type Description Default
path string

The path where, to save the configuration. The path could be either the directory path of XML file (in this case, the XML file name will be 'config.xml') or the XML file itself

required
config Config

The configuration to save

required

Raises:

Type Description
InscoperException

if an error occurred

saveCurrentConfig(*args)

Save the current loaded configuration to an XML file.

Saves the currently loaded configuration to the specified path.

Parameters:

Name Type Description Default
path string

The path where, to save the configuration. The path could be either the directory path of XML file (in this case, the XML file name will be 'config.xml') or the XML file itself

required

Raises:

Type Description
InscoperException

if an error occurred

readRecipeFile(*args)

Read the recipe file and return the list of corresponding recipes.

Parses the recipe XML file and creates a list of recipes.

Parameters:

Name Type Description Default
path string

The directory path where the file recipe.xml is located

required

Returns:

Type Description
list[Recipe]

The list of the recipes

Raises:

Type Description
InscoperException

if an error occurred

saveRecipes(path, recipes)

Save the list of recipes to an XML file.

Serializes the provided list of recipes to the specified file.

Parameters:

Name Type Description Default
path string

The path where, to save the recipes. The path could be either the directory path of XML file (in this case, the XML file name will be 'recipe.xml') or the XML file itself

required
recipes list[Recipe]

The list of the recipes

required

Raises:

Type Description
InscoperException

if an error occurred

initDevice(deviceId)

Initialize a specific device.

Initializes the device with the specified ID.

Parameters:

Name Type Description Default
deviceId string

The ID of the device to initialize

required

Raises:

Type Description
InscoperException

if an error occurred

initDevices(*args)

Overload 1:

Initialize all the loaded devices.

Iterates through all loaded devices and initializes them sequentially.

Parameters:

Name Type Description Default
deviceIdList list[string]

The list of device IDs to initialize

required

Raises:

Type Description
InscoperException

if an error occurred | Overload 2: Initialize a list of devices. Initializes the devices specified in the list sequentially.

InscoperException

if an error occurred

getLoadedDevices()

Get the list of IDs of all loaded devices.

Retrieves the IDs of devices that are currently loaded into memory.

Returns:

Type Description
list[string]

The list of device ID strings

getInitializedDevices()

Get the list of IDs of all initialized devices.

Retrieves the IDs of devices that have been successfully initialized.

Returns:

Type Description
list[string]

The list of device ID strings

getInitializedSubDeviceIds()

Get the list of sub-device IDs for all initialized sub-devices.

Retrieves the sub-device IDs for every initialized sub-device component.

Returns:

Type Description
list[SubDeviceId]

The list of sub-device IDs

closeDevice(deviceId)

Close a specific device.

Shuts down the device with the specified ID.

Parameters:

Name Type Description Default
deviceId string

The ID of the device to close

required

Returns:

Type Description
boolean

True if successful, false otherwise

closeDevices(*args)

Overload 1:

Close all the loaded devices.

Shuts down all loaded devices.

Parameters:

Name Type Description Default
deviceIdList list[string]

The list of device IDs to close

required

Returns:

Type Description
boolean

True if successful, false otherwise

Raises:

Type Description
InscoperException

if an error occurred | Overload 2: Close a list of devices. Shuts down the devices specified in the list.

close()

Close all the initialized devices, loaded drivers and more.

Performs a complete shutdown of the system, including drivers and initialized devices.

Raises:

Type Description
InscoperException

if an error occurred

getDeviceDescriptionList()

Get the device description list of all the available drivers (Inscoper Box, Micro Manager and Custom drivers).

Retrieves the descriptions for all drivers currently available in the system.

Returns:

Type Description
list[DeviceDescription]

The list of device descriptions

Raises:

Type Description
InscoperException

if an error occurred

loadDeviceDescriptionList(filename)

Load the device description list from a file.

Parses the specified file to load device descriptions.

Parameters:

Name Type Description Default
filename string

The path to the file containing device descriptions

required

Returns:

Type Description
list[DeviceDescription]

The list of device descriptions

Raises:

Type Description
InscoperException

if an error occurred

saveDeviceDescriptionList(deviceDescriptionList, filename)

Save the device description list to a file.

Serializes the provided list of device descriptions to the specified file.

Parameters:

Name Type Description Default
deviceDescriptionList list[DeviceDescription]

The list of device descriptions to save

required
filename string

The destination file path

required

Raises:

Type Description
InscoperException

if an error occurred

loadSequence(*args)

Overload 1:

Load a sequence with user params.

Loads a sequence using the provided user parameters file.

Parameters:

Name Type Description Default
sequenceNumber int

The sequence number

required
recipeName string

The recipe name described in the recipe.xml file

required
paramsFile string

The name of the file containing user params. The file can be either a StatusList file or a Dimensions file

required
currentStatus Status

The current status of the microscope (optional)

required
printIndex int

The index for printing (default -1)

required
handler SequenceHandler

The sequence handler (optional)

required
dimensionList list[Dimension]

The list of dimensions

required
statusList list[Status]

The list of status

required

Returns:

Type Description
Status

The sequence status

Raises:

Type Description
InscoperException

if an error occurred | Overload 2: Load a sequence with dimensions. Loads a sequence using the provided list of dimensions.

InscoperException

if an error occurred | Overload 3: Load a sequence with dimensions. Loads a sequence using the provided list of dimensions.

InscoperException

if an error occurred | Overload 4: Load a sequence with dimensions. Loads a sequence using the provided list of dimensions.

InscoperException

if an error occurred | Overload 5: Load a sequence with dimensions. Loads a sequence using the provided list of dimensions.

InscoperException

if an error occurred | Overload 6: Load a sequence with status list. Loads a sequence using the provided list of statuses.

InscoperException

if an error occurred | Overload 7: Load a sequence with status list. Loads a sequence using the provided list of statuses.

InscoperException

if an error occurred | Overload 8: Load a sequence with status list. Loads a sequence using the provided list of statuses.

InscoperException

if an error occurred | Overload 9: Load a sequence with status list. Loads a sequence using the provided list of statuses.

InscoperException

if an error occurred

runSequence(sequenceNumber, _async=False)

Run a preloaded sequence.

Executes the sequence identified by the sequence number.

Parameters:

Name Type Description Default
sequenceNumber int

The sequence number to run

required
async boolean

True if you want the function to be asynchronous. You will need to call waitUntilSequenceFinished later to know when the sequence is finished

required

Raises:

Type Description
InscoperException

if an error occurred

waitUntilSequenceFinished(sequenceNumber)

Wait for the sequence to finish.

Blocks execution until the specified sequence has completed.

Parameters:

Name Type Description Default
sequenceNumber int

The sequence number

required

Raises:

Type Description
InscoperException

if an error occurred

pauseSequence(sequenceNumber)

Pause the running sequence.

Pauses the execution of the specified sequence.

Parameters:

Name Type Description Default
sequenceNumber int

The sequence number

required

Raises:

Type Description
InscoperException

if an error occurred

continueSequence(sequenceNumber)

Continue the paused sequence.

Resumes the execution of the specified sequence.

Parameters:

Name Type Description Default
sequenceNumber int

The sequence number

required

Raises:

Type Description
InscoperException

if an error occurred

stopSequence(sequenceNumber)

Stop the running sequence.

Stops the execution of the specified sequence.

Parameters:

Name Type Description Default
sequenceNumber int

The sequence number

required

Raises:

Type Description
InscoperException

if an error occurred

removeSequence(sequenceNumber)

Remove the loaded sequence.

Unloads and removes the specified sequence from memory.

Parameters:

Name Type Description Default
sequenceNumber int

The sequence number

required

Raises:

Type Description
InscoperException

if an error occurred

modifySequence(sequenceNumber, modifierIndexes)

Modify the loaded sequence.

Modifies the sequence using the specified modifier indexes.

Parameters:

Name Type Description Default
sequenceNumber int

The sequence number

required
modifierIndexes list[unsigned int]

The list of param to modify

required

Raises:

Type Description
InscoperException

if an error occurred

addBackgroundSequence(*args)

Overload 1:

Add a background sequence with params file.

Adds a background sequence using a parameters file.

Parameters:

Name Type Description Default
sequenceIndex int

The sequence number (or index)

required
recipeName string

The name of the recipe

required
paramsFile string

The path to the file containing parameters

required
dimensionList list[Dimension]

The list of dimensions for the sequence

required
statusList list[Status]

The list of statuses for the sequence

required

Returns:

Type Description
Status

The status of the newly added sequence

Raises:

Type Description
InscoperException

if an error occurred | Overload 2: Add a background sequence with dimension list. Adds a background sequence using a list of dimensions.

InscoperException

if an error occurred | Overload 3: Add a background sequence with status list. Adds a background sequence using a list of statuses.

InscoperException

if an error occurred

removeBackgroundSequence(sequenceIndex)

Remove a background sequence.

Removes the specified background sequence.

Parameters:

Name Type Description Default
sequenceIndex int

The sequence number (or index)

required

Raises:

Type Description
InscoperException

if an error occurred

addSequenceListener(listener)

Add a sequence listener to the API.

Registers a listener for sequence events.

Parameters:

Name Type Description Default
listener SequenceListener

The listener to add

required

removeSequenceListener(listener)

Remove a sequence listener from the API.

Unregisters a previously added sequence listener.

Parameters:

Name Type Description Default
listener SequenceListener

The listener to remove

required

addAbstractSubDevice(subDevice)

Add an abstract sub device.

Adds an abstract sub-device to the system.

Parameters:

Name Type Description Default
subDevice AbstractSubDevice

The abstract sub-device to add

required

Raises:

Type Description
InscoperException

if an error occurred

removeAbstractSubDevice(subDeviceId)

Remove an abstract sub device.

Removes an abstract sub-device from the system.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The ID of the sub device to remove

required

Raises:

Type Description
InscoperException

if an error occurred

getCamera(id)

Get a camera device.

Retrieves the camera device with the specified ID.

Parameters:

Name Type Description Default
id string

The camera ID

required

Returns:

Type Description
Camera

The camera

Raises:

Type Description
InscoperException

if an error occurred

isHardwareCropAvailable(id)

Check if hardware crop is available for a camera.

Determines if the specified camera supports hardware cropping.

Parameters:

Name Type Description Default
id string

The camera ID

required

Returns:

Type Description
boolean

True if hardware crop is available, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

setHardwareCrop(id, crops)

Set hardware crop for a camera.

Configures the hardware crop settings for the specified camera.

Parameters:

Name Type Description Default
id string

The camera ID

required
crops list[RoiCrop]

The list of crop regions (ROIs)

required

Raises:

Type Description
InscoperException

if an error occurred

getHardwareCrop(id)

Get the current hardware crop configuration for a camera.

Retrieves the current hardware crop settings for the specified camera.

Parameters:

Name Type Description Default
id string

The camera ID

required

Returns:

Type Description
list[RoiCrop]

The list of current crop regions (ROIs)

Raises:

Type Description
InscoperException

if an error occurred

createTimeDevice(index, startRecipeId=None, waitRecipeId=None)

Create a time device.

Creates a new time device with the specified index.

Parameters:

Name Type Description Default
index int

The index of the time device

required
startRecipeId string

The ID of the start recipe (optional)

None
waitRecipeId string

The ID of the wait recipe (optional)

None

Raises:

Type Description
InscoperException

if an error occurred

getStartTimerSubDeviceId(index)

Get the sub-device ID for the start timer.

Retrieves the sub-device ID associated with the start timer.

Parameters:

Name Type Description Default
index int

The index of the timer

required

Returns:

Type Description
SubDeviceId

The sub-device ID of the start timer

Raises:

Type Description
InscoperException

if an error occurred

getWaitTimerSubDeviceId(index)

Get the sub-device ID for the wait timer.

Retrieves the sub-device ID associated with the wait timer.

Parameters:

Name Type Description Default
index int

The index of the timer

required

Returns:

Type Description
SubDeviceId

The sub-device ID of the wait timer

Raises:

Type Description
InscoperException

if an error occurred

runDeviceDiagnosis(deviceDesc, driverConfig)

Run diagnosis on a device.

Executes a diagnosis sequence on the specified device.

Parameters:

Name Type Description Default
deviceDesc DeviceDescription

The device description

required
driverConfig DriverConfig

The driver configuration

required

Returns:

Type Description
DiagResults

The diagnosis results

Raises:

Type Description
InscoperException

if an error occurred

saveDiagResults(diagResults, filename)

Save diagnosis results to a file.

Saves the provided diagnosis results to the specified file.

Parameters:

Name Type Description Default
diagResults DiagResults

The diagnosis results to save

required
filename string

The file path to save to

required

loadDiagResults(filename)

Load diagnosis results from a file.

Loads diagnosis results from the specified file.

Parameters:

Name Type Description Default
filename string

The file path to load from

required

Returns:

Type Description
DiagResults

The loaded diagnosis results

saveDiagResultsList(diagResultsList, filename)

Save a list of diagnosis results to a file.

Saves the provided list of diagnosis results to the specified file.

Parameters:

Name Type Description Default
diagResultsList list[DiagResults]

The list of diagnosis results

required
filename string

The file path to save to

required

loadDiagResultsList(filename)

Load a list of diagnosis results from a file.

Loads a list of diagnosis results from the specified file.

Parameters:

Name Type Description Default
filename string

The file path to load from

required

Returns:

Type Description
list[DiagResults]

The list of loaded diagnosis results

getValueConditionChildren(subDeviceId, recipeName)

Get the list of child sub-device IDs for a value condition.

Retrieves the child sub-device IDs associated with a value condition.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The parent sub-device ID

required
recipeName string

The recipe name

required

Returns:

Type Description
list[SubDeviceId]

The list of child sub-device IDs

Raises:

Type Description
InscoperException

if an error occurred

getValueConditionParents(subDeviceId, recipeName)

Get the list of parent sub-device IDs for a value condition.

Retrieves the parent sub-device IDs associated with a value condition.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The child sub-device ID

required
recipeName string

The recipe name

required

Returns:

Type Description
list[SubDeviceId]

The list of parent sub-device IDs

Raises:

Type Description
InscoperException

if an error occurred

getValueConditionSiblings(subDeviceId, recipeName)

Get the list of sibling sub-device IDs for a value condition.

Retrieves the sibling sub-device IDs associated with a value condition.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required
recipeName string

The recipe name

required

Returns:

Type Description
list[SubDeviceId]

The list of sibling sub-device IDs

Raises:

Type Description
InscoperException

if an error occurred

getCallConditionSubDeviceIdList(subDeviceId, recipeName)

Get the list of sub-device IDs for a call condition.

Retrieves the sub-device IDs associated with a call condition.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required
recipeName string

The recipe name

required

Returns:

Type Description
list[SubDeviceId]

The list of sub-device IDs involved in the call condition

Raises:

Type Description
InscoperException

if an error occurred

getCustomDriverAvailableDevices(driverName)

Get available devices for a custom driver.

Retrieves the list of available devices for the specified custom driver.

Parameters:

Name Type Description Default
driverName string

The name of the custom driver

required

Returns:

Type Description
list[string]

The list of available device names

Raises:

Type Description
InscoperException

if an error occurred

addFunctionListener(*args)

Overload 1:

Add a function listener to the API.

Registers a listener for function events.

Parameters:

Name Type Description Default
listener FunctionListener

The listener to add | Overload 2: Add a function listener for a specific device. Registers a listener for function events on a specific device.

required
deviceId string

The device ID to listen to | Overload 3: Add a function listener for a specific sub-device. Registers a listener for function events on a specific sub-device.

required
subDeviceId SubDeviceId

The sub-device ID to listen to | Overload 4: Add a function listener for a specific sub-device and function type. Registers a listener for specific function types on a sub-device.

required
functionType int

The type of function to listen to

required

removeFunctionListener(listener)

Remove a function listener from the API.

Unregisters a previously added function listener.

Parameters:

Name Type Description Default
listener FunctionListener

The listener to remove

required

hasGetFunction(subDeviceId)

Check if a sub-device has a GET function.

Determines if the sub-device supports the GET operation.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
boolean

True if it has a GET function, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

hasSetFunction(subDeviceId)

Check if a sub-device has a SET function.

Determines if the sub-device supports the SET operation.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
boolean

True if it has a SET function, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

hasCheckFunction(subDeviceId)

Check if a sub-device has a CHECK function.

Determines if the sub-device supports the CHECK operation.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
boolean

True if it has a CHECK function, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

setValue(*args)

Overload 1:

Call the SET function of the sub-device without parameters.

Executes the SET command on the sub-device with no arguments.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID of the sub-device

required
value string

The string representation of the value

required

Raises:

Type Description
InscoperException

if an error occurred | Overload 2: Call the SET function of the sub-device with a string parameter. Executes the SET command on the sub-device with a string value.

InscoperException

if an error occurred | Overload 3: Call the SET function of the Sub Device with a char parameter. Executes the SET command on the sub-device with a char value.

InscoperException

if an error occurred | Overload 4: Call the SET function of the sub-device with a short parameter. Executes the SET command on the sub-device with a short value.

InscoperException

if an error occurred | Overload 5: Call the SET function of the sub-device with an int parameter. Executes the SET command on the sub-device with an int value.

InscoperException

if an error occurred | Overload 6: Call the SET function of the sub-device with an unsigned long long parameter. Executes the SET command on the sub-device with an unsigned long long value.

InscoperException

if an error occurred | Overload 7: Call the SET function of the sub-device with a long long parameter. Executes the SET command on the sub-device with a long long value.

InscoperException

if an error occurred | Overload 8: Call the SET function of the sub-device with a float parameter. Executes the SET command on the sub-device with a float value.

InscoperException

if an error occurred | Overload 9: Call the SET function of the sub-device with a double parameter. Executes the SET command on the sub-device with a double value.

InscoperException

if an error occurred

getStringValue(subDeviceId)

Call the GET function of the sub-device returning a string.

Executes the GET command on the sub-device and returns a string.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
str

The standard string value

Raises:

Type Description
InscoperException

if an error occurred

getCharValue(subDeviceId)

Call the GET function of the sub-device returning a char.

Executes the GET command on the sub-device and returns a char.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
int

The char value

Raises:

Type Description
InscoperException

if an error occurred

getShortValue(subDeviceId)

Call the GET function of the sub-device returning a short.

Executes the GET command on the sub-device and returns a short.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
int

The short value

Raises:

Type Description
InscoperException

if an error occurred

getIntValue(subDeviceId)

Call the GET function of the sub-device returning an int.

Executes the GET command on the sub-device and returns an int.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
int

The int value

Raises:

Type Description
InscoperException

if an error occurred

getUnsignedLongValue(subDeviceId)

Call the GET function of the sub-device returning an unsigned long long.

Executes the GET command on the sub-device and returns an unsigned long long.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
int

The unsigned long long int value

Raises:

Type Description
InscoperException

if an error occurred

getLongValue(subDeviceId)

Call the GET function of the sub-device returning a long long.

Executes the GET command on the sub-device and returns a long long.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
int

The long long int value

Raises:

Type Description
InscoperException

if an error occurred

getFloatValue(subDeviceId)

Call the GET function of the sub-device returning a float.

Executes the GET command on the sub-device and returns a float.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
float

The float value

Raises:

Type Description
InscoperException

if an error occurred

getDoubleValue(subDeviceId)

Call the GET function of the sub-device returning a double.

Executes the GET command on the sub-device and returns a double.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
float

The double value

Raises:

Type Description
InscoperException

if an error occurred

getValue(param)

Get the value of a status parameter.

Retrieves the value from the specified status parameter.

Parameters:

Name Type Description Default
param StatusParam

The status parameter to get the value from

required

Returns:

Type Description
StatusParam

The updated status parameter

Raises:

Type Description
InscoperException

if an error occurred

checkValue(*args)

Overload 1:

Call the CHECK function of the sub-device without parameters.

Executes the CHECK command on the sub-device with no arguments.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required
value string

The string representation of the value

required

Raises:

Type Description
InscoperException

if an error occurred | Overload 2: Call the CHECK function of the sub-device with a string parameter. Executes the CHECK command on the sub-device with a string value.

InscoperException

if an error occurred | Overload 3: Call the CHECK function of the sub-device with a char parameter. Executes the CHECK command on the sub-device with a char value.

InscoperException

if an error occurred | Overload 4: Call the CHECK function of the sub-device with a short parameter. Executes the CHECK command on the sub-device with a short value.

InscoperException

if an error occurred | Overload 5: Call the CHECK function of the sub-device with an int parameter. Executes the CHECK command on the sub-device with an int value.

InscoperException

if an error occurred | Overload 6: Call the CHECK function of the sub-device with an unsigned long long parameter. Executes the CHECK command on the sub-device with an unsigned long long value.

InscoperException

if an error occurred | Overload 7: Call the CHECK function of the sub-device with a long long parameter. Executes the CHECK command on the sub-device with a long long value.

InscoperException

if an error occurred | Overload 8: Call the CHECK function of the sub-device with a float parameter. Executes the CHECK command on the sub-device with a float value.

InscoperException

if an error occurred | Overload 9: Call the CHECK function of the sub-device with a double parameter. Executes the CHECK command on the sub-device with a double value.

InscoperException

if an error occurred

getModifiedSubDevices(deviceId)

Get the list of modified sub-devices for a loaded device.

Retrieves the list of sub-device IDs that have been modified for the specified device.

Parameters:

Name Type Description Default
deviceId string

The device ID

required

Returns:

Type Description
list[SubDeviceId]

The list of modified sub-device IDs

isAccessibleInSequence(subDeviceId)

Check if the sub-device is accessible in sequence.

Determines if the sub-device can be accessed within a sequence.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
boolean

True if accessible, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

setClampMode(clampMode)

Set clamp mode.

Enables or disables clamp mode.

Parameters:

Name Type Description Default
clampMode boolean

True to enable clamp mode, false otherwise

required

hasMaxValue(subDeviceId)

Check if the sub-device has a max value constraint.

Determines if the sub-device has a maximum value limit.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
boolean

True if it has a max value, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

hasMinValue(subDeviceId)

Check if the sub-device has a min value constraint.

Determines if the sub-device has a minimum value limit.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
boolean

True if it has a min value, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

hasStepValue(subDeviceId)

Check if the sub-device has a step value constraint.

Determines if the sub-device has a step value constraint.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
boolean

True if it has a step value, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

hasListValue(subDeviceId)

Check if the sub-device has a list value constraint.

Determines if the sub-device has a restricted list of values.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
boolean

True if it has a list value, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

isReadOnly(subDeviceId)

Check if the sub-device is read-only.

Determines if the sub-device is read-only.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
boolean

True if read-only, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

getMaxValue(subDeviceId)

Get the max value constraint of the sub-device.

Retrieves the maximum allowed value for the sub-device.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
float

The maximum value

Raises:

Type Description
InscoperException

if an error occurred

getMinValue(subDeviceId)

Get the min value constraint of the sub-device.

Retrieves the minimum allowed value for the sub-device.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
float

The minimum value

Raises:

Type Description
InscoperException

if an error occurred

getStepValue(subDeviceId)

Get the step value constraint of the sub-device.

Retrieves the step value constraint for the sub-device.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
float

The step value

Raises:

Type Description
InscoperException

if an error occurred

getListValue(subDeviceId)

Get the list of possible values (Deprecated).

Retrieves the list of allowed values for the sub-device (deprecated).

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
list[string]

The list of value strings

Raises:

Type Description
InscoperException

if an error occurred

getKeyValueMap(subDeviceId)

Get the map of key-value pairs for list constraints.

Retrieves the map of allowed key-value pairs for the sub-device.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
dict[string, string]

The map of key-value pairs

Raises:

Type Description
InscoperException

if an error occurred

getParamType(subDeviceId)

Get the parameter type of the sub-device.

Retrieves the parameter type of the sub-device.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID

required

Returns:

Type Description
int

The parameter type

Raises:

Type Description
InscoperException

if an error occurred

saveStatusListToXML(xmlfilename, statusList)

Save a list of statuses to an XML file.

Serializes the provided list of statuses to the specified XML file.

Parameters:

Name Type Description Default
xmlfilename string

The path of the xml file

required
statusList list[Status]

The status list to save

required

Raises:

Type Description
InscoperException

if an error occurred

saveDimensionListToXML(xmlfilename, dimensionList)

Save a list of dimensions to an XML file.

Serializes the provided list of dimensions to the specified XML file.

Parameters:

Name Type Description Default
xmlfilename string

The path of the xml file

required
dimensionList list[Dimension]

The dimension list to save

required

Raises:

Type Description
InscoperException

if an error occurred

getCurrentStatus(*args)

Overload 1:

Get the current status.

Retrieves the current status of the microscope.

Parameters:

Name Type Description Default
subDeviceId SubDeviceId

The sub-device ID to get status for

required
subDeviceList list[SubDeviceId]

The list of sub-devices to get status for

required
action CurrentStatusAction

The action handler to receive the status parameters

required

Returns:

Type Description
Status

The current status containing the specified sub-devices

Raises:

Type Description
InscoperException

if an error occurred | Overload 2: Get the current status for a specific sub-device. Retrieves the current status of the specified sub-device.

InscoperException

if an error occurred | Overload 3: Get the current status for a list of sub-devices. Retrieves the current status of the specified list of sub-devices.

InscoperException

if an error occurred | Overload 4: Get the current status through an action handler. Retrieves the current status using an action handler.

InscoperException

if an error occurred | Overload 5: Get the current status for a specific sub-device through an action handler. Retrieves the current status of a sub-device using an action handler.

InscoperException

if an error occurred | Overload 6: Get the current status for a list of sub-devices through an action handler. Retrieves the current status of a list of sub-devices using an action handler.

InscoperException

if an error occurred

setCurrentStatus(status, _async=False)

Set the current status.

Sets the status of the microscope.

Parameters:

Name Type Description Default
status Status

The status to set

required
async boolean

If true, set status asynchronously (default false)

required

Raises:

Type Description
InscoperException

if an error occurred

getStatusList(dimensions)

Convert a dimension list to a list of status.

Converts a list of dimensions into a list of statuses.

Parameters:

Name Type Description Default
dimensions list[Dimension]

The dimension list to convert

required

Returns:

Type Description
list[Status]

The converted status list

addImageListener(listener, cameraId=None)

Add an image listener.

Registers a listener for image events.

Parameters:

Name Type Description Default
listener ImageListener

The listener to add

required
cameraId string

The camera ID linked to the listener. If null, all cameras are linked

None

removeImageListener(*args)

Overload 1:

Remove an image listener.

Unregisters a previously added image listener.

Parameters:

Name Type Description Default
listener ImageListener

The listener to remove

required
cameraId string

The camera ID (optional) | Overload 2: Remove an image listener by camera ID. Unregisters all image listeners associated with the specified camera ID.

required

saveImages(filename, images)

Save a list of images to a file.

Saves the provided list of images to the specified file.

Parameters:

Name Type Description Default
filename string

The destination file path

required
images list[Image]

The list of images to save

required

Raises:

Type Description
InscoperException

if an error occurred

loadImages(filename)

Load a list of images from a file.

Loads a list of images from the specified file.

Parameters:

Name Type Description Default
filename string

The source file path

required

Returns:

Type Description
list[Image]

The list of loaded images

Raises:

Type Description
InscoperException

if an error occurred

getVersion()

Get the current version of the API.

Retrieves the version string of the installed API.

Returns:

Type Description
str

The current version of the API

getFirmwareVersion()

Get the Firmware version of the connected Inscoper Box if available.

Retrieves the firmware version string from the Inscoper Box.

Returns:

Type Description
str

The string containing Generic Firmware version + Library version

Raises:

Type Description
InscoperException

if an error occurred

initLogger(mode, level, filename=None, listener=None)

Init the API logger.

Initializes the logging system for the API.

Parameters:

Name Type Description Default
mode int

The log mode (can be combined with bitwise OR)

required
level int

The log Level

required
filename string

The filename of the log file if the file log mode is chosen

None
listener LogListener

The listener if the listener log mode is chosen

None

Raises:

Type Description
InscoperException

if an error occurred

setLogLevel(level)

Set the log level.

Sets the current logging level for the API.

Parameters:

Name Type Description Default
level int

The log level (TRACE, DEBUG, INFO, WARN, ERROR)

required

removeLogListener(listener)

Remove a log listener.

Unregisters a previously added log listener.

Parameters:

Name Type Description Default
listener LogListener

The listener to remove

required

getLogLevel()

Get the log level of the application.

Retrieves the current logging level of the API.

Returns:

Type Description
int

The current log level

initInscoperBoxLogger(mode, level, filename=None, listener=None)

Init the Inscoper Box logger.

Initializes the logging system for the Inscoper Box.

Parameters:

Name Type Description Default
mode int

The log mode (can be combined with bitwise OR)

required
level int

The log Level

required
filename string

The filename of the log file if the file log mode is chosen

None
listener LogListener

The listener if the listener log mode is chosen

None

Raises:

Type Description
InscoperException

if an error occurred

setInscoperBoxLogLevel(level)

Set the log level of the Inscoper Box.

Sets the logging level for the Inscoper Box firmware.

Parameters:

Name Type Description Default
level int

The log level (TRACE, DEBUG, INFO, WARN, ERROR)

required

removeInscoperBoxLogListener(listener)

Remove an Inscoper Box log listener.

Unregisters a previously added log listener for the Inscoper Box.

Parameters:

Name Type Description Default
listener LogListener

The listener to remove

required

getInscoperBoxLogLevel()

Get the log level of the Inscoper Box firmware.

Retrieves the current logging level of the Inscoper Box.

Returns:

Type Description
int

The log level

setLogDirectory(path)

Set the log directory path.

Sets the directory where log files will be stored.

Parameters:

Name Type Description Default
path string

The directory path

required

addErrorListener(listener)

Add an error listener.

Registers a listener for error events.

Parameters:

Name Type Description Default
listener ErrorListener

The listener to add

required

removeErrorListener(listener)

Remove an error listener.

Unregisters a previously added error listener.

Parameters:

Name Type Description Default
listener ErrorListener

The listener to remove

required

updateFirmware(firmwarePath)

Update the InscoperBox firmware.

Updates the firmware of the Inscoper Box using the specified file.

Parameters:

Name Type Description Default
firmwarePath string

The path to the new firmware file

required

Raises:

Type Description
InscoperException

if an error occurred

connectToInscoperBox()

Connect to the Inscoper Box.

Establishes a connection to the Inscoper Box.

Returns:

Type Description
boolean

True if successful, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

disconnectToInscoperBox()

Disconnect from the Inscoper Box.

Closes the connection to the Inscoper Box.

Returns:

Type Description
boolean

True if successful, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

isConnectedToInscoperBox()

Check if connected to the Inscoper Box.

Determines if the API is currently connected to the Inscoper Box.

Returns:

Type Description
boolean

True if connected, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

restartInscoperBox()

Restart the Inscoper Box.

Restarts the Inscoper Box device.

Raises:

Type Description
InscoperException

if an error occurred

getInscoperBoxUsbView()

Get the USB view of the Inscoper Box.

Retrieves information about USB devices connected to the Inscoper Box.

Returns:

Type Description
list[UsbInfo]

The list of USB information

Raises:

Type Description
InscoperException

if an error occurred

resetInscoperBoxUsbView(secondsToWaitBeforeReconnection)

Reset the Inscoper Box USB view.

Resets the USB view of the Inscoper Box and waits before reconnection.

Parameters:

Name Type Description Default
secondsToWaitBeforeReconnection float

The time in seconds to wait before reconnecting

required

Raises:

Type Description
InscoperException

if an error occurred

getInscoperBoxType()

Get the type of the Inscoper Box.

Retrieves the hardware type of the connected Inscoper Box.

Returns:

Type Description
int

The box type

Raises:

Type Description
InscoperException

if an error occurred

checkLicense()

Check if the license is valid.

Verifies the validity of the current software license.

Returns:

Type Description
boolean

True if valid, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

setLicensePath(path)

Set the path to the license file.

Sets the path to the file containing the license information.

Parameters:

Name Type Description Default
path string

The license file path

required

hasLicenseOption(option)

Check if a specific license option is available.

Determines if the specified license option is enabled.

Parameters:

Name Type Description Default
option string

The option name

required

Returns:

Type Description
boolean

True if available, false otherwise

Raises:

Type Description
InscoperException

if an error occurred

hasLicenseExpirationDate()

Check if the license has an expiration date.

Determines if the license has an expiration date.

Returns:

Type Description
boolean

True if it has an expiration date, false otherwise

getLicenseDaysLeft()

Get the number of days left on the license.

Retrieves the number of days remaining until license expiration.

Returns:

Type Description
int

The number of days left

getRunSequenceSubDeviceId()

Get the "Run Sequence" sub-device ID.

Retrieves the sub-device ID used for coordinating sequence execution.

Returns:

Type Description
SubDeviceId

The sub-device ID used for running sequences