LabOS Camera Configuration
Overview
LabOS allows adding external cameras to your liquid handler configuration. These cameras can then be used to take pictures when an error is encountered or in response to a user action.
Supported Instruments
Instrument | Cameras | Type |
---|---|---|
LabMate | Cameras above deck | Native |
Zephyr | Any cameras accessible by the Connector associated with the instrument | Instrument Connector Cameras |
OT-2 | Any cameras accessible by the Connector associated with the instrument | Instrument Connector Cameras |
When are Images Recorded
When cameras are enabled images will be recorded if there is an error during liquid handling in a live protocol run. Images are also taken when users run the Instrument Action for taking images.
LabMate Camera Integration
The LabMate has a number of cameras. The ones referred to in this document are mounted above the deck. There are two and both can be used to take pictures.
Configuration
A default configuration is generated when the LabMate is initialized. Cameras are disabled by default. To enable the cameras do the following:
- Initialize the LabMate if it hasn’t yet been initialized
- From the instrument page open the Configuration tab
- Click on “Advanced Configuration”
- A JSON document will be shown. To enable the cameras, the
enabled
setting needs to be set totrue
for each camera (e.g.,"enabled": true
). None of the other settings should be changed. - Click the Instrument’s Save button
Sample JSON config with the cameras enabled:
{
"cameras": [
{
"name": "labsdk.instruments.gls.cam.1",
"index": 0,
"enabled": true,
"rotate": true,
"resolution": {
"width": 640,
"height": 480
}
},
{
"name": "labsdk.instruments.gls.cam.2",
"index": 2,
"enabled": true,
"rotate": true,
"resolution": {
"width": 640,
"height": 480
}
}
],
"version": 1
}
Windows Connector Cameras
Any camera(s) connected to a Windows PC with the Instrument Connectors installed on it can be used for taking images. There is no default configuration for Windows instruments.
You need to know the Camera Index for your camera. The index starts at 0
and increments upward. If you connected 3 USB webcams to a PC you would likely have the indexes 0, 1, 2
available for use. Note that it is possible for the OS or drivers to force an index into the system, so the numbers may not be consecutive. Furthermore, when the system restarts the indexes may change order. If you are dealing with a laptop with a built-in camera, it is usually mapped to index 0
.
Configuration
There is no default configuration for Windows cameras. The process for adding the configuration is similar to that of LabMate:
- Open the onboarded instrument in LabOS
- Click on the Configuration tab
- Click on “Advanced Configuration”
- Edit the configuration
- Click the Instrument’s Save button
You can start with this basic config:
{
"cameras": [
{
"name": "camera.0",
"index": 0,
"enabled": true,
"rotate": false
}
]
}
"name"
must to be unique within the configuration file. "enabled"
must be set to true
. The above configuration takes images with the camera at index 0
. You can increment the index and take images until you map the indexes for each of the attached camera. You can then add a section for each index you wish to record images from. The resolution used will be the maximum we can get from the default driver for Windows, usually 1280×720. Limitations
The image taking module is very fault tolerant. The module will silently skip the configured camera if it cannot connect to it or encounters an error while taking the picture. Cameras have a default resolution which is discovered when the resolution section isn’t set for a camera. If you do set a resolution and this resolution isn’t supported, an error will be reported.
There is a size limit when gathering images. Currently there can be up to 3MB of images recorded per imagine action. This can be a single larger image, or several smaller images. This limit also includes any other attachments to the run results, such as logs.