CAtImaPy main code

The central object of the code is the mainWin object of class MainWindow described below and defined in CAtImaPy.py file. The main attributes of mainWin object are :

  • the ui object of class UI.Ui_MainWindow hosting the graphical user interface (GUI). The code of this class is located in UI folder, loaded as a module and described in section GUI code.

  • the Camera object of base class CameraClass controlling a camera. The code of this class is located in Cameras folder, loaded as a module and described in section Cameras code. Refer to section Camera drivers for details on writing specific code implementation for your camera(s) model(s).

  • the Imaging object of class ImagingClass used to acquire, analyze, plot and save series of measurements. The code of this class is located in Imagings folder, loaded as a module and described in section Imagings code. The Imaging object contains the information over a measurement and is saved in string and pickle formats in ‘.txt’ and ‘.imo’ files respectively.

The Scripts folder hosts pieces of codes that can be executed like a method of mainWin with self referring to it. The folder contains two examples and it could also host your own code, if you need this feature.

MainWindow class

class CAtImaPy.MainWindow[source]

Bases: QMainWindow

MainWindow class that hold the ui and the main code

__del__()[source]

Delete MainWindow object : first save persistent then delete

__init__()[source]

Initialize MainWindow object that hold the ui and the main code

Returns:

MainWindow object

camera_connector()[source]

Initialize Camera object handling the camera, connect and configure camera ready for acquistion, create corresponding Imaging object.

changeDirectory(dirname)[source]

Change the folder where data will be saved in, and also save a copy of current UI values in this folder.

Args :

dirname (str) : Absolute path to directory.

closeEvent(event)[source]

Handle close event by deleting MainWindow object.

connectUiVariables(objectsToConnect=['mainWin'])[source]

Connect automatically UI variables : (Double)SpinBoxes, CheckBoxes, ComboBoxes to object variables or functions (if ui name ends by ‘Func’)

Keyword Arguments:

objectsToConnect (list[str]) – list of objects (variables of mainWin) to load the variables in. The ui objectName should be of the form ‘<object name>__<object variable name>’ . If ‘mainWin’ is passed, then load all variables without ‘__’ as variables of mainWin. Default is [‘mainWin’].

display_configured_cameras_list()[source]

Print in UI the main parameters of the cameras configured in Cameras.Config.camerasConfigs

imagingObjectInit()[source]

Initialize Imaging object handling the data acquisition and analysis.

loadImagingvaluesToUI()[source]

Load the values of the imaging object to the UI. Only used when loading old results.

loadUiValues(objectsToConnect=['mainWin'])[source]

Load automatically values to UI variables : (Double)SpinBoxes, CheckBoxes, ComboBoxes

Keyword Arguments:

objectsToConnect=['mainWin'] (list of str) – list of objects to load the variables from. The ui objectName should be of the form ‘<object name>__<object variable name>’ . If ‘mainWin’ is passed, then load all variables from mainWin to matching ui variables without ‘__’.

load_imaging()[source]

Load the data from previously saved imaging object.

logPersistent_load()[source]

Load automatically values to UI variables from previous session. Values are saved in persistentData file.

logPersistent_save()[source]

Save values of UI variables from future sessions. Values are saved in persistentData file.

logROIarray_update()[source]

Update Analysis ROIs from ui table to mainWin.ROIarray

logUIROIarray_start()[source]

Initialize Analysis ROIs ui table from mainWin.ROIarray

nextfile()[source]

Find and set the next filename Imaging<N> with incremented number N.

on_pushButton_ROI_add_clicked()[source]

Action of pushButton Add in tab Analysis ROIs.

on_pushButton_ROI_delete_clicked()[source]

Action of pushButton Delete in tab Analysis ROIs.

on_pushButton_ROI_set_clicked()[source]

Action of pushButton Set in tab Analysis ROIs.

on_pushButton_closeFigures_clicked()[source]

Action of pushButton Close figures in tab Scripting.

on_pushButton_connect_camera_clicked()[source]

Action of pushButton Connect camera in tab Camera.

on_pushButton_exposure_auto_av_clicked()[source]

Action of pushButton Average auto adjust in tab Exposure and Gain.

on_pushButton_exposure_auto_max_clicked()[source]

Action of pushButton Maximum auto adjust in tab Exposure and Gain.

on_pushButton_exposure_gain_set_clicked()[source]

Action of pushButton Set Exposure and Gain in tab Exposure and Gain.

on_pushButton_imaging_start_measurement_clicked()[source]

Action of pushButton Start measurement in tab Imaging.

on_pushButton_loadScript_clicked()[source]

Action of pushButton Load script in tab Scripting.

on_pushButton_load_imagingObject_clicked()[source]

Action of pushButton Load Imaging Results in tab Save/Load.

on_pushButton_plotAnalysis_update_clicked()[source]

Action of pushButton Update in tab Plot.

on_pushButton_print_imaging_object_as_dict_clicked()[source]

Action of pushButton Print in tab Analysis results.

on_pushButton_reloadRunScript_clicked()[source]

Action of pushButton Reload and Run Script in tab Scripting.

on_pushButton_save_choose_dir_clicked()[source]

Action of pushButton Choose Directory in tab Save/Load.

on_pushButton_save_image_clicked()[source]

Action of pushButton Save image in tab Camera.

on_pushButton_save_imagingObject_clicked()[source]

Action of pushButton Save Imaging Results in tab Save/Load.

on_pushButton_start_LT_measurement_clicked()[source]

Action of pushButton Start Lifetime measurement in tab Lifetime.

on_pushButton_start_temp_measurement_clicked()[source]

Action of pushButton Start Temperature measurement in tab Temperature.

on_pushButton_take_image_clicked()[source]

Action of pushButton Take image in tab Camera.

print_dict(d, indentation=0)[source]

Make a pretty string representation of the content of a dictionary.

Parameters:

d (dict) – Dictionnary to represent by a string

Keyword Arguments:

indentation (int) – Number of spaces to place before key name Used in recursive call for d variables that are dicts.

Returns:

String representation of d

save_imaging()[source]

Save imaging results (imaging object and pictures of graphs) and increment filename.

setEnabledAcquisitionUIbuttons(enabled)[source]
Enabling or disabling UI buttons related to acquisition.

Button are enabled only when a camera is connected.

Parameters:

enabled (bool) – Set enabled state of buttons

uiROIarrayAddRow(row=['0', 'NEW !', '0.0', '0.0', '100.0', '100.0'])[source]

Add a row to table of ROIs in GUI.