In this tutorial, we are going to write a program that prepares the camera and run a simple acquisition. We will be using the simulator, but every cameras should work in the same way. The program is in C++, the python binding being similar or simpler.

First some headers needs to be included :

The simulator/camera.h that defines the Camera class for this specific cameras

The lima/ctcontrol.h that defines the CtControl class which is the main user interface of LImA

If the library and plugin were not installed in the default locations, make sure to adjust the include search paths of your compiler.

#include<simulator/camera.h>#include<lima/ctcontrol.h>

Then, the camera object is instantiated and the corresponding interface is constructed:

At this point, the code specific to the camera code is over and we can instantiate the lima::CtControl object:

// The main control objectCtControlct=lima::CtControl(&hw);

lima::CtControl is a class that aggregates many aspects of the configuration and the control of the cameras. Here is a non exhaustive lists of controls:

Control

Description

Acquisition

Controls exposure time, number of frames, trigger mode, etc…

Image

Controls cropping (ROI), binning, rotation and other processing applied either on hardware or by software…

Saving

Controls the file format, compression, metadata…

Shutter

Controls the shutter mode and open and closed times…

Buffer

Controls the number of buffer, the maximum memory to use…

These specific controls are accessible form the main lima::CtControl object.

// Get the acquisition, saving and image controlsCtAcquisition*acq=ct.acquisition();CtSaving*save=ct.saving();CtImage*image=ct.image();

All these control objects have member functions to set their parameters, either directly or using a the Parameter object, such as lima::CtSaving::Parameter (nested class). Here is how we could set the saving properties of our acquisition:

Once we are happy with our settings, it’s time to prepare the acquisition which perform multiple tasks such as buffer allocation, folder creation or applying the camera settings through the camera plugin and SDK.