Home

SPC3_SDK User Manual

image

Contents

1. Parameters spc3 SPC3 handle s Enable or disable the synchronization input Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location Examples SDK_Example c 4 3 2 15 DIISDKExport SPC3Return SPC3_Set_Trigger_Out_State SPC3_H spc3 TriggerMode Mode Select the output signal Parameters spc3 Pointer to the SPC3 handle Mode New trigger mode Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location Examples SDK_Example c MPD Micro Photo Devices s r l 4 4 Get methods Page 23 of 53 4 4 Get methods Functions DIISDKExport SPC3Return SPC3_Get_Live_lmg SPC3_H spc3 Ulnt16 x Img DIISDKExport SPC3Return SPC3_Prepare_Snap SPC3_H spc3 DIISDKExport SPC3Return SPC3_Get_Snap SPC3_H spc3 DIISDKExport SPC3Return SPC3_Get_Image_Buffer SPC3_H spc3 BUFFER_H buffer DIISDKExport SPC3Return SPC3_Get_Img_Position SPC3_H spc3 Ulnt16 Img Ulnt32 Position Ulnt16 counter DIISDKExport SPC3Return SPC3_Start_ContAcg SPC3_H spc3 char filename 256 DIISDKExport SPC3Return SPC3_Get_Memory SPC3_H spc3 double total_bytes DIISDKExport SPC3Return SPC3_Stop_ContAcq SPC3_H spc3 DIISDKExport SPC3Return SPC3_Get_DeadTime SPC3_H spc3 Ulnt16 Val Ulnt16 ReturnVal DIISDKExport SPC3Return SPC3_Get_GateWidth SPC3_H spc3 Int16 Val double ReturnVal DIISDKExport SPC3Return SPC3_Get_GateShift SPC3_H spc3 Int16 Val Int16 Re
2. ReturnVal Closest gate shift value possible This parameter is referenced Returns OK NULL_POINTER The provided SPC3_H or ReturnVal point to an empty memory location 4 4 2 3 DIISDKExport SPC3Return SPC3_Get_GateWidth SPC3_H spc3 Int16 Val double ReturnVal Get the calibrated gate width value This function provides the closest calibrated gate width value to Val Parameters spc3 SPC3 handle Val Desired gate width value in percentage of 20ns No error is generated when the value out of range instead the real boundaries are forced on ReturnVal ReturnVal Closest gate width value possible This parameter is referenced Returns OK NULL_POINTER The provided SPC3_H or ReturnVal point to an empty memory location 4 4 2 4 DIISDKExport SPC3Return SPC3_Get_Image_Buffer SPC3_H spc3 BUFFER_H x buffer Get the pointer to the image buffer in which snap acquisition is stored WARNING User must pay attention not to exceed the dimension of the buffer 2 1024 65534 1 bytes when accessing it Parameters spc3 SPC3 handle buffer Pointer to the buffer Handle in which the function will save reference to the camera image buffer Returns OK NULL_POINTER The provided SPC3_H or BUFFER_H point to an empty memory location See also SPC3_Get_Snap MPD Micro Photo Devices s r l 4 4 Get methods Page 25 of 53 4 4 2 5 DIISDKExport SPC3Return SPC3_Ge
3. Parameters spc3 SPC3 handle s Enable or disable the background subtraction Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location Examples SDK_Example c 4 3 2 5 DIISDKExport SPC3Return SPC3_Set_Camera_Par SPC3_H spc3 Ulnt16 Exposure Ulnt32 NFrames Ulnt16 NintegFrames Ulnt16 NCounters State Force8bit State Half array State Signed_data Set the acquisition parameters for the camera Micro Photo Devices s r l amp YMPD Page 18 of 53 Module Documentation This function behaves differently depending on the operating mode setting In case of Normal working mode the exposure time is fixed to 10 40 microseconds Therefore the parameter Exposure is not considered Longer exposures are obtained by summing multiple frames i e by setting NIntegFrames This operating mode does not degrade the signal to noise ratio In fact the camera does not have any read out noise In case of Advanced mode all the parameters are controlled by the user which can set very long exposure times The time unit of the Exposure parameter is clock cycles i e the exposure time is an integer number of internal clock cycles of 10 ns periode For example the value of 10 means 100 ns exposure Parameters spc3 SPC3 handle Exposure Exposure time for a single frame The time unit is 10 ns Meaningful only for Advanced mode Accepted values 1 65534 NFrames Number of frames per acquisition Mea
4. DIISDKExport SPC2Return SPC2_Set_Live_Mode_ON SPC2_H spc2 DIISDKExport SPC2Return SPC2_Set_Live_Mode_OFF SPC2_H spc2 DIISDKExport SPC2Return SPC2_Apply_settings SPC2_H spc2 DIISDKExport SPC2Return SPC2_Get_Live_Img SPC2_H spc2 Ulnt16 Img DIISDKExport SPC2Return SPC2_Prepare_Snap SPC2_H spc2 DIISDKExport SPC2Return SPC2_Get_Snap SPC2_H spc2 DIISDKExport SPC2Return SPC2_Get_Image_Buffer SPC2_H spc2 BUFFER_H buffer DIISDKExport SPC2Return SPC2_Get_Img_Position SPC2_H spc2 Ulnt16 Img Ulnt32 Position DIISDKExport SPC2Return SPC2_Start_ContAcg SPC2_H spc2 char filename 256 DIISDKExport SPC2Return SPC2_Get_Memory SPC2_H spc2 int x total_bytes DIISDKExport SPC2Return SPC2_Stop_ContAcq SPC2_H spc2 DIISDKExport SPC2Return SPC2_Get_DeadTime SPC2_H spc2 Ulnt16 Val Ulnt16 ReturnVal DIISDKExport SPC2Return SPC2_Get_GateWidth SPC2_H spc2 Int16 Val double ReturnVal DIISDKExport SPC2Return SPC2_Get_GateShift SPC2_H spc2 Int16 Val Int16 ReturnVal DIISDKExport SPC2Return SPC2_ls16Bit SPC2_H spc2 short xis16bit DIISDKExport SPC2Return SPC2_IsTriggered SPC2_H spc2 short xis Triggered DIISDKExport SPC2Return SPC2_GetVersion SPC2_H spc2 double xFirmware_Version double Software_Version DIISDKExport SPC2Return SPC2_Save_Img_Disk SPC2_H spc2 Ulnt32 Start_Img Ulnt32 End_Img char filename OutFileFormat mode DIISDKExport SPC2Return SPC2_ReadSPC2FileFormatlmage char filename Ulnt32 Imgldx Ulnt16
5. SPC3_Get_Snap spc3 SPC3_Save_Img_Disk spc3 1 1 BgSubt TIFF_LZW_COMPRESSION case 4 break Test gate Micro Photo Devices s r l 6 1 SDK_Example c Page 47 of 53 SPC3 constructor and parameter setting out int SPC3_Constr amp spc3 Advanced SPC3_Set_Camera_Par spc3 4096 1000 100 1 Disabled Disabled Disabled SPC3_Set_DeadTime spc3 100 SPC3_Apply_settings spc3 Normal image printf Acquiring the reference image n SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 printf Save the reference image n SPC3_Save_Img_Disk spc3 1 1000 GateNormal TIFF_LZW_COMPRESSION gated image SPC3_Set_Gate_Mode spc3 Pulsed SPC3_Set_Gate_Values spc3 10 15 Shift 10 of 20 ns gt 120 ns Length 15 of 20 ns gt 3ns SPC3_Apply_settings spc3 printf Acquiring the gated image n SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 printf Save the gated image n SPC3_Save_Img_Disk spc3 1 1000 GatePulsed TIFF_LZW_COMPRESSION case 5 Gate_Clk case 6 break Test synchronization output SPC3 constructor and parameter setting out int SPC3_Constr amp spc3 Advanced SPC3_Set_Camera_Par spc3 8192 OxFFFF 5 1 Disabled Disabled Disabled SPC3_Set_DeadTime spc3 100 no output SPC3_Set_Trigger_Out_State spc3 None SPC3_Apply_settings spc3 SPC3_Set_Live_Mode_ON spc3 printf n
6. calloc 1 65535 sizeof double Simple menu for test selection Printf MaS printf SPC3 Test program n Printf Mosa OOOO OOOO OOOO SOS ona ana for i 0 i lt 12 1 printf t x s n i Test i printf tq Quit n do c getchar while c lt 48 c gt 58 amp amp c q amp amp c l a amp amp c b getchar if c gt 47 amp amp c lt 59 Printf III II ICICI OCI Gee printf s n Test c 48 PLANTEL II III no aa 5 if c a DMPP Micro Photo Devices s r l 6 1 SDK_Example c Page 45 of 53 Printf ICICI III III OOOO ee printf s n Test 10 PLANTEL III III ona a 5 if e b Printf ICICI II IOI OOOO ea printf s n Test 11 Printf III OOO Gece aa 7 switch c case case case ror mye ER Test live mode SPC3 constructor and parameter setting SPC3_Constr amp spc3 Normal SPC3_Set_Camera_Par spc3 100 30000 300 1 Disabled Disabled Disabled SPC3_Set_Trigger_Out_State spc3 Frame SPC3_Apply_settings spc3 SPC3_Set_Live_Mode_ON spc3 Acquistion of 10 live images for i 0 1 lt 10 i printf Image d n i SPC3_Get_Live_Img spc3 Img for 3 0 3 lt 32 3 for k 0 k lt 32 k printf Sd Img 32x3 k 5 printf n Live mode off SPC3_Set_Live_Mode_OFF spc3 break Test dead time SPC3 constructor and parameter set
7. n printf Input the number of frames of 10 40us to be integrated suggested gt 10 to avoid data loss n Disabled scanf Sd sintegFrames printf Total integration time 2fus n float 10 40 integFrames SPC3_Set_Camera_Par spc3 1050 1 integFrames 1 Disabled Disabled SPC3_Set_DeadTime spc3 100 SPC3_Apply_settings spc3 acquire images printf Continuous acquisition will be started and 10 memory dumps performed n printf Press ENTER to start continuous acquisition n Micro Photo Devices s r l MPD Page 50 of 53 Example Documentation getchar getchar SPC3_Start_ContAcq spc3 contacq spc3 for i 1 i lt 10 i if SPC3_Get_Memory spc3 amp read_bytes OK total_bytes total_bytestread_bytes printf Acquired f bytes in d readout operation n total_bytes ij SLEEP 1 MILLIS else break SPC3_Stop_ContAcq spc3 printf Acquisition saved to contacq spc3 1n break default break Destructors if spc3 SPC3_Destr spc3 free Img free Imgd free data free y free x printf Press ENTER to continue n getchar return 0 MPP Micro Photo Devices s r l Index Additional methods 30 SPC3_Average_Img 30 SPC3_Correlation_Img 30 SPC3_ReadSPC3FileFormatlmage 31 SPC3_Save_Correlation_Img 31 SPC3_Save_FLIM_Disk 32 SPC3_Save_Img_Disk 33 SPC3_Set_Correlation_Mode 35 SPC3_StDev_Img 35 Ad
8. 0 Pulsed 1 Page 40 of 53 File Documentation enum CameraMode Normal 0 Advanced 1 enum TriggerMode None 0 Gate_Clk 1 Frame 2 enum State Disabled 0 Enabled 1 enum CorrelationMode Linear 0 MultiTau 1 Functions DIISDKExport SPC2Return SPC2_Constr SPC2_H spc2_in Ulnti6 minRow Ulnt16 maxRow Ulnt16 min Col Ulnt16 maxCol CameraMode m char Device_ID DIISDKExport SPC2Return SPC2_Destr SPC2_H spc2 DIISDKExport void PrintErrorCode FILE x fout const char FunName SPC2Return retcode DIISDKExport SPC2Return SPC2_Set_Camera_Par SPC2_H spc2 Ulnt16 Exposure Ulnt32 NFrames U Int16 NintegFrames DIISDKExport SPC2Return SPC2_Set_Camera_SubArray SPC2_H spc2 Ulnt16 minRow Ulnt16 maxRow Ulnt16 minCol Ulnt16 maxCol DIISDKExport SPC2Return SPC2_Set_DeadTime SPC2_H spc2 Ulnt16 Val DIISDKExport SPC2Return SPC2_Set_DeadTime_Correction SPC2_H spc2 State s DIISDKExport SPC2Return SPC2_Set_Advanced_Mode SPC2_H spc2 State s DIISDKExport SPC2Return SPC2_Set_Background_lmg SPC2_H spc2 Ulnt16 Img DIISDKExport SPC2Return SPC2_Set_Background_Subtraction SPC2_H spc2 State s DIISDKExport SPC2Return SPC2_Set_Gate_Values SPC2_H spc2 Int16 Shift Int16 Length DIISDKExport SPC2Return SPC2_Set_Gate_Mode SPC2_H spc2 GateMode Mode DIISDKExport SPC2Return SPC2_Set_Trigger_Out_State SPC2_H spc2 TriggerMode Mode DIISDKExport SPC2Return SPC2_Set_Sync_In_State SPC2_H spc2 State s
9. 14 POWER_SUPPLY_ERROR 15 TOO_MUCH_LIGHT 16 IN VALID_NIMG_CORRELATION 17 SPC3_MEMORY_FULL 18 enum OutFileFormat SPC3_FILEFORMAT 0 TIFF_LZW_COMPRESSION 1 TIFF_NO_COMPRESSION 2 enum GateMode Continuous 0 Pulsed 1 enum CameraMode Normal 0 Advanced 1 enum TriggerMode None 0 Gate_Clk 1 Frame 2 enum State Disabled 0 Enabled 1 enum CorrelationMode Linear 0 MultiTau 1 Detailed Description Custom types used by the SDK 4 1 2 4 1 2 1 Typedef Documentation typedef unsigned charx BUFFER_H Handle to the SPC3 buffer 4 1 2 2 typedef struct SPC3_Hx SPC3_H Handle to the SPC3 structure Page 12 of 53 Module Documentation 4 1 3 Enumeration Type Documentation 4 1 3 1 enum CameraMode SPC3 working mode The camera contains for each pixel an 8 bit binary counter If the exposure time is too long the counter can overflow and generate a distorted image Therefore two operating modes have been implemented a normal one which prevents the overflow of the counters and an advanced one which gives full control of the camera to the user Enumerator Normal The camera settings are tuned by the software to avoid the overflow of the counters In this working mode the exposure time of each image is fixed to a multiple of 20 74 microseconds Longer exposures are obtained by integrating more frames Advanced The user has full control of the camera settings
10. Example Documentation 6 1 SDK_Example c Index Index SPC3_StDev_Img Detailed Description Function Documentation SPC3_Calibrate_DeadTime SPC3_Calibrate_Gate Detailed Description Macro Definition Documentation MAX_DEAD_TIME MIN_DEAD_TIME 51 Micro Photo Devices s r l MICRO PHOTON DEVICES Chapter 1 Single Photon Counting Camera Software Development Kit SPC3 SDK SPC3 is a 2D imaging chip based on a 64 x 32 array of smart pixels Each pixel comprises a single photon avalanche diode detector an analog front end and a digital processing electronics This on chip integrated device provides single photon sensitivity high electronic noise immunity and fast readout speed The imager can be operated at a maximum of about 100 000 frame per second with negligible dead time between frames It features high photon detection efficiency in the visible spectral region and low dark counting rates even at room temperature The imager is easily integrated into different applications thanks to the input optical adapter and a high speed USB 3 0 computer interface The camera differs from conventional CCD or CMOS sensors because it performs a fully digital acquisition of the light signal Each pixel effectively counts the number of photons which are detected by the sensor during the acquisition time IMPORTANT In order to execute a program which links to the SDK libraries a set of DLL should be placed in the same directory as the execut
11. Img Ulnt16 dim DIISDKExport SPC2Return SPC2_Average_Img SPC2_H spc2 double x lmg DIISDKExport SPC2Return SPC2_StDev_lmg SPC2_H spc2 double Img DIISDKExport SPC2Return SPC2_Set_Correlation_Mode SPC2_H spc2 CorrelationMode CM int NCorr Channels State s DIISDKExport SPC2Return SPC2_Correlation_Img SPC2_H spc2 DIISDKExport SPC2Return SPC2_Save_Correlation_Img SPC2_H spc2 char filename DIISDKExport SPC2Return SPC2_Calibrate_DeadTime SPC2_H spc2 DIISDKExport SPC2Return SPC2_Calibrate_Gate SPC2_H spc2 JN PHOTON DEVICES Micro Photo Devices s r l 5 1 SPC2_SDK h File Reference Page 41 of 53 5 1 1 Detailed Description SPC2 software development kit This C header contains all the functions to operate the SPC2 camera in user defined applications 5 1 2 Macro Definition Documentation 5 1 2 1 define MAX_DEAD_TIME 600 Maximum allowed dead time in nanoseconds The dead time is set to MAX_DEAD_TIME when higher values are requested Examples SDK_Example c 5 1 2 2 define MIN_DEAD_TIME 200 Minimum allowed dead time in nanoseconds The darkcounts rate and after pulsing probability depend on the used dead time setting the lower the dead time the higher the darkcounts rate and after pulsing probability However a long dead time limits the maximum number of photons per second detected by the matrix of avalanche photodiodes It is recommended to set this parameter to short values as e g 250
12. UInt16 Img UInt16 hist int i 0 memset hist 0 65535 sizeof Ulnt16 for i 0 1 lt 2048 i hist Img i kkkkkkkkkkkkkkkkkkkkkkkkkkkkxkkkxkxxxx ff ER Main code iy yy TV KK ROR KOR a o int main void variables definition PC3_H spc3 NULL Int16 Img NULL hist 65535 AppliedDT 0 har header 32 nt integFrames 10 ouble read_bytes 0 total_bytes 0 nt i 0 3 0 k 0 out 0 hort trig 0 ouble gateoff 0 ouble x NULL y NULL Imgd NULL oublex data NULL har c 0 fname NULL ILE f NULL ime_t start stop har Test Live mode write on stdout 10 images 0 Holdoff mean number of photons at different holdoff values 1 Dead time corrector improves the image quality 2 Background subtraction 2 output files with and without BG 3 Gate 1000 images normal 1000 images with gate 3 ns shift 5 ns arthoaeanhartraracqcn 1 4 Synchronization output 5 Background statistics 6 Gate calibrate the length of the gate signal 7 Gate width of the gate as a function of the offset 8 Read and write test images 9 Calculate the correlation image a Continuous acquisition and subarray selection b y Imgd doublex calloc 1 2048 sizeof double Img Ulnt16x calloc 1 2048 sizeof Ulnt16 data doublex calloc 1 2048x sizeof double x doublex calloc 1 65535 sizeof double y doublex
13. of 1st FLIM measurement 1st gate MPD Micro Photo Devices s r l 4 5 Additional methods Page 33 of 53 shift of 2nd FLIM measurement 2nd gate shift of 2nd FLIM measurement nth gate shift of 2nd FLIM measure ment etc OME TIFF file could be opened with any image reader compatible with TIFF file since metadata are saved into the Image Description tag in XML format In order to decode OME TIFF metadata it is possible to use free OME TIFF reader such as OMERO or the Bio Formats plugin for ImageJ For more details see the OME TIFF web site http ww openmicroscopy org site support ome model ome tiff OME TIFF metadata include the ModuloAlongT tag which allows the processing of FLIM data with dedicated FLIM software such as FLIMfit see http www openmicroscopy org site products partner flimfit SPC3 file are binary files composed by a header with acquisition metadata followed by raw image data containg the 8 16 bit pixel values in row major order The byte order is little endian for the 16 bit images The header is composed by a signature of 8 byte and a metadata section of 32 byte as follows multibyte fields are little endian Byte offset Number of bytes Description 0 8 File signature 0x4d5044ff03000000 8 1 Number of rows 9 1 Number of colums 10 1 Bit per pixel 11 1 Counters in use 12 2 Hardware integration time multiples of 10ns 14 2 Summed fram
14. of the SOFTWARE PRODUCT or any part thereof including but not limited to errors or omissions contained therein libel infringements of rights of publicity privacy trademark rights business interruption personal injury loss of privacy moral rights or the disclosure of confidential information HEE AE AE E AE E AE E AE FE AE FE AE AE AE AE AE AE ARE EE EE RE RA Y include SPC3_SDK h include lt stdio h gt include lt math h gt include lt time h gt include lt stdlib h gt include lt string h gt if defined __linux__ define SLEEP usleep define MILLIS 1000 elif defined __APPLE__ define SLEEP usleep define MILLIS 1000 include lt unistd h gt elif defined _WIN32 include lt Windows h gt define SLEEP Sleep define MILLIS 1 endif RRR RRR KKK KKK KR KKK KR RRR KR RK RR RR SS ey ef Support functions RA uy El kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkxkkx x xx x Calculate the mean value of a UInt16 image double mean UInt16 Img UInt16 NPixel int i 0 Page 44 of 53 Example Documentation double res 0 0 for i 0 i lt NPixel i rest double Img i return res double NPixel Calculate the mean value of a double image double mean_double double Img UInt16 NPixel int i 0 double res 0 0 for i 0 i lt NPixel i rest Img il return res double NPixel Create an histogram of the distribution of photon counts over the imager void Hist
15. over all the acquired images is calculated This is stored in the Img array Micro Photo Devices s r l 0 MA iros Page 36 of 53 Module Documentation Parameters spc3 Pointer to the SPC3 handle Img Pointer to the output double image array The size of the array must be at least 8 KB counter Desired counter Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location INVALID_OP No images were acquired Examples SDK_Example c MPP Micro Photo Devices s r l 4 6 MPD only Calibration functions Page 37 of 53 4 6 MPD only Calibration functions Functions DIISDKExport SPC3Return SPC3_Calibrate_DeadTime SPC3_H spc3 DIISDKExport SPC3Return SPC3_Calibrate_Gate SPC3_H spc3 4 6 1 Detailed Description Functions for internal MPD use 4 6 2 Function Documentation 4 6 2 1 DIISDKExport SPC3Return SPC3_Calibrate_DeadTime SPC3_H spc3 Calibrate the dead time time Only for MPD use Calibrate the dead time of the device The function outputs a calibration file Out dat Parameters spc3 SPC3 handle Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location UNABLE_CREATE_ FILE Unable to create the output file 4 6 2 2 DIISDKExport SPC3Return SPC3 _Calibrate Gate SPC3_H spc3 Calibrate the gate width Only for MPD use Calibrate the gate width of the device The function outputs a calibration file GateCalib
16. Live_Mode_OFF SPC3_H spc3 Turn off the Live mode Parameters spc3 SPC3 handle Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location INVALID_OP The live mode is already inactive See also SPC3_Set_Live_Mode_ON Examples SDK_Example c 4 3 2 13 DIISDKExport SPC3Return SPC3_Set_Live_Mode_ON SPC3_H spc3 Turn on the Live mode The camera is set in the Live mode i e it continuously acquires images free running mode The frames which are not transferred to the computer are discarded Therefore the time laps between two frames is not constant and it will depend on the transfer speed between the host computer and the camera This mode is very useful to adjust optical components or to align the camera position When the camera is in Live mode no acquisition of images by SPC3_Get_Snap or SPC3_Get_Memory can be performed Parameters spc3 SPC3 handle Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location INVALID_OP The live mode has been already started See also SPC3_Set_Live_Mode_OFF SPC3_Get_Memory SPC3_Get_Snap Micro Photo Devices s r l YMPD Page 22 of 53 Module Documentation Examples SDK_Example c 4 3 2 14 DIISDKExport SPC3Return SPC3_Set_Sync_In_State SPC3_H spc3 State s Set the sync in state Set the camera to wait for an input trigger signal before starting an acquisition
17. NULL_POINTER The provided SPC3_H points to an empty memory location 4 4 2 10 DIISDKExport SPC3Return SPC3_Is16Bit SPC3_H spc3 short x s16bit Get the actual bitdepth of acquired data Data from the camera will be 16bit per pixel if NFramesInteg gt 1 or DTC is enabled or background subtraction is enabled or 8bit per pixel otherwise This function provides actual bitdepth with the current settings Parameters spc3 SPC3 handle is16bit Actual status The value is 0 if bitdepth is 8bit and 1 if bitdepth is 16bit This parameter is referenced Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location 4 4 2 11 DIISDKExport SPC3Return SPC3_IsTriggered SPC3_H spc3 short x isTriggered Pool the camera for external trigger staus Pool the camera in order to know if an external sync pulse was detected The result is meaningfull only if the camera was previously set to wait for an external sync Parameters spc3 SPC3 handle isTriggered Actual status The value is 0 if no sync pulse was detected so far 1 otherwise This parameter is referenced Micro Photo Devices s r l YMPD Page 28 of 53 Module Documentation Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location Examples SDK_Example c 4 4 2 12 DIISDKExport SPC3Return SPC3_Prepare_Snap SPC3_H spc3 Prepare the camera to the acquistion of a snap This command
18. The deallocation of this memory is automatically performed when the SPC3_destr function is called or by setting the State s equal to Disabled Parameters spc3 SPC3 handle CM Selected autocorrelation algorithm NCorrChannels Number of global lag channels When the linear correlation algorithm is selected the first NChannel lags are calculated where NChannel must be greater than 2 This algorithm accepts only a number of images which is a power of 2 For example if 1025 images were acquired only 1024 images are used to calculate the autocorrelation function In case of Multi tau algorithm it defines the number of channel groups The first group has 16 lags of duration equal to the exposure time of a frame The following groups have 8 lags each spaced at 2 i x Exposure time s Enable or Disable the correlation mode Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location OUT_OF_BOUND NCorrChannels must be greater than zero for the Multi tau algorithm and greater than 2 for the Linear one NOT_EN_MEMORY There is not enough memory to enable the correlation mode See also SPC3_Correlation_Img Examples SDK_Example c 4 5 2 8 DIISDKExport SPC3Return SPC3_StDev_Img SPC3_H spc3 double x Img int counter Calculate the standard deviation image Once a set of images have been acquired by SPC3_Get_Snap an image which contains for each pixel the standard deviation
19. WARNING the counters can overflow 4 1 3 2 enum CorrelationMode Type of correlation function The SDK implements two autocorrelation algorithms which can be applied to the acquired sequence of images The multi tau autocorrelation has been implemented according to Culbertson and Burden A distributed algorithm for multi tau autocorrelation Rev Sci Instrum 78 044102 2007 standard version and the linear one similar to Press Teukolsky Vetterling and Flannery Numerical Recipes 3rd Edition The Art of Scientific Computing 2007 autocor cpp Enumerator Linear Selects the linear correlation algorithm MultiTau Selects the linear multi tau algorithm 4 1 3 3 enum GateMode Gate setting Enable and disable the software gating When the setting is Enabled the SPC3 discards the detected photons by the SPAD matrix if measured outside a valid gate signal Enumerator Continuous The gate signal is always valid Pulsed The gate signal is a a square wave The photons which are detected when the gate signal is ON are counted Otherwise they are discarded 4 1 3 4 enum OutFileFormat Output file format Table of the available output file formats for the saved images Enumerator SPC3_FILEFORMAT SPC3 custom file format the first byte contains the value 8 or 16 to define whether the image has 8 or 16 bit per pixel Then the pixel values follow in row major order The byte order is little endian for the 16 bit images MPD Mi
20. _OF_BOUND SPC3 SDK custom Types 13 OutFileFormat SPC3 SDK custom Types 12 POWER_SUPPLY_ERROR SPC3 SDK custom Types 13 PrintErrorCode Constructr destructor and error handling 14 Page 52 of 53 INDEX Pulsed SPC3 SDK custom Types 12 SPC3 SDK custom Types 11 Advanced 12 BUFFER_H 11 CAMERA_NOT_POWERING_UP 13 COMMUNICATION_ERROR 13 CameraMode 12 Continuous 12 CorrelationMode 12 EMPTY_BUFFER 13 FIRMWARE_NOT_COMPATIBLE 13 Frame 13 Gate_Clk 13 GateMode 12 INVALID_NIMG_CORRELATION 13 INVALID_OP 13 Linear 12 MISSING_DLL 13 MultiTau 12 NOT_EN_MEMORY 13 NULL_POINTER 13 None 13 Normal 12 OK 13 OUT_OF_BOUND 13 OutFileFormat 12 POWER_SUPPLY_ERROR 13 Pulsed 12 SPC3_FILEFORMAT 12 SPC3_H 11 SPC3_MEMORY_FULL 13 SPC3Return 13 TIFF_LZW_COMPRESSION 12 TIFF_NO_COMPRESSION 13 TOO_MUCH_LIGHT 13 TriggerMode 13 UNABLE_CREATE_FILE 13 UNABLE_READ FILE 13 USB_DEVICE_NOT_RECOGNIZED 13 SPC3_Apply_settings Set methods 16 SPC3_Average_Img Additional methods 30 SPC3_Calibrate_DeadTime MPD only Calibration functions 37 SPC3_Calibrate_Gate MPD only Calibration functions 37 SPC3_Constr Constructr destructor and error handling 14 SPC3_Correlation_Img Additional methods 30 SPC3_Destr Constructr destructor and error handling 14 SPC3_FILEFORMAT SPC3 SDK custom Types 12 SPC3_Get_DeadTime Get methods 23 SPC3_Get_GateShift Get meth
21. able The list of the required files is SPC3_SDK d11l Software development kit interface okFrontPanel dll Low level interface Page 6 of 53 Single Photon Counting Camera Software Development Kit SPC3 SDK x PHOTON DEVICES Micro Photo Devices s r l Chapter 2 Module Index 2 1 Modules Here is a list of all modules SPC3 SDK custom Types e 11 Constructr destructor and error handling 0 o eo 14 SelmethOds 4 205 seek e ead dd de we a a e Rd E a ee E 16 Get methods 2 25 686444 a a a a a A e oe 23 Additionalmethods ios soe serce a e a aa ER AIR 30 MPD only Calibration functions Page 8 of 53 Module Index x PHOTON DEVICES Micro Photo Devices s r l Chapter 3 File Index 3 1 File List Here is a list of all documented files with brief descriptions SPC3_SDK h SPC3 software development kit 2 000 0 ee ee Page 10 of 53 File Index x PHOTON DEVICES Micro Photo Devices s r l Chapter 4 Module Documentation 4 1 SPC3 SDK custom Types Typedefs typedef struct _SPC3_H SPC3_H typedef unsigned char x BUFFER_H Enumerations 4 1 1 enum SPC3Return OK 0 USB_DEVICE_NOT_RECOGNIZED 1 CAMERA_NOT_POWERING_UP 3 COMMUNICA TION_ERROR 5 OUT_OF_BOUND 6 MISSING_DLL 7 EMPTY_BUFFER 8 NOT_EN_MEMORY 9 NULL_POINTER 10 INVALID_OP 11 UNABLE_CREATE_FILE 12 UNABLE_READ_FILE 13 FIRMWARE_NOT_COMPATIBLE
22. adTime SPC3_H spc3 Ulnt16 Val DIISDKExport SPC3Return SPC3_Set_DeadTime_Correction SPC3_H spc3 State s DIISDKExport SPC3Return SPC3_Set_Advanced_Mode SPC3_H spc3 State s DIISDKExport SPC3Return SPC3_Set_Background_Img SPC3_H spc3 Ulnt16 lmg DIISDKExport SPC3Return SPC3_Set_Background_Subtraction SPC3_H spc3 State s DIISDKExport SPC3Return SPC3_Set_Gate_Values SPC3_H spc3 Int16 Shift Int16 Length DIISDKExport SPC3Return SPC3_Set_Gate_Mode SPC3_H spc3 GateMode Mode DIISDKExport SPC3Return SPC3_Set_Trigger_Out_State SPC3_H spc3 TriggerMode Mode DIISDKExport SPC3Return SPC3_Set_Sync_In_State SPC3_H spc3 State s DIISDKExport SPC3Return SPC3_Set_Live_Mode_ON SPC3_H spc3 DIISDKExport SPC3Return SPC3_Set_Live_Mode_OFF SPC3_H spc3 DIISDKExport SPC3Return SPC3_Set_FLIM_Par SPC3_H spc3 Ulnt16 FLIM_steps Ulnt16 FLIM_ shift Int16 FLIM_start Ulnt16 Length int FLIM_frame_time double FLIM_bin_width DIISDKExport SPC3Return SPC3_Set_FLIM_State SPC3_H spc3 State FLIM_State DIISDKExport SPC3Return SPC3_Apply_settings SPC3_H spc3 4 3 1 Detailed Description Functions to set parameters of the SPC3 camera 4 3 2 Function Documentation 4 3 2 1 DIISDKExport SPC3Return SPC3_Apply settings SPC3_H spc3 Apply settings to the camera This function must be called after any Set function except SPC3_Set_Live Mode _ON and SPC3_Set Live Mode_OFF in order to apply the settings to the camera Par
23. alues 1 800 FLIM_start Start delay for FLIM sequence in thousenths of gate period 20ns Accepted values 400 400 Length Duration of the ON gate signal The unit is percentage Accepted values 0 100 Total time required to perform each FLIM acquisition in multiples of 10ns Value is referenced FLIM_frame_time FLIM_bin_width Calibrated bin width in ps for the specific camera Nominal value is 20ps i e 1 1000 of gate period Value is referenced Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location OUT_OF_BOUND Parameters are out of bound Please note that the function not only checks if the single parameters are acceptable but also checks if the combination of parameters would result in an invalid gate setting E g FLIM_steps 100 FLIM_start 0 FLIM_shift 15 are not allowed since they would result in a final gate shift of 1500 thousenths of period See also SPC3_Set_Par Micro Photo Devices s r l amp YMPD Page 20 of 53 Module Documentation 4 3 2 9 DIISDKExport SPC3Return SPC3_Set_FLIM_State SPC3_H spc3 State FLIM_State Enable or disable FLIM mode FLIM mode automatically set the number of used counters to 1 FLIM mode cannot be enabled if Exposure time is set to a value lower than 1040 Parameters spc3 SPC3 handle FLIM_State Enable or disable the FLIM mode Returns OK NULL_POINTER The provided SPC3_H p
24. ameters spc3 SPC3 handle Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location Examples SDK_Example c 4 3 2 2 DIISDKExport SPC3Return SPC3_Set_Advanced_Mode SPC3_H spc3 State s Change the operating mode Set the operating mode to Normal or Advanced Normal mode is the default setting Aedo anri TnS Micro Photo Devices s r l 4 3 Set methods Page 17 of 53 Parameters spc3 SPC3 handle s Enable or disable the advanced mode Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location 4 3 2 3 DIISDKExport SPC3Return SPC3_Set_Background_Img SPC3_H spc3 Ulnt16 x Img Load a background image to perform hardware background subtraction The control electronics is capable of performing real time background subtraction A background image is loaded into the internal camera memory Parameters spc3 SPC3 handle Img Pointer to a 2048 Ulnt16 array containing the background image WARNING The user should check the array size to avoid the corruption of the memory heap Returns OK NULL_POINTER The provided SPC3_H or Img point to an empty memory location INVALID_OP Unable to set the background image when the live mode is ON Examples SDK_Example c 4 3 2 4 DIISDKExport SPC3Return SPC3_Set_Background_Subtraction SPC3_H spc3 State s Enable or disable the hardware background subtraction
25. ap spc3 SPC3_Save_Img_Disk spc3 1 20 Test20_Im SPC3_FILEFORMAT reading images from file printf Read the images from the disk and print the value of the top left corner pixel for each frame n Press ENTER to continue n header case ta i MultiTau case Bb getchar SPC3_ReadSPC3FileFormatImage Test20_Im 1 1 Img header printf Rows d Columns d n header 0 header 1 for i 1 1 lt 20 1 SPC3_ReadSPC3FileFormat Image Test20_Im i 1 Img printf Image d pixel value Shu n i Img 0 break Correlation image SPC3 constructor and parameter setting out int SPC3_Constr amp spc3 Normal SPC3_Set_Camera_Par spc3 10500 1024 64 1 1 Disabled Disabled Disabled SPC3_Set_DeadTime spc3 100 SPC3_Apply_settings spc3 acquire images printf Acquiring the images n SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 computer correlation SPC3_Set_Correlation_Mode spc3 8 Enabled printf Starting the multi tau autocorrelation algorithmin start clock SPC3_Correlation_Img spc3 1 stop clock printf The correlation has terminated in 3f s n stop start float CLOCKS_PER_SEC SPC3_Save_Correlation_Img spc3 Correlation_MultiTau spcc break Continuous acquisition number of integration frames selection SPC3 constructor and parameter setting out int SPC3_Constr amp spc3 Normal printf
26. by SPC3_Set_Camera_Par In FLIM mode NFrames FLIM acquisitions will be acquired This command works only when SPC3_Prepare_Snap has already been called This function will not exit until the required number of images has been downloaded For this reason if the camera is configured for waiting and External Sync before calling this function it could be useful to pool the camera for the trigger state using the SPC3_IsTriggered function Parameters spc3 PC2 handle Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location INVALID_OP Unable to acquire images when the live mode is ON Use instead SPC3_Get_Live_Img INVALID_OP When the background subtraction dead time correction or normal acquisition mode are enabled a maximum of 65536 images can be acquired See also SPC3_Set_Camera_Par SPC3_Prepare_Snap SPC3_Set_Sync_In_State SPC3_IsTriggered JN PHOTON DEVICES Micro Photo Devices s r l 4 4 Get methods Page 27 of 53 Examples SDK_Example c 4 4 2 9 DIISDKExport SPC3Return SPC3_GetVersion SPC3_H spc3 double x Firmware_Version double Software_Version Get the SDK and camera firmware version Parameters spc3 SPC3 handle Version of the camera firmare in the format x xx This parameter is referenced Firmware_ Version Soft Version of the SDK in the format x xx This parameter is referenced ware_Version Returns OK
27. configures the camera to acquire a snap of NFrames images as set by the SPC3_Set_Camera_Par function In FLIM mode NFrames FLIM acquisitions of a FLIM sequence will be acquired If an External Sync is required the camera will wait for a pulse on the Sync input before acquiring the images and saving them to the internal memory otherwise they are acquired and saved immediately Once acquired snap must then be transferred to the PC using the SPC3_Get_Snap function Parameters spc3 SPC3 handle Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location INVALID_OP Unable to acquire images when the live mode is ON Use instead SPC3_Get_Live_Img INVALID_OP When the background subtraction dead time correction or normal acquisition mode are enabled a maximum of 65536 images can be acquired See also SPC3_Set_Camera_Par SPC3_Get_Snap SPC3_Set_Sync_In_State Examples SDK_Example c 4 4 2 13 DIISDKExport SPC3Return SPC3_Start_ContAcq SPC3_H spc3 char filename 256 Put the camera in continuos acquisition mode Compatible with FLIM mode If the camera was set to wait for an external sync the acquistion will start as soon as a pulse is detected on the Sync input otherwise it will start immediately The output file name must be provided when calling this fuction Data are stored in the camera internal memory and must be downloaded calling the SPC3_Get_Memory function as soon as p
28. cro Photo Devices s r l 4 1 SPC3 SDK custom Types Page 13 of 53 TIFF_LZW_COMPRESSION Multipage TIFF files LZW compressed The file follows the OME TIFF speci fication It may be read with any reader able to open TIFF file but OME TIFF compatible reader will also show embedded metadata on acquisition parameters For more information see the OME TIFF web site http www openmicroscopy org site support ome model ome tiff WARNING the creation of TIFF files might require long execution times TIFF_NO_COMPRESSION Multipage TIFF without compression The file follows the OME TIFF specifica tion It may be read with any reader able to open TIFF file but OME TIFF compatible reader will also show embedded metadata on acquisition parameters For more information see the OME TIFF web site http www openmicroscopy org site support ome model ome tiff WARNING the creation of TIFF files might require long execution times 4 1 3 5 enum SPC3Return Error table Error code returned by the SPC3 functions Enumerator OK The function returned successfully USB_DEVICE_NOT_RECOGNIZED The USB device driver has not been initialized Is there any device con nected CAMERA_NOT_POWERING_UP Internal power supply is not powering up Check connections and restart the camera If problems persists contact MPD COMMUNICATION_ERROR Communication error during readout Check USB connection OUT_OF_BOUND One or more parameters passed to the function are
29. dat Parameters spc3 SPC3 handle Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location UNABLE_CREATE_FILE Unable to create the output file Micro Photo Devices s r l YMPD Page 38 of 53 Module Documentation x PHOTON DEVICES Micro Photo Devices s r l Chapter 5 File Documentation 5 1 SPC2 SDK h File Reference include lt stdio h gt include lt math h gt include lt string h gt Macros e define MIN_DEAD_TIME 200 e define MAX_DEAD_TIME 600 e define MAX_GATE_WIDTH 100 e define MIN_GATE_WIDTH 0 e define MAX_GATE_SHIFT 50 e define MIN_GATE_SHIFT 50 Typedefs e typedef unsigned short Ulnt16 e typedef short Int16 e typedef unsigned Ulnt32 e typedef struct _SPC2_H SPC2_H e typedef unsigned char x BUFFER_H Enumerations enum SPC2Return OK 0 USB_DEVICE_NOT_RECOGNIZED 1 ELECTRONIC_INTERFACE_NOT_RECOGNIZED 2 FAILED_FPGA_CONFIGURATION 3 FPGA_USB_DRIVER_FAILURE 4 COMMUNICATION_ERROR 5 OUT_OF_BOUND 6 MISSING_ DLL 7 EMPTY_BUFFER 8 NOT_EN_ MEMORY 9 NULL_POINTER 10 INVALID_OP 11 UNABLE_CREATE_FILE 12 UNABLE_READ_FILE 13 FIRMWARE_NOT_COMPATIBLE 14 USB PORT_NOT_EN_ POWER 15 TOO_MUCH_LIGHT 16 INVALID_NIMG_CORRELATION 17 SPC2_MEMORY FULL 18 enum OutFileFormat SPC2_FILEFORMAT 0 TIFF_LZW_COMPRESSION 1 TIFF_NO_COMPRESS ION 2 enum GateMode Continuous
30. ee ed eae PRS ee ewe a be ee ee eS 43 2 Function Documentation o s s se s e saot a soea ee Re be ee ee eo 432 1 SPCS Apply settings os ss co so mp eee ee A 4 3 2 2 SPC3 Set_Advanced Mode e Page 2 of 53 CONTENTS 43 20 SPC3 Set Background img lt so s ces emed d ta ake yaa Ew 17 4 3 2 4 SPC3_Set_Background_Subtraction o o ooo e e 17 43 25 SPC3 Set Camera Par e sco satya sg dorod ee we ee 17 4 3 2 6 SPCS Set DeadTime 4 2262 ced BA Awe ee i den iddaa 18 4 3 2 7 SPC3 Set _DeadTime Correction 0 00002 eee eee 19 O20 SPC Se FUM Par wean Reha eae es eee Ee a Re A es 19 4323 SPC Set FLIM Sale 24 5 e848 pee eee be eee ee we Re 20 4 3 2 10 SPC3 Set Gate Mode ra csa rysio darasi eee ee 20 43211 SPCS Set Gate Values 2 ss scce cnica bedda d bten pd ee 20 4 3 2 12 SPC3_Set_Live Mode OFF oc s aa ah dew ee eh ery a i 21 4 3 2 13 SPC3_Set_Live_Mode_ON 2 2 ee ee es 21 43 214 SPC3 Set Sync ln State oe c soa sce ece Ree eee RE ee eS 22 4 3 2 15 SPC3_Set_Trigger Out_State 2 2 220000 2 22 44 Germenogs o oani ee bebe ke e bet db bedie be be ees 23 44 1 Detailed Description 256246 be RR RA ra e a 23 442 FUNCION Documentation aa a a eh ed eee Poh A do eee ee ek e Aa 23 4421 SPC3_ Get DeadTime 83558544 Pee ee ee 23 AZ SPOS Get GeO culiaos eee oe a 24 4423 SPCS Get Gatewith o o c oc a a bebe ee Peete ewes 24 4 4 2 4 SPC3 Get Ima
31. es 16 1 Dead time correction enabled 17 1 Internal gate duty cycle 0 100 18 2 Holdoff time ns 20 1 Background subtraction enabled 21 1 Data for counters 1 and 2 are signed 22 1 FLIM enabled 23 1 FLIM shift 24 1 FLIM steps 25 4 FLIM frame length multiples of 10ns 29 2 FLIM bin width fs 31 1 PDE measurement 32 2 Start wavelength nm 34 2 Stop wavelength nm 36 2 Step nm 38 2 unused SPC3 file can be read using the provided ImageJ Fiji plugin Parameters spc3 SPC3 handle filename Name of the output file Value is referenced mode File format of the output images Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location INVALID_OP No images were acquired or the selected range of images is not valid UNABLE_CREATE_FILE Unable to create the output file 4 5 2 6 DIISDKExport SPC3Return SPC3_Save_Img_Disk SPC3_H spc3 Ulnt32 Start_Img Ulnt32 End_Img char filename OutFileFormat mode Save the selected images on the hard disk Micro Photo Devices s r l NI tet Maren verte Page 34 of 53 Module Documentation This function saves the acquired images on the hard disk The output file format can be either a multipage TIFF with embedded acquisition metadata according to the OME TIFF format or the proprietary SPC3 format For FLIM measurements use the SPC3_Save_FLIM_Disk function If TIFF format is selected the desired images w
32. ge Buffer ie aon ee ee ee es 24 44 25 SPCS Get mg Position lt lt lt etarra ee es 25 4 4 2 6 SPC3_Get_Live Img e 25 44 2 7 SPCS Get Memory 2 2 2 2 6254 04 ne bee He hehe eee i been 25 44 28 SPC3 Get Snap es ve ee ee rarem eee a Ew 26 4429 SPCo Geversion s sasa eS ke ra eee ain h 27 442 10 SPCSISIGBH lt acoc cem DEE o Pe eee eee ee eS 27 14211 SPOS ISTIQUERO sosa Re ape Ae ee ok ee A wp A we a a 27 442 12 SPCS Prepare Shap 2 2 4 28 54 eb me Pee eed bh 28 442 18 SPCS Starti ConmtAcg o cocos aaa ke ee a a 28 Adela SPCS Slop COMIAGO s d 2 5 6024 005 ae bh eee ee A YA ee 29 4 55 POGtmnAlINGINOES rasei ea EE ERE SG eS ee PE ae ee ee 30 45 1 Detailed Descriptio i o e o c sacc 2b eee eR RR Pe eS 30 45 2 Furction Documental e e ce see wea ee EE EEA he we 30 452 1 SPOS Average MO 22 2 24500646 Sa eee ee ee ee ee 30 45 22 SPOS Corretationimg i ra 6646 e044 4 be tA eee eee ee ee 30 4 5 2 3 SPC3_ReadSPC3FileFormatImage o o e 2s 31 4 5 2 4 SPC3_ Save _Correlation_Img e so 31 2525 PCI Save FUM DSK oscars Ba a a a 32 4525 SPCO3 Save Ima Disk s cg god wow es da E a 33 4 5 2 7 SPC3_Set_Correlation_Mode 35 JN PHOTON DEVICES Micro Photo Devices s r l CONTENTS Page 3 of 53 4 6 MPD only Calibration functions 4 6 1 4 6 2 5 File Documentation 5 1 SPC2_SDK h File Reference Sal 5 1 2 6
33. ill be saved in a file for each enabled counter If SPC3 format is selected a single SPC3 file will be created for all the counters OME TIFF file could be opened with any image reader compatible with TIFF file since metadata are saved into the Image Description tag in XML format In order to decode OME TIFF metadata it is possible to use free OME TIFF reader such as OMERO or the Bio Formats plugin for ImageJ For more details see the OME TIFF web site http www openmicroscopy org site support ome model ome tiff SPC3 file are binary files composed by a header with acquisition metadata followed by raw image data containg the 8 16 bit pixel values in row major order The byte order is little endian for the 16 bit images In case more counters are used data are interlaced i e the sequence of frames is the following 1st frame of 1st counter 1st frame of 2nd counter 1st frame of 3rd counter 2nd frame of 1st counter etc The header is composed by a signature of 8 byte and a metadata section of 32 byte as follows multibyte fields are little endian Byte offset Number of bytes Description 0 8 File signature 0x4d5044ff03000000 8 1 Number of rows 9 1 Number of colums 10 1 Bit per pixel 11 1 Counters in use 12 2 Hardware integration time multiples of 10ns 14 2 Summed frames 16 1 Dead time correction enabled 17 1 Internal gate duty cycle 0 100 18 2 Holdoff ti
34. ion data Read_SPCC fname 6 f fopen fname rb 7 buf fread f 3 int32 8 data NChannel buf 1 9 data NPixel buf 2 10 data IsMultiTau buf 3 1 12 data CorrelationImage reshape fread f data NPixelx data NChannel float64 13 data NChannel 32 32 14 data CorrelationImage permute data CorrelationImage 2 3 1 15 data t fread f data NChannel float64 16 fclose f Parameters spc3 SPC3 handle filename Name of the output file Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location INVALID_OP The autocorrelation which has been calculated is not valid UNABLE_CREATE_FILE Unable to create the output file See also SPC3_Set_Correlation_Mode Examples SDK_Example c 4 5 2 5 DIISDKExport SPC3Return SPC3_Save FLIM Disk SPC3_H spc3 char x filename OutFileFormat mode Save the FLIM acquisition on the hard disk This function saves the acquired FLIM images on the hard disk The output file format can be either a multipage TIFF with embedded acquisition metadata according to the OME TIFF format or the proprietary SPC3 format For standard measurements use the SPC3_Save_Img__Disk function For both formats image data is composed by a set of images following a FLIM first time second scheme i e with the following frame sequence 1st gate shift of 1st FLIM measurement 2nd gate shift of 1st FLIM measurement nth gate shift
35. ired Micro Photo Devices s r l MPP Page 14 of 53 Module Documentation 4 2 Constructr destructor and error handling Functions DIISDKExport SPC3Return SPC3_Constr SPC3_H spc3_in CameraMode m char Device_1D DIISDKExport SPC3Return SPC3_Destr SPC3_H spc3 DIISDKExport void PrintErrorCode FILE x fout const char FunName SPC3Return retcode 4 2 1 Detailed Description Functions to construct and destruct SPC3 objects and for error handling 4 2 2 Function Documentation 4 2 2 1 DIISDKExport void PrintErrorCode FILE x fout const char x FunName SPC3Return retcode Print an error message All the SDK functions return an error code to inform the user whether the issued command was successfully exe cuted or not The result of the execution of a function can be redirect to a text file by providing a valid file pointer Parameters fout Output text file FunName Additional text to define the warning error Usually the name of the calling function is provided retcode Error code returned by a SDK command 4 2 2 2 DIISDKExport SPC3Return SPC3_Constr SPC3_H x spc3_in CameraMode m char x Device_ID Constructor It allocates a memory block to contain all the information and buffers required by the SPC3 If multiple devices are connected to the computer a unique Device ID should be provided to correctly identify the camera The camera ID can be found in the camera documentatio
36. kB header Array in which the header of SPC3 file is saved Returns OK UNABLE_READ_FILE Unable to read the input file Is it a SPC3 file OUT_OF_BOUND The desired counter or image exceeds the file size NOT_EN_ MEMORY Not enough memory to store the data contained in the file Examples SDK_Example c 4 5 2 4 DIISDKExport SPC3Return SPC3_Save_Correlation_lmg SPC3_H spc3 char x filename Save the autocorrelation functions on the hard disk This function requires that SPC3_Set_Correlation_Mode has been previously called The autocorrelation data are stored in a spcc binary file The spcc binary file is organized as follows Byte offset Type Number of bytes Description 0 int 4 Number of lag times NLag Micro Photo Devices s r l MPD MICRO PHOTON DEVICES Page 32 of 53 Module Documentation 4 int 4 Number of pixels This value must be 1024 NPix 8 int 4 Selected algorithm 0 Linear 1 Multi tau 12 double 8 x NLag Autocorrelation values of the first pixel 12 8 x NLag double 8 NLag Autocorrelation values of the second pixel double 8 x NLag Autocorrelation values of the N pixel 12 8 x NPix 1 x NLag double 8 x NLag Autocorrelation values of the last pixel 12 8 x NPix x NLag double 8 x NLag Lag times A simple Matlab script can be used to read the data for further processing or visualization 4 5 funct
37. leFormat mode DIISDKExport SPC3Return SPC3_ReadSPC3FileFormatlmage char filename Ulnt32 Imgldx Ulnt16 counter Ulnt16 Img char header 32 DIISDKExport SPC3Return SPC3_Average_Img SPC3_H spc3 double Img int counter DIISDKExport SPC3Return SPC3_StDev_Img SPC3_H spc3 double Img int counter DIISDKExport SPC3Return SPC3_Set_Correlation Mode SPC3_H spc3 CorrelationMode CM int NCor rChannels State s DIISDKExport SPC3Return SPC3_Correlation_Img SPC3_H spc3 int counter DIISDKExport SPC3Return SPC3_Save_Correlation_Img SPC3_H spc3 char filename 4 5 1 Detailed Description Additional utility functions 4 5 2 Function Documentation 4 5 2 1 DIISDKExport SPC3Return SPC3_Average Img SPC3_H spc3 double x Img int counter Calculate the average image Once a set of images have been acquired by SPC3_Get_Snap an image which contains for each pixel the average value over all the acquired images is calculated This is stored in the Img array Parameters spc3 SPC3 handle Img Pointer to the output double image array The size of the array must be at least 8 kB counter Desired counter Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location INVALID_OP No images were acquired Examples SDK_Example c 4 5 2 2 DIISDKExport SPC3Return SPC3_Correlation_Img SPC3_H spc3 int counter Calculate the autocorrelation function The autocorrela
38. me ns 20 1 Background subtraction enabled 21 1 Data for counters 1 and 2 are signed 22 1 FLIM enabled 23 1 FLIM shift 24 1 FLIM steps 25 4 FLIM frame length multiples of 10ns 29 2 FLIM bin width fs 31 1 PDE measurement 32 2 Start wavelength nm 34 2 Stop wavelength nm 36 2 Step nm 38 2 unused SPC3 file can be read using the provided ImageJ Fiji plugin Parameters spc3 SPC3 handle Start_Img Index of the first image to save Accepted values 1 Number of acquired images End_Img Index of the last image to save Accepted values Start_Img Number of acquired images filename Name of the output file Value is referenced mode File format of the output images x PHOTON DEVICES Micro Photo Devices s r l 4 5 Additional methods Page 35 of 53 Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location INVALID_OP No images were acquired or the selected range of images is not valid UNABLE_CREATE_FILE Unable to create the output file Examples SDK_Example c 4 5 2 7 DIISDKExport SPC3Return SPC3_Set Correlation Mode SPC3_H spc3 CorrelationMode CM int NCorrChannels State s Enable the correlation mode This function must be called before invoking SPC3_Correlation_Img When this function is called the memory required to save the new data is allocated in the heap and the previously stored data are cancelled
39. meter setting out int SPC3_Constr amp spc3 Advanced SPC3_Set_Camera_Par spc3 1040 100 10000 1 Disabled Disabled Disabled f fopen BgHist txt w printf Close the camera shutter and press ENTER n getchar printf Acquiring for 1 150 i gt 50 i 50 different hold off values printf Sd ns i SPC3_Set_DeadTime spc3 i SPC3_Apply_settings spc3 SPC3_Prepare_Snap spc3 Micro Photo Devices s r l MPD Page 48 of 53 Example Documentation SPC3_Get_Snap spc3 SPC3_Average_Img spc3 data 1 for k 0 k lt 2048 k if data k lt 65535 Img k Ulnt16 floor data k 0 5 else Img k 65535 Avoid overflow Hist Img hist for j 0 3 lt 65535 j fprintf f shd hist j fprintf f n printf n fclose f break case 7 Calibrate gate SPC3 constructor and parameter setting out int SPC3_Constr amp spc3 Advanced SPC3_Set_Camera_Par spc3 1040 10000 2 1 Disabled Disabled Disabled SPC3_Set_DeadTime spc3 100 SPC3_Apply_settings spc3 printf Expose the SPC3 camera to a time independent luminous signal n room light might oscillate at 50 or 60 Hz nPress ENTER to continue n getchar if f fopen GateValues txt w NULL printf Unable to open the output file n break photon counts without any gate SPC3_Set_Gate_Mode spc3 Continuous SPC3_Prepare_Snap spc3 SPC3_Ge
40. n 9 numbers and a letter and it is printed on the screen during initialization An empty string is accepted too In this case the devices will be connected in the order which is printed on the screen Parameters spc3_in Pointer to SPC3 handle m Camera Working mode Device_ID Unique ID to identify the connected device Returns OK INVALID_OP The SPC3_H points to an occupied memory location FIRMWARE_NOT_COMPATIBLE The SDK and Firmware versions are not compatible NOT_EN_ MEMORY There is not enough memory to run the camera Examples SDK_Example c MPD Micro Photo Devices s r l 4 2 Constructr destructor and error handling Page 15 of 53 4 2 2 3 DIISDKExport SPC3Return SPC3_Destr SPC3_H spc3 Destructor It deallocates the memory block which contains all the information and buffers required by the SPC3 WARNING the user must call the destructor before the end of the program to avoid memory leakages Parameters spc3 SPC3 handle Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location Examples SDK_Example c Micro Photo Devices s r l ara aeae Page 16 of 53 Module Documentation 4 3 Set methods Functions DIISDKExport SPC3Return SPC3_Set_Camera_Par SPC3_H spc3 Ulnt16 Exposure Ulnt32 NFrames Ulnt16 NintegFrames Ulnt16 NCounters State Force8bit State Half_array State Signed_data DIISDKExport SPC3Return SPC3_Set_De
41. n SPC3 SDK custom Types 13 SPC2_SDK h 39 Set methods 16 SPC3_Apply_settings 16 SPC3_Set_Advanced_Mode 16 SPC3_Set_Background_Img 17 SPC3_Set_Background_Subtraction 17 SPC3_Set_Camera_Par 17 SPC3_Set_DeadTime 18 SPC3_Set_DeadTime_Correction 18 SPC3_Set_FLIM_Par 19 SPC3_Set_FLIM_State 19 SPC3_Set_Gate_Mode 20 SPC3_Set_Gate_Values 20 SPC3_Set_Live_Mode_OFF 21 SPC3_Set_Live_Mode_ON 21 SPC3_Set_Sync_In_State 22 SPC3_Set_Trigger_Out_State 22 TIFF_LZW_COMPRESSION SPC3 SDK custom Types 12 TIFF_NO_COMPRESSION SPC3 SDK custom Types 13 TOO_MUCH_LIGHT SPC3 SDK custom Types 13 TriggerMode SPC3 SDK custom Types 13 UNABLE_CREATE_FILE SPC3 SDK custom Types 13 UNABLE_READ_ FILE SPC3 SDK custom Types 13 USB_DEVICE_NOT_RECOGNIZED SPC3 SDK custom Types 13 Micro Photo Devices s r l MICRO PHOTON DEVICES
42. nNo output n printf Press ENTER to continue n getchar SPC3_Set_Live_Mode_OFF spc3 gate clock output SPC3_Set_Trigger_Out_State spc3 SPC3_Set_Camera_Par spc3 8192 OxFFFF 5 1 Disabled Disabled Disabled SPC3_Apply_settings spc3 SPC3_Set_Live_Mode_ON spc3 printf n nGate synchronization signal n printf Press ENTER to continueln getchar SPC3_Set_Live_Mode_OFF spc3 frame sync output SPC3_Set_Trigger_Out_State spc3 Frame SPC3_Set_Camera_Par spc3 8192 OxFFFF 5 1 Disabled Disabled Disabled SPC3_Apply_settings spc3 SPC3_Set_Live_Mode_ON spc3 printf n nFrame synchronization signal n printf Press ENTER to continue n getchar SPC3_Set_Live_Mode_OFF spc3 printf ininWait for the trigger input n trigger in enabled SPC3_Set_Sync_In_State spc3 Enabled SPC3_Set_Camera_Par spc3 4096 10 2 1 Disabled Disabled Disabled SPC3_Apply_settings spc3 SPC3_Prepare_Snap spc3 while trig 1 SPC3_IsTriggered spc3 amp trig printf Trigger signal received n break Test background statistics The output file BgHist txt contains the number of pixels which had a total number of counts given by the column index for each row values For example column 3 contains the number of pixels which had 3 dark counts Several rows are present because the histogram is calculated for several dead time SPC3 constructor and para
43. nap spc3 SPC3_Get_Snap spc3 Micro Photo Devices s r l MPD Page 46 of 53 Example Documentation Calculate the average image SPC3_Average_Img spc3 data 1 for i1 0 1 lt 2048 i if data i lt 65535 Img i UInt16 floor data i 0 5 else Img i 65535 Avoid overflow SPC3_Set_Background_Img spc3 Img SPC3_Set_Background_Subtraction spc3 Enabled SPC3_Apply_settings spc3 now acquire the image with shutter open printf n n nOpen the camera shutter and press ENTER n getchar SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 SPC3_Save_Img_Disk spc3 1 100 Im_DeadTimeCorrected TIFF_LZW_COMPRESSION printf The the dead time corrected image was acquired and stored on the hard disk succesfully n acquisition with DTC off printf n nAcquire the reference image without the dead time correction n SPC3_Set_Background_Subtraction spc3 Disabled SPC3_Set_DeadTime_Correction spc3 Disabled SPC3_Apply_settings spc3 Acquire the BG image first printf n n nClose the camera shutter and press ENTER n getchar SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 Calculate the average image SPC3_Average_Img spc3 data 1 j for i 0 1 lt 2048 i if data i lt 65535 Img i UInt16 floor data i 0 5 else Img i 65535 Avoid overflow SPC3_Set_Background_Img spc3 Img SPC3_Set_Background_Subtraction spc3 Enabled SPC3_Apply_settings
44. ningful only for Snap acquistion Accepted values 1 65534 NintegFrames Number of integrated frames Each output frame is the result of the sum of NintegFrames Accepted values 1 65534 NCounters Number of counters per pixels to be used Accepted values 1 3 Force8bit Force 8 bit per pixel acquisition Counts are trunked Meaningful only for Advanced mode Half_array Acquire only a 32x32 array Signed_data If enabled data from counters 2 and 3 are signed data with 8bit integer part and 1 bit sign Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location OUT_OF_BOUND Exposure NFrames and NintegFrames must be all greater than zero and smaller than 65535 Examples SDK_Example c 4 3 2 6 DIISDKExport SPC3Return SPC3_Set DeadTime SPC3_H spc3 UInt16 Val Update the dead time setting Every time a photon is detected in a pixel that pixel remains blind for a fix amount of time which is called dead time This setting is user defined and it ranges from MIN_DEAD_TIME and MAX_DEAD_TIME Only a sub set of this range is practically selectable a dead time calibration is performed during the production of the device This function will set the dead time to the closest calibrated value to Val The default dead time value is 50 ns Parameters spc3 SPC3 handle Val New dead time value in nanoseconds Returns OK NULL_POINTER The provided SPC3_H
45. nous signal n room light might oscillate at 50 or 60 Hz nPress ENTER to continue n getchar setting different gate width and shift for 3 0 3 lt 100 3 10 sprintf fname GateOffset_sd txt j if f fopen fname w NULL printf Unable to open the file s n fname break Micro Photo Devices s r l 6 1 SDK_Example c Page 49 of 53 printf nGate length d n j printf Shift t tMean t tStDev t t n for i 50 i lt x 50 i 10 SPC3_Set_Gate_Values spc3 i J SPC3_Apply_settings spc3 SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 SPC3_Average_Img spc3 data 1 y i 500 mean_double data 2048 SPC3_StDev_Img spc3 data 1 j y i 500 101 mean_double data 2048 x i 500 double i printf 3 0f t t 4 t t 4 n x it 500 y it 500 gateoff 100 y it 101 500 gateoff 100 fprintf 0f 4 4 n x i 500 y i 500 gateoff 100 y it101 500 gateoffx 100 Case ror fclose f printf n free fname break Save and Read images SPC3 constructor and parameter setting out int SPC3_Constr amp spc3 Advanced SPC3_Set_Camera_Par spc3 1040 20 2 1 Disabled Disabled Disabled SPC3_Set_DeadTime spc3 100 SPC3_Apply_settings spc3 acquiring and saving images printf Acquiring 20 images and save them on the hard drive in the spc3 file format n SPC3_Prepare_Snap spc3 SPC3_Get_Sn
46. ns Examples SDK_Example c Micro Photo Devices s r l GMVPD Page 42 of 53 File Documentation x PHOTON DEVICES Micro Photo Devices s r l Chapter 6 Example Documentation 6 1 SDK _Example c HARA HR RTH REE HATH AE FE FE AE AE FE FE AE AE FE FE RAE EHH Copyright 2012 2015 Micro Photon Devices s r l SOFTWARE PRODUCT SPC3_SDK Micro Photon Devices MPD expressly disclaims any warranty for the SOFTWARE PRODUCT The SOFTWARE PRODUCT is provided As Is without any express or implied warranty of any kind including but not limited to any warranties of merchantability noninfringement or fitness of a particular purpose MPD does not warrant or assume responsibility for the accuracy or completeness of any information text graphics links or other items contained within the SOFTWARE PRODUCT MPD further expressly disclaims any warranty or representation to Authorized Users or to any third party In no event shall MPD be liable for any damages including without limitation lost profits business interruption or lost information rising out of Authorized Users use of or inability to use the SOFTWARE PRODUCT even if MPD has been advised of the possibility of such damages In no event will MPD be liable for loss of data or for indirect special incidental consequential including lost profit or other damages based in contract tort or otherwise MPD shall have no liability with respect to the content
47. ods 23 SPC3_Get_GateWidth Get methods 24 SPC3_Get_Image_Buffer Get methods 24 SPC3_Get_Img_Position Get methods 24 SPC3_Get_Live_Img Get methods 25 SPC3_Get_Memory Get methods 25 SPC3_Get_Snap Get methods 26 SPC3_GetVersion Get methods 27 SPC3_H SPC3 SDK custom Types 11 SPC3_Is16Bit Get methods 27 SPC3_IsTriggered Get methods 27 SPC3_MEMORY_FULL SPC3 SDK custom Types 13 SPC3_Prepare_Snap Get methods 28 SPC3_ReadSPC3FileFormatlmage Additional methods 31 SPC3_Save_Correlation_Img Additional methods 31 SPC3_Save_FLIM_Disk Additional methods 32 SPC3_Save_Img_Disk Additional methods 33 SPC3_Set_Advanced_Mode Set methods 16 SPC3_Set_Background_Img Set methods 17 SPC3_Set_Background_Subtraction Set methods 17 SPC3_Set_Camera_Par Set methods 17 SPC3_Set_Correlation_ Mode Additional methods 35 SPC3_Set_DeadTime Set methods 18 SPC3_Set_DeadTime_Correction Set methods 18 SPC3_Set_FLIM_Par Set methods 19 SPC3_Set_FLIM_ State Set methods 19 SPC3_Set_Gate_Mode Set methods 20 SPC3_Set_Gate_Values Set methods 20 SPC3_Set_Live_Mode_OFF Set methods 21 JN PHOTON DEVICES Micro Photo Devices s r l INDEX Page 53 of 53 SPC3_Set_Live_Mode_ON Set methods 21 SPC3_Set_Sync_In_State Set methods 22 SPC3_Set_Trigger_Out_State Set methods 22 SPC3_StDev_Img Additional methods 35 SPC3_Start_ContAcq Get methods 28 SPC3_Stop_ContAcq Get methods 29 SPC3Retur
48. oints to an empty memory location INVALID_OP Exposure time is lower than 1040 See also SPC3_Set_Par SPC3_Set_FLIM_Par 4 3 2 10 DIISDKExport SPC3Return SPC3_Set_Gate_Mode SPC3_H spc3 GateMode Mode Set the gate mode either continuous or pulsed Parameters spc3 SPC3 handle Mode New gate mode Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location Examples SDK_Example c 4 3 2 11 DIISDKExport SPC3Return SPC3_Set_Gate_Values SPC3_H spc3 Int16 Shift Int16 Length Change the Gate settings A gate signal is generated within the control electronics to select valid photons i e only photons which arrives when the Gate is ON are counted The gate signal is a 50 MHz square wave shift and length define the phase and duty cycle of the signal Parameters spc3 SPC3 handle Shift Phase shift of the gate signal in the ON state The unit is thousenths e 10 means a delay time of 0 01 times a 20 ns periodic signal which is equal to 200ps Accepted values 400 400 Length Duration of the ON gate signal The unit is percentage Accepted values 0 100 MPD Micro Photo Devices s r l 4 3 Set methods Page 21 of 53 Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location OUT_OF_BOUND Shift or length are outside the valid values Examples SDK_Example c 4 3 2 12 DIISDKExport SPC3Return SPC3_Set_
49. ossible in order to avoid data loss Parameters spc3 SPC3 handle filename Name of output file Meth era settee Micro Photo Devices s r l 4 4 Get methods Page 29 of 53 Returns OK NULL_POINTER The provided SPC3_H or BUFFER_H point to an empty memory location UNABLE_CREATE_FILE It was not possible to create the output file See also SPC3_Get_Memory SPC3_SPC3_Stop_ContAcq Examples SDK_Example c 4 4 2 14 DIISDKExport SPC3Return SPC3_Stop_ContAcq SPC3_H spc3 Stop the continuos acquisition of data and close the output file This function must be called at the end of the continuos acquisition in order to properly close the file WARNING If not called the output file may be unreadable and camera may have unexepected behaeviour if other functions are called Parameters spc3 SPC3 handle Returns OK NULL_POINTER The provided SPC3_H or BUFFER_H point to an empty memory location UNABLE_CREATE_ FILE It was not possible to access the output file See also SPC3_SPC3_Start_ContAca SPC3_Get_Memory Examples SDK_Example c Micro Photo Devices s r l 0 I aro eae Page 30 of 53 Module Documentation 4 5 Additional methods Functions DIISDKExport SPC3Return SPC3_Save_Img_Disk SPC3_H spc3 Ulnt32 Start_Img Ulnt32 End_Img char filename OutFileFormat mode DIISDKExport SPC3Return SPC3_Save_FLIM_Disk SPC3_H spc3 char filename OutFi
50. otal_bytes Dump the camera memory to the PC and save data to the file specified with the SPC3_Start_ContAcq function This function must be repeatedly called as fast as possible in order to free the camera internal memory and keep the acquisition going If the internal camera memory get full during acquisition an error is generated WARNING Micro Photo Devices s r l MPD Page 26 of 53 Module Documentation The camera can generate data with very high throughput up to about 205MB s Be sure to have enough disk space for your measurement Parameters spc3 SPC3 handle total_bytes Total number of bytes read Value is referenced Returns OK NULL_POINTER The provided SPC3_H or BUFFER_H point to an empty memory location UNABLE_CREATE_ FILE It was not possible to access the output file INVALID_OP Continuos acquistion was not yet started Use SPC3_SPC3_Start_ContAcq before calling this function COMMUNICATION_ERROR Communication error during data download SPC3_MEMORY_FULL Camera internal memory got full during data download Datta loss occurred Reduce frame rate or optimize your software to reduce deadtime between subsequent calling of the function See also SPC3_SPC3_Start_ContAca SPC3_SPC3_Stop_ContAcq Examples SDK_Example c 4 4 2 8 DIISDKExport SPC3Return SPC3_Get_Snap SPC3_H spc3 Get a selected number of images Acquire a set of images according to the parameters defined
51. outside the valid boundaries MISSING_DLL One or more SPC3 libraries are missing EMPTY_BUFFER An empty buffer image has been provided to the function NOT_EN_MEMORY Not enough memory is available to operate the camera NULL_POINTER A null pointer has been provided to the function INVALID_OP The required function can not be executed The device could be still in Live mode UNABLE_CREATE_FILE An output file can not be created UNABLE_READ FILE The provided file can not be accessed FIRMWARE_NOT_COMPATIBLE The camera firmware is not compatible with the current software POWER_SUPPLY_ERROR Voltage drop on internal power supply Check connections and restart the cam era If problems persists contact MPD TOO_MUCH_LIGHT Too much light was detected by the camera The protection mechanism has been en abled Decrease the amount of light on the sensor Then disconnect and reconnect the camera to the USB port INVALID_NIMG_CORRELATION The acquired number of images is not sufficient to calculate the required correlation function SPC3_MEMORY_FULL The SPC3 internal memory got full during continous acquisition Possible data loss 4 1 3 6 enum TriggerMode Type of synchronization output The Synch out SMA port can output different signals Enumerator None No output signal Gate_CIk A square wave of 50 MHz and 50 duty cycle synchronized with the software gate signal and the camera clock Frame A 60 ns pulse every time a new frame is acqu
52. points to an empty memory location INVALID_OP Unable to change the dead time when the live mode is ON Examples SDK_Example c JN PHOTON DEVICES Micro Photo Devices s r l 4 3 Set methods Page 19 of 53 4 3 2 7 DIISDKExport SPC3Return SPC3_Set_DeadTime_Correction SPC3_H spc3 State s Enable or disable the dead time correction The default setting is disabled Parameters spc3 SPC3 handle s New state for the dead time corrector Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location Examples SDK_Example c 4 3 2 8 DIISDKExport SPC3Return SPC3_Set_FLIM Par SPC3_H spc3 Ulnt16 FLIM steps Ulnt16 FLIM shift Int16 FLIM_start Ulnt16 Length int x FLIM_frame_time double FLIM_bin_width Set FLIM parameters The camera can perform automatic time gated FLIM measurements emplyoing the embedded gate generator Call this function to setup the FLIM acquisition parameters Each FLIM acquisition is composed by FLIM_steps frames each one consisting of an acquisition with Exposure and NintegFrames as set with SPC3_Set_Par The total time required to perform each FLIM acquisition is passed back to the caller through the referenced FLIM_frame_time variable Parameters spc3 SPC3 handle FLIM_steps Number of gate delay steps to be performed Accepted values 1 800 FLIM_shift Delay shift between steps in thousenths of gate period 20ns Accepted v
53. spc3 now acquire the image with shutter open printf n n nOpen the camera shutter and press ENTER n getchar SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 SPC3_Save_Img_Disk spc3 1 100 Im_DeadTimeReference TIFF_LZW_COMPRESSION printf The the dead time corrected image was acquired and stored on the hard disk succesfully n case 3 break Test background subtraction SPC3 constructor and parameter setting out int SPC3_Constr amp spc3 Normal SPC3_Set_Camera_Par spc3 4096 1000 100 1 Disabled Disabled Disabled SPC3_Apply_settings spc3 acquire background image printf n n nClose the camera shutter and press ENTER n getchar SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 SPC3_Save_Img_Disk spc3 1 1 Bg TIFF_LZW_COMPRESSION TIFF_LZW_COMPRESSION SPC3_Average_Img spc3 data 1 j for i 0 1 lt 2048 i if data i lt 65535 Img i Ulnt16 floor data i 0 5 else Img i 65535 Avoid overflow SPC3_Set_Background_Img spc3 Img acquire image with background subtration off printf Open the camera shutter and press ENTER A a ep getchar SPC3_Set_Background_Subtraction spc3 Disabled SPC3_Apply_settings spc3 SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 SPC3_Save_Img_Disk spc3 1 1 Normal acquire image with background subtration on SPC3_Set_Background_Subtraction spc3 Enabled SPC3_Prepare_Snap spc3
54. t_Img Position SPC3_H spc3 Ulnt16 Img Ulnt32 Position Ulnt16 counter Export an acquired image to an user allocated memory array Once a set of images have been acquired by SPC3_Get_Snap a single image can be exported from the SDK image buffer and saved in the memory Img array Parameters spc3 SPC3 handle Img Pointer to the output image array The size of the array must be at least 2 KB Position Index of the image to save Accepted values 1 Number of acquired images counter Number of the desired counter Accepted values 1 Number of used counters Returns OK NULL_POINTER The provided SPC3_H or Img point to an empty memory location OUT_OF_BOUND Parameters are out of bound See also SPC3_Get_Snap 4 4 2 6 DIISDKExport SPC3Return SPC3_Get_Live_Img SPC3_H spc3 Ulnt16 x Img Get a Live image Acquire a live image and store the data into the Img array This command is working only when the Live mode is turned on by the SPC3_Set_Live_Mode_ON function Parameters spc3 SPC3 handle Img Pointer to the output image array The size of the array must be at least 2 KB Returns OK NULL_POINTER The provided SPC3_H or Img point to an empty memory location INVALID_OP The live mode has not been started yet See also SPC3_Set_Live_Mode_ON Examples SDK_Example c 4 4 2 7 DIISDKExport SPC3Return SPC3_Get_Memory SPC3_H spc3 double x t
55. t_Snap spc3 SPC3_Average_Img spc3 data 1 gateoff mean_double data 2048 printf Gate OFF counts 2f n gateoff fprintf f Gate OFF counts 2f n gateoff SPC3_Set_Gate_Mode spc3 Pulsed SPC3_Apply_settings spc3 printf Acquiring n nGate t tMean t tActual Gate t t n photon counts for gate witdh ranging from 0 to 100 for i 0 i lt 100 it 1 SPC3_Set_Gate_Values spc3 0 i SPC3_Apply_settings spc3 SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 SPC3_Average_Img spc3 data 1 j y i mean_double data 2048 y i 101 y i gateoff 100 actual gate width calculated from photon counts x i double i printf 3 0 t t 2f t t 2 n xlil ylil y it101 fprintf f 0f 2f 2 n x i l yli y it101 fclose f printf n break case 8 Constancy of the gate width SPC3 constructor and parameter setting fname charx calloc 256 sizeof char out int SPC3_Constr amp spc3 Advanced SPC3_Set_Camera_Par spc3 1040 1000 2 1 Disabled Disabled Disabled SPC3_Set_DeadTime spc3 100 photon counts without any gate SPC3_Set_Gate_Mode spc3 Continuous SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 SPC3_Average_Img spc3 data 1 gateoff mean_double data 2048 printf Gate OFF counts 2f n gateoff SPC3_Set_Gate_Mode spc3 Pulsed SPC3_Apply_settings spc3 printf Expose the SPC3 camera to a time independent lumi
56. ting out int SPC3_Constr amp spc3 Advanced SPC3_Set_Camera_Par spc3 1040 10 1 1 Disabled Disabled Disabled SPC3_Apply_settings spc3 k 0 printf Acquiring n Open file if fopen DTValues txt w NULL printf Unable to open the output file n break set deadtime acquire snap calculate mean photon count value and save results for i MAX_DEAD_TIME i gt MIN_DEAD_TIME i 30 data k 0 0 SPC3_Set_DeadTime spc3 i SPC3_Apply_settings spc3 SPC3_Get_DeadTime spc3 i amp AppliedDT x k double AppliedDT SPC3_Prepare_Snap spc3 SPC3_Get_Snap spc3 SPC3_Average_Img spc3 Imgd 1 data k mean_double Imgd 2048 printf Sd ns Applied d ns An i AppliedDT data k fprintf f sd n i data k k print summary printf nDead time calibrationin for i 0 i lt k i printf sf n x i data i fclose f break Dead time corrector effect SPC3 constructor and parameter setting out int SPC3_Constr amp spc3 Normal SPC3_Set_Camera_Par spc3 4096 1000 100 1 Disabled Disabled Disabled SPC3_Set_DeadTime spc3 100 acquisition with DTC on printf Acquire the image using the dead time correction n SPC3_Set_DeadTime_Correction spc3 Enabled SPC3_Apply_settings spc3 Acquire the BG image first printf n n nClose the camera shutter and press ENTER n getchar SPC3_Prepare_S
57. tion function is estimated for each pixel This function requires that a set of images have been previously acquired by SPC3_Get_Snap and that the correlation mode is set to Enabled Depending on the selected algorithm and the total number of collected images this function can take several tens of seconds Parameters spc3 SPC3 handle Desired counter felt aari fetter Micro Photo Devices s r l 4 5 Additional methods Page 31 of 53 Returns OK NULL_POINTER The provided SPC3_H points to an empty memory location INVALID_OP No images were acquired or the correlation mode was not enabled NOT_EN_MEMORY Not enough memory to calculate the correlation function INVALID_NIMG_CORRELATION The required number of time lags of the correlation function can not be cal culated from the available number of images See also SPC3_Set_Correlation_Mode SPC3_Get_Snap Examples SDK_Example c 4 5 2 3 DIISDKExport SPC3Return SPC3_ReadSPC3FileFormatlmage char x filename Ulnt32 Imgldx Ulnt16 counter Ulnt16 x Img char header 32 Read a spc3 image from file Read the image at the Imgldx position and for desired counter in the given spc3 file from the hard disk Parameters filename Name of the output file Imgldx Image index in the file Accepted values 1 65534 counter Desired counter Accepted values 1 3 Img Pointer to the output image array The size of the array must be at least 2
58. turnVal DIISDKExport SPC3Return SPC3_ls16Bit SPC3_H spc3 short xis16bit DIISDKExport SPC3Return SPC3_IsTriggered SPC3_H spc3 short is Triggered DIISDKExport SPC3Return SPC3_GetVersion SPC3_H spc3 double xFirmware_ Version double Software_Version 4 4 1 Detailed Description Functions to get status or data from SPC3 camera 4 4 2 Function Documentation 4 4 2 1 DIISDKExport SPC3Return SPC3_Get_DeadTime SPC3_H spc3 Ulnt16 Val Ulnt16 ReturnVal Get the calibrated dead time value This function provides the closest calibrated dead time value to Val Parameters spc3 SPC3 handle Val Desired dead time value in ns No error is generated when the value is above MAX_DEAD_TIME ReturnVal Closest dead time value possible This parameter is referenced Returns OK NULL_POINTER The provided SPC3_H or ReturnVal point to an empty memory location See also SPC3_Set_DeadTime Examples SDK_Example c Micro Photo Devices s r l L MA aro aeae Page 24 of 53 Module Documentation 4 4 2 2 DIISDKExport SPC3Return SPC3_Get_GateShift SPC3_H spc3 Int16 Val Int16 x ReturnVal Get the calibrated gate shift value This function provides the closest calibrated gate shift value to Val Parameters spc3 SPC3 handle Val Desired gate shift value in thousenths of 20ns No error is generated when the value out of range instead the real boundaries are forced on ReturnVal
59. vanced SPC3 SDK custom Types 12 BUFFER_H SPC3 SDK custom Types 11 CAMERA_NOT_POWERING_UP SPC3 SDK custom Types 13 COMMUNICATION_ERROR SPC3 SDK custom Types 13 CameraMode SPC3 SDK custom Types 12 Constructr destructor and error handling 14 PrintErrorCode 14 SPC3_Constr 14 SPC3_Destr 14 Continuous SPC3 SDK custom Types 12 CorrelationMode SPC3 SDK custom Types 12 EMPTY_BUFFER SPC3 SDK custom Types 13 FIRMWARE_NOT_COMPATIBLE SPC3 SDK custom Types 13 Frame SPC3 SDK custom Types 13 Gate_Clk SPC3 SDK custom Types 13 GateMode SPC3 SDK custom Types 12 Get methods 23 SPC3_Get_DeadTime 23 SPC3_Get_GateShift 23 SPC3_Get_GateWidth 24 SPC3_Get_Image_Buffer 24 SPC3_Get_Img_Position 24 SPC3_Get_Live_Img 25 SPC3_Get_Memory 25 SPC3_Get_Snap 26 SPC3_GetVersion 27 SPC3_Is16Bit 27 SPC3_IsTriggered 27 SPC3_Prepare_Snap 28 SPC3_Start_ContAcq 28 SPC3_Stop_ContAcg 29 INVALID_NIMG_CORRELATION SPC3 SDK custom Types 13 INVALID_OP SPC3 SDK custom Types 13 Linear SPC3 SDK custom Types 12 MISSING_DLL SPC3 SDK custom Types 13 MPD only Calibration functions 37 SPC3_Calibrate_DeadTime 37 SPC3_Calibrate_Gate 37 MAX_DEAD_TIME SPC2_SDK h 41 MIN_DEAD_TIME SPC2_SDK h 41 MultiTau SPC3 SDK custom Types 12 NOT_EN_MEMORY SPC3 SDK custom Types 13 NULL_POINTER SPC3 SDK custom Types 13 None SPC3 SDK custom Types 13 Normal SPC3 SDK custom Types 12 OK SPC3 SDK custom Types 13 OUT
60. x IM PHOTON DEVICES Single Photon Counting Camera SPC Version 1 0 Software Development Kit Manual June 2015 Contents Single Photon Counting Camera Software Development Kit SPC3 SDK Module Index 21 MOQUES aiii Pa oe Pad we a eH RE OE A eh es OP Se Re oe S File Index Sl JAMAS o sachs hE ead ape a PR eee a PR ee ee a eS Module Documentation 41 SPO3 SDK custom Types ee a ee tee 4 1 1 Detailed Descnption sce 6o84 55 80 ee bee aE ee eR A ee eS 4 1 2 lyeedet Documentation s c ae sare e eo ee Re ee p a 2121 BUPRERLA o caca caosa rrea gee a A Ba bene bed bes BAe SPESE rs te a ee A ew ee a A dt A HO ee 4 1 3 Enumeration Type Documentation eee ee a ee AA GametaMode 2 2 562 v bea beeee avd See Pewh pete ews 4132 CorrelationMode lt o s sa mesa a ee ee ee Ee Aue WARURIMIOOG o o ee oe d a Bw ee ee ae me a ee ee a A 2124 DulFleFonMal sb sima a hadith ePa bala ads AAO POSTAS ua rd ee td A we ee i ELA CIIOSIIGOS aie ele o a ge a a ee A 4 2 Constructr destructor and error handling 00 e es 42 1 Detailed Description c oss ed 6 00 Ree e dee be Pee be ee ee eS 422 FUNCION DOCUMENTATION lt s a a d acm a we Bee me be ea a ie Oe e 2 A 422 2 SPCS Constr 24 6 65005 ees De Yee A eee Se es 42 29 SPOS DOS ccc a A ios Back wwe a A ee a ee E i A Boo SO MENS 001 BIS e Salt HE les ne eels es ee A A ak A ee wl a a 42 1 Detailed Description o cs oi ca 005

Download Pdf Manuals

image

Related Search

Related Contents

  Projecta PortaLite  Metabo STA 18 LTX  STIHL FS 80, 85  Brodit ProClip    NGS White MSX5    GI20Editor User Manual  Fiche 1 - Deroche  

Copyright © All rights reserved.
Failed to retrieve file