Hermes SDK 1.0.1A
Hermes_SDK.h
Go to the documentation of this file.
1/*
2#######################################
3
4Copyright 2023 Micro-Photon-Devices s.r.l.
5
6SOFTWARE PRODUCT: Hermes_SDK 1.0.1A
7
8Micro-Photon-Devices (MPD) expressly disclaims any warranty for the SOFTWARE PRODUCT.
9The SOFTWARE PRODUCT is provided 'As Is' without any express or implied warranty of any kind,
10including but not limited to any warranties of merchantability, non-infringement, or
11fitness of a particular purpose. MPD does not warrant or assume responsibility for the
12accuracy or completeness of any information, text, graphics, links or other items contained
13within the SOFTWARE PRODUCT. MPD further expressly disclaims any warranty or representation
14to Authorized Users or to any third party.
15In no event shall MPD be liable for any damages (including, without limitation, lost profits,
16business interruption, or lost information) rising out of 'Authorized Users' use of or inability
17to use the SOFTWARE PRODUCT, even if MPD has been advised of the possibility of such damages.
18In no event will MPD be liable for loss of data or for indirect, special, incidental,
19consequential (including lost profit), or other damages based in contract, tort
20or otherwise. MPD shall have no liability with respect to the content of the
21SOFTWARE PRODUCT or any part thereof, including but not limited to errors or omissions contained
22therein, libel, infringements of rights of publicity, privacy, trademark rights, business
23interruption, personal injury, loss of privacy, moral rights or the disclosure of confidential
24information.
25
26#######################################
27*/
28
29#ifndef __Hermes_SDK_h__
30#define __Hermes_SDK_h__
31
32#ifdef __cplusplus
33 extern "C" {
34#endif
57#include <stdio.h>
58#include <math.h>
59#include <string.h>
60
61#ifndef DllSDKExport
62 #if defined(_WIN32)
63 #define DllSDKExport __declspec(dllexport)
64 #else
65 #define DllSDKExport __attribute__ ((visibility("default")))
66 #endif
67#endif
68
70typedef unsigned short UInt16;
71
73typedef short Int16;
74
76typedef unsigned UInt32;
77
83#define MIN_DEAD_TIME 30
87#define MAX_DEAD_TIME 150
88
91#define MAX_GATE_WIDTH 100
92
95#define MIN_GATE_WIDTH 0
96
99#define MAX_GATE_SHIFT +500
100
103#define MIN_GATE_SHIFT -500
104
113typedef enum{
114 OK = 0,
128 TOO_MUCH_LIGHT = -16,
135
139typedef enum{
146
148
149typedef enum{
151 Pulsed = 1,
152 Coarse = 2
154
160typedef enum{
161 Normal = 0,
163 Advanced = 1
165
168typedef enum{
169 None = 0,
171 Frame = 2
173
175typedef enum{
177 Enabled = 1
179
185typedef enum{
186 Linear = 0,
187 MultiTau = 1
189
190
192typedef struct _Hermes_H * Hermes_H;
193
195typedef unsigned char * BUFFER_H;
197//------------ Constructor -----------------------------------------
215DllSDKExport HermesReturn HermesConstr(Hermes_H* Hermes_in, CameraMode m, char* Device_ID);
216
224DllSDKExport HermesReturn HermesDestr(Hermes_H Hermes);
225
226//------------ Error handling --------------------------------------
234DllSDKExport void PrintErrorCode(FILE* fout, const char* FunName, HermesReturn retcode);
235
237//------------ Set methods -----------------------------------------
262DllSDKExport HermesReturn HermesSetCameraPar(Hermes_H Hermes, UInt16 Exposure, UInt32 NFrames, UInt16 NIntegFrames, UInt16 NCounters, State Force8bit, State Half_array, State Signed_data);
263
290DllSDKExport HermesReturn HermesSetCameraParSubArray(Hermes_H Hermes, UInt16 Exposure, UInt32 NFrames, UInt16 NIntegFrames, State Force8bit, UInt16 Npixels);
291
304
313
321
331
339
348DllSDKExport HermesReturn HermesSetGateMode(Hermes_H Hermes, UInt16 counter, GateMode Mode);
349
361DllSDKExport HermesReturn HermesSetGateValues(Hermes_H Hermes, Int16 Shift, Int16 Length);
362
378DllSDKExport HermesReturn HermesSetDualGate(Hermes_H Hermes, State DualGate_State, int StartShift, int FirstGateWidth, int SecondGateWidth, int Gap);
379
398DllSDKExport HermesReturn HermesSetTripleGate(Hermes_H Hermes, State TripleGate_State, int StartShift, int FirstGateWidth, int SecondGateWidth, int ThirdGateWidth, int Gap1, int Gap2);
399
414DllSDKExport HermesReturn HermesSetCoarseGateValues(Hermes_H Hermes, UInt16 Counter, UInt16 Start, UInt16 Stop);
415
423
432DllSDKExport HermesReturn HermesSetSyncInState(Hermes_H Hermes, State s, int frames);
433
449DllSDKExport HermesReturn HermesSetFlimPar(Hermes_H Hermes, UInt16 FLIM_steps, UInt16 FLIM_shift, Int16 FLIM_start, UInt16 Length, int* FLIM_frame_time);
450
460DllSDKExport HermesReturn HermesSetFlimState(Hermes_H Hermes, State FLIM_State);
461
470
472//------------ Get methods -----------------------------------------
487DllSDKExport HermesReturn HermesGetDeadTime(Hermes_H Hermes, UInt16 Val, UInt16* ReturnVal);
488
498DllSDKExport HermesReturn HermesGetGateWidth(Hermes_H Hermes, UInt16 counter, Int16 Val, double* ReturnVal);
499
509DllSDKExport HermesReturn HermesGetGateShift(Hermes_H Hermes, UInt16 counter, Int16 Val, Int16* ReturnVal);
510
519DllSDKExport HermesReturn HermesIs16Bit(Hermes_H Hermes, short* is16bit);
520
528DllSDKExport HermesReturn HermesIsTriggered (Hermes_H Hermes, short* isTriggered);
529
538DllSDKExport HermesReturn HermesGetVersion(Hermes_H Hermes, double* Firmware_Version, double* Software_Version, char* Custom_version);
539
547DllSDKExport HermesReturn HermesGetSerial(Hermes_H Hermes, char* Camera_ID, char* Camera_serial);
548
560DllSDKExport HermesReturn HermesDeviceInfo(char* Device_ID, char* Camera_serial, double* Firmware_Version, double* Software_Version, char* Firmware_Custom_Version, char* Software_Custom_Version);
561
563//------------ Acquisition methods -----------------------------------------
582
591
601DllSDKExport HermesReturn HermesLiveGetImg(Hermes_H Hermes, UInt16* Img);
602
618
637
646DllSDKExport HermesReturn HermesSnapGetImageBuffer(Hermes_H Hermes, BUFFER_H* buffer, int* DataDepth);
647
660DllSDKExport HermesReturn HermesSnapGetImgPosition(Hermes_H Hermes, UInt16* Img, UInt32 Position, UInt16 counter);
661
662
674DllSDKExport HermesReturn HermesContAcqToFileStart(Hermes_H Hermes, char* filename);
675
692DllSDKExport HermesReturn HermesContAcqToFileGetMemory(Hermes_H Hermes, double* total_bytes);
693
704
714
728DllSDKExport HermesReturn HermesContAcqToMemoryGetBuffer(Hermes_H Hermes, double* total_bytes, BUFFER_H* buffer);
729
738
740//------------ Utilities -------------------------------------------
828DllSDKExport HermesReturn HermesSaveImgDisk(Hermes_H Hermes, UInt32 Start_Img, UInt32 End_Img, char* filename, OutFileFormat mode);
829
843DllSDKExport HermesReturn HermesSaveAveragedImgDisk(Hermes_H Hermes, UInt16 counter, char* filename, OutFileFormat mode, short isDouble);
844
864DllSDKExport HermesReturn HermesSaveFlimDisk(Hermes_H Hermes, char* filename, OutFileFormat mode);
865
866
880DllSDKExport HermesReturn HermesReadHermesFileFormatImage(char* filename, UInt32 ImgIdx, UInt16 counter, UInt16* Img, char header[1024]);
881
893DllSDKExport HermesReturn HermesAverageImg(Hermes_H Hermes, double* Img, UInt16 counter);
894
906DllSDKExport HermesReturn HermesStDevImg(Hermes_H Hermes, double* Img, UInt16 counter);
907
925DllSDKExport HermesReturn HermesSetCorrelationMode(Hermes_H Hermes, CorrelationMode CM, int NCorrChannels, State s);
926
941DllSDKExport HermesReturn HermesCorrelationImg(Hermes_H Hermes, UInt16 counter);
942
988DllSDKExport HermesReturn HermesSaveCorrelationImg(Hermes_H Hermes, char* filename);
989
999
1002#ifdef _MPD_DEV_
1003#include "MPD_util.h"
1004#endif
1005
1007#ifdef __cplusplus
1008}
1009#endif
1010
1011#endif //__Hermes_SDK_h__
unsigned UInt32
Unsigned integer (32 bit)
Definition: Hermes_SDK.h:76
short Int16
Short integer (16 bit)
Definition: Hermes_SDK.h:73
unsigned short UInt16
Unsigned short integer (16 bit)
Definition: Hermes_SDK.h:70
HermesReturn HermesContAcqToMemoryGetBuffer(Hermes_H Hermes, double *total_bytes, BUFFER_H *buffer)
Dump the camera memory to the PC and pass the pointer to the image buffer in which acquisition is sto...
HermesReturn HermesContAcqToMemoryStop(Hermes_H Hermes)
Stop the continuous acquisition of data.
HermesReturn HermesContAcqToFileGetMemory(Hermes_H Hermes, double *total_bytes)
Dump the camera memory to the PC and save data to the file specified with the HermesContAcqToFileStar...
HermesReturn HermesContAcqToFileStart(Hermes_H Hermes, char *filename)
Put the camera in "continuous acquisition" mode.
HermesReturn HermesLiveSetModeON(Hermes_H Hermes)
Turn on the Live mode.
HermesReturn HermesContAcqToMemoryStart(Hermes_H Hermes)
Put the camera in "continuous acquisition" mode.
HermesReturn HermesContAcqToFileStop(Hermes_H Hermes)
Stop the continuous acquisition of data and close the output file.
HermesReturn HermesLiveSetModeOFF(Hermes_H Hermes)
Turn off the Live mode.
HermesReturn HermesSnapGetImageBuffer(Hermes_H Hermes, BUFFER_H *buffer, int *DataDepth)
Get the pointer to the image buffer in which snap acquisition is stored.
HermesReturn HermesSnapGetImgPosition(Hermes_H Hermes, UInt16 *Img, UInt32 Position, UInt16 counter)
Export an acquired image to an user allocated memory array.
HermesReturn HermesLiveGetImg(Hermes_H Hermes, UInt16 *Img)
Get a Live image.
HermesReturn HermesSnapPrepare(Hermes_H Hermes)
Prepare the camera to the acquisition of a snap.
HermesReturn HermesSnapAcquire(Hermes_H Hermes)
Get a selected number of images.
HermesReturn HermesAverageImg(Hermes_H Hermes, double *Img, UInt16 counter)
Calculate the average image.
HermesReturn HermesCorrelationImg(Hermes_H Hermes, UInt16 counter)
Calculate the autocorrelation function.
HermesReturn HermesSaveImgDisk(Hermes_H Hermes, UInt32 Start_Img, UInt32 End_Img, char *filename, OutFileFormat mode)
Save the selected images on the hard disk.
HermesReturn HermesSaveAveragedImgDisk(Hermes_H Hermes, UInt16 counter, char *filename, OutFileFormat mode, short isDouble)
Save the selected images on the hard disk.
HermesReturn HermesReadHermesFileFormatImage(char *filename, UInt32 ImgIdx, UInt16 counter, UInt16 *Img, char header[1024])
Read an integer (8 - 16 bit) Hermes image from file.
HermesReturn HermesSaveCorrelationImg(Hermes_H Hermes, char *filename)
Save the autocorrelation functions on the hard disk.
HermesReturn HermesStDevImg(Hermes_H Hermes, double *Img, UInt16 counter)
Calculate the standard deviation image.
HermesReturn HermesResetOverilluminationProtection(Hermes_H Hermes)
Reset the internal overillumination protection circuit.
HermesReturn HermesSetCorrelationMode(Hermes_H Hermes, CorrelationMode CM, int NCorrChannels, State s)
Enable the correlation mode.
HermesReturn HermesSaveFlimDisk(Hermes_H Hermes, char *filename, OutFileFormat mode)
Save the FLIM acquisition on the hard disk.
void PrintErrorCode(FILE *fout, const char *FunName, HermesReturn retcode)
Print an error message.
HermesReturn HermesConstr(Hermes_H *Hermes_in, CameraMode m, char *Device_ID)
Constructor.
HermesReturn HermesDestr(Hermes_H Hermes)
Destructor.
struct _Hermes_H * Hermes_H
Handle to the Hermes structure.
Definition: Hermes_SDK.h:192
State
Disable or enable a specific function.
Definition: Hermes_SDK.h:175
CorrelationMode
Type of correlation function.
Definition: Hermes_SDK.h:185
OutFileFormat
Output file format.
Definition: Hermes_SDK.h:139
GateMode
Gate setting.
Definition: Hermes_SDK.h:149
HermesReturn
Error table.
Definition: Hermes_SDK.h:113
TriggerMode
Type of synchronization output.
Definition: Hermes_SDK.h:168
unsigned char * BUFFER_H
Handle to the Hermes buffer.
Definition: Hermes_SDK.h:195
CameraMode
Hermes working mode.
Definition: Hermes_SDK.h:160
@ Enabled
The function is enabled.
Definition: Hermes_SDK.h:177
@ Disabled
The function is disabled.
Definition: Hermes_SDK.h:176
@ Linear
Selects the linear correlation algorithm.
Definition: Hermes_SDK.h:186
@ MultiTau
Selects the linear multi-tau algorithm.
Definition: Hermes_SDK.h:187
@ HERMES_FILEFORMAT
Hermes custom file format.
Definition: Hermes_SDK.h:140
@ TIFF_NO_COMPRESSION
Multipage TIFF without compression.
Definition: Hermes_SDK.h:141
@ Continuous
The gate signal is always "ON".
Definition: Hermes_SDK.h:150
@ Pulsed
The gate signal is a square wave at 50MHz.
Definition: Hermes_SDK.h:151
@ Coarse
The gate signal is a square wave, with period equal to the integration time, and width and position a...
Definition: Hermes_SDK.h:152
@ NOT_EN_MEMORY
Not enough memory is available to operate the camera.
Definition: Hermes_SDK.h:121
@ MISSING_DLL
One or more Hermes libraries are missing.
Definition: Hermes_SDK.h:119
@ OK
The function returned successfully.
Definition: Hermes_SDK.h:114
@ TOO_MUCH_LIGHT
Too much light was detected by the camera.
Definition: Hermes_SDK.h:128
@ NULL_POINTER
A null pointer has been provided to the function.
Definition: Hermes_SDK.h:122
@ INVALID_OP
The required function can not be executed.
Definition: Hermes_SDK.h:123
@ EMPTY_BUFFER
An empty buffer image has been provided to the function.
Definition: Hermes_SDK.h:120
@ USB_DEVICE_NOT_RECOGNIZED
The USB device driver has not been initialized.
Definition: Hermes_SDK.h:115
@ OUT_OF_BOUND
One or more parameters passed to the function are outside the valid boundaries.
Definition: Hermes_SDK.h:118
@ COMMUNICATION_ERROR
Communication error during readout.
Definition: Hermes_SDK.h:117
@ UNABLE_CREATE_FILE
An output file can not be created.
Definition: Hermes_SDK.h:124
@ HERMES_MEMORY_FULL
The Hermes internal memory got full during continuous acquisition.
Definition: Hermes_SDK.h:131
@ PERSISTING_TOO_MUCH_LIGHT
The overillumination protection circuit has been reset by the user 3 times.
Definition: Hermes_SDK.h:132
@ UNABLE_READ_FILE
The provided file can not be accessed.
Definition: Hermes_SDK.h:125
@ INVALID_NIMG_CORRELATION
The acquired number of images is not sufficient to calculate the required correlation function.
Definition: Hermes_SDK.h:130
@ FIRMWARE_NOT_COMPATIBLE
The camera firmware is not compatible with the current software.
Definition: Hermes_SDK.h:126
@ CAMERA_NOT_POWERING_UP
Internal power supply is not powering up.
Definition: Hermes_SDK.h:116
@ POWER_SUPPLY_ERROR
Voltage drop on internal power supply.
Definition: Hermes_SDK.h:127
@ Frame
A 60 ns pulse every time a new frame is acquired.
Definition: Hermes_SDK.h:171
@ Gate_Clk
A square wave of 50 MHz and 50% duty cycle synchronized with the software gate signal and the camera ...
Definition: Hermes_SDK.h:170
@ None
No output signal.
Definition: Hermes_SDK.h:169
@ Advanced
The user has full control of the camera settings.
Definition: Hermes_SDK.h:163
@ Normal
The camera settings are tuned by the software to avoid the overflow of the counters.
Definition: Hermes_SDK.h:161
HermesReturn HermesGetGateWidth(Hermes_H Hermes, UInt16 counter, Int16 Val, double *ReturnVal)
Get the calibrated gate width value.
HermesReturn HermesGetGateShift(Hermes_H Hermes, UInt16 counter, Int16 Val, Int16 *ReturnVal)
Get the calibrated gate shift value.
HermesReturn HermesIs16Bit(Hermes_H Hermes, short *is16bit)
Get the actual bit depth of acquired data.
HermesReturn HermesGetSerial(Hermes_H Hermes, char *Camera_ID, char *Camera_serial)
Get the camera serial number and ID.
HermesReturn HermesIsTriggered(Hermes_H Hermes, short *isTriggered)
Poll the camera for external trigger status.
HermesReturn HermesGetVersion(Hermes_H Hermes, double *Firmware_Version, double *Software_Version, char *Custom_version)
Get the SDK and camera firmware version.
HermesReturn HermesGetDeadTime(Hermes_H Hermes, UInt16 Val, UInt16 *ReturnVal)
Get the calibrated dead-time value.
HermesReturn HermesDeviceInfo(char *Device_ID, char *Camera_serial, double *Firmware_Version, double *Software_Version, char *Firmware_Custom_Version, char *Software_Custom_Version)
Get device info.
HermesReturn HermesSetFlimState(Hermes_H Hermes, State FLIM_State)
Enable or disable FLIM mode.
HermesReturn HermesSetGateMode(Hermes_H Hermes, UInt16 counter, GateMode Mode)
Set the gate mode to continuous, coarse or pulsed (only counter 1)
HermesReturn HermesSetTripleGate(Hermes_H Hermes, State TripleGate_State, int StartShift, int FirstGateWidth, int SecondGateWidth, int ThirdGateWidth, int Gap1, int Gap2)
Set parameters for TripleGate mode.
HermesReturn HermesApplySettings(Hermes_H Hermes)
Apply settings to the camera.
HermesReturn HermesSetFlimPar(Hermes_H Hermes, UInt16 FLIM_steps, UInt16 FLIM_shift, Int16 FLIM_start, UInt16 Length, int *FLIM_frame_time)
Set FLIM parameters.
HermesReturn HermesSetCameraParSubArray(Hermes_H Hermes, UInt16 Exposure, UInt32 NFrames, UInt16 NIntegFrames, State Force8bit, UInt16 Npixels)
Set the acquisition parameters for the camera when a subarray is used.
HermesReturn HermesSetBackgroundSubtraction(Hermes_H Hermes, State s)
Enable or disable the hardware background subtraction.
HermesReturn HermesSetGateValues(Hermes_H Hermes, Int16 Shift, Int16 Length)
Change the fast Gate settings for counter 1.
HermesReturn HermesSetSyncInState(Hermes_H Hermes, State s, int frames)
Set the sync-in state.
HermesReturn HermesSetDualGate(Hermes_H Hermes, State DualGate_State, int StartShift, int FirstGateWidth, int SecondGateWidth, int Gap)
Set parameters for DualGate mode.
HermesReturn HermesSetCameraPar(Hermes_H Hermes, UInt16 Exposure, UInt32 NFrames, UInt16 NIntegFrames, UInt16 NCounters, State Force8bit, State Half_array, State Signed_data)
Set the acquisition parameters for the camera.
HermesReturn HermesSetTriggerOutState(Hermes_H Hermes, TriggerMode Mode)
Select the output signal.
HermesReturn HermesSetCoarseGateValues(Hermes_H Hermes, UInt16 Counter, UInt16 Start, UInt16 Stop)
Change the coarse Gate settings.
HermesReturn HermesSetBackgroundImg(Hermes_H Hermes, UInt16 *Img)
Load a background image to perform hardware background subtraction.
HermesReturn HermesSetAdvancedMode(Hermes_H Hermes, State s)
Change the operating mode.
HermesReturn HermesSetDeadTime(Hermes_H Hermes, UInt16 Val)
Update the dead-time setting.
HermesReturn HermesSetDeadTimeCorrection(Hermes_H Hermes, State s)
Enable or disable the dead-time correction.