Quickstart Guide¶
This guide will help you verify your installation and perform your first hardware operations using the Inscoper API in Python.
1. Verify Installation¶
The simplest way to check if the inscoper_api is correctly installed in your environment is to try importing it.
2. Initialize the Bridge¶
The Bridge is the main entry point to the API. Instantiating it verifies that the native libraries (DLLs) are correctly loaded and accessible.
3. Capture an Image¶
This example demonstrates a complete workflow: loading a configuration, initializing devices, and capturing a single image from a camera.
import inscoper_api
import os
# Macro to all Inscoper configurations
CONFIG_PATH = os.environ['InscoperConfigsPath']
my_bridge = inscoper_api.Bridge()
# Load a specific configuration file
my_bridge.loadConfigFile(os.sep.join([CONFIG_PATH, "singleCamera"]))
# Initialize all the devices that were loaded from the configuration file
my_bridge.initDevices()
# Retrieve a list of the names of all successfully loaded and initialized devices
devices = my_bridge.getLoadedDevices()
print("Loaded devices: ", my_bridge.getLoadedDevices())
# Retrieve the specific camera object from the bridge using its configured name ("Camera")
my_camera = my_bridge.getCamera("MyCamera")
# Command the camera to take a single picture (snap an image)
# The argument '0' is the camera channel index (0 for mono)
image = my_camera.snapImage(0)
Next Steps
Check our Examples section for more advanced workflows like time-lapses, Z-stacks, and multi-channel acquisitions.