QTrk
lv_qtrk_api.h
Go to the documentation of this file.
1 
2 #include "std_incl.h"
3 #include "labview.h"
4 
5 #include "QueuedTracker.h"
6 
11  QFF_Force32Bit = 0x7fffffff
12 };
13 
14 #pragma pack(push,1)
16 {
17  LStrHandle name;
18  int clockRate;
20  int major, minor;
21 };
22 #pragma pack(pop)
23 
24 #if defined(CUDA_TRACK) || defined(DOXYGEN)
25 #include <cuda_runtime_api.h>
26 static bool CheckCUDAErrorLV(cudaError err, ErrorCluster* e)
27 {
28  if (err != cudaSuccess) {
29  const char* errstr = cudaGetErrorString(err);
30  FillErrorCluster(kAppErrorBase, SPrintf("CUDA error: %s", errstr).c_str(), e);
31  return false;
32  }
33  return true;
34 }
35 #endif
36 
67 CDLL_EXPORT QueuedTracker* DLL_CALLCONV qtrk_create(QTrkSettings* settings, LStrHandle warnings, ErrorCluster* e);
70 
72 CDLL_EXPORT void qtrk_find_beads(uint8_t* image, int pitch, int w,int h, int* smpCornerPos, int roi, float imgRelDist, float acceptance, LVArray2D<uint32_t> **output);
87 CDLL_EXPORT void qtrk_build_lut_plane(QueuedTracker* qtrk, LVArray3D<float> **data, uint flags, int plane, ErrorCluster* err);
101 CDLL_EXPORT int qtrk_get_queue_len(QueuedTracker* qtrk, int* maxQueueLen, ErrorCluster* e);
105 CDLL_EXPORT void DLL_CALLCONV qtrk_queue_pitchedmem(QueuedTracker* qtrk, uchar* data, int pitch, uint pdt, const LocalizationJob *jobInfo);
107 CDLL_EXPORT uint DLL_CALLCONV qtrk_queue_frame(QueuedTracker* qtrk, uchar* image, int pitch, int w,int h, uint pdt, ROIPosition* pos, int numROI, const LocalizationJob *pJobInfo, QueueFrameFlags flags, ErrorCluster* e);
121 CDLL_EXPORT int DLL_CALLCONV qtrk_get_results(QueuedTracker* qtrk, LocalizationResult* results, int maxResults, int sortByID, ErrorCluster* e);
133 CDLL_EXPORT void DLL_CALLCONV qtrk_set_logfile_path(const char* path);
135 
142 CDLL_EXPORT void DLL_CALLCONV qtrk_set_pixel_calib_factors(QueuedTracker* qtrk, float offsetFactor, float gainFactor, ErrorCluster* e);
143 
150 CDLL_EXPORT void qtrk_get_profile_report(QueuedTracker* qtrk, LStrHandle str);
154 CDLL_EXPORT void qtrk_compute_fisher(LVArray2D<float> **lut, QTrkSettings* cfg, vector3f* pos, LVArray2D<float> ** fisherMatrix, LVArray2D<float> ** inverseMatrix, vector3f* xyzVariance, int Nsamples, float maxPixelValue);
155 CDLL_EXPORT void qtrk_test_array_passing(int n, LVArray<float>** flt1D, LVArray2D<float>** flt2D, LVArray<int>** int1D, LVArray2D<int>** int2D);
156 CDLL_EXPORT void qtrk_simulate_tracking(QueuedTracker* qtrk, int nsmp, int beadIndex, vector3f* centerPos, vector3f* range, vector3f *outBias, vector3f* outScatter, float photonsPerWell, ErrorCluster* e);
157 
158 CDLL_EXPORT void DLL_CALLCONV qtrk_generate_gaussian_spot(LVArray2D<float>** image, vector2f* pos, float sigma, float I0, float Ibg, int applyNoise);
159 CDLL_EXPORT void DLL_CALLCONV qtrk_generate_image_from_lut(LVArray2D<float>** image, LVArray2D<float>** lut, float *LUTradii, vector2f* position, float z, float M, float sigma_noise);
172 CDLL_EXPORT void qtrk_compute_zlut_bias_table(QueuedTracker* qtrk, int bias_planes, LVArray2D<float>** lvresult, int smpPerPixel, int useSplineInterp,ErrorCluster* e);
176 #if defined(CUDA_TRACK) || defined(DOXYGEN)
177 
187 CDLL_EXPORT void qtrkcuda_get_device(int device, CUDADeviceInfo *info, ErrorCluster* e);
190 #endif
191 
CDLL_EXPORT void qtrk_set_zlut_bias_table(QueuedTracker *qtrk, LVArray2D< float > **biastbl, ErrorCluster *e)
CDLL_EXPORT int qtrk_get_queue_len(QueuedTracker *qtrk, int *maxQueueLen, ErrorCluster *e)
CDLL_EXPORT void DLL_CALLCONV qtrk_get_computed_config(QueuedTracker *qtrk, QTrkComputedConfig *cc, ErrorCluster *err)
CDLL_EXPORT int qtrk_get_debug_image(QueuedTracker *qtrk, int id, LVArray2D< float > **data, ErrorCluster *e)
CDLL_EXPORT void DLL_CALLCONV qtrk_get_ZLUT(QueuedTracker *tracker, LVArray3D< float > **pzlut, ErrorCluster *e)
CDLL_EXPORT void DLL_CALLCONV qtrk_destroy(QueuedTracker *qtrk, ErrorCluster *error)
CDLL_EXPORT void DLL_CALLCONV qtrk_set_pixel_calib(QueuedTracker *qtrk, LVArray3D< float > **offset, LVArray3D< float > **gain, ErrorCluster *e)
Set pixel calibration images.
CDLL_EXPORT uint DLL_CALLCONV qtrk_queue_frame(QueuedTracker *qtrk, uchar *image, int pitch, int w, int h, uint pdt, ROIPosition *pos, int numROI, const LocalizationJob *pJobInfo, QueueFrameFlags flags, ErrorCluster *e)
CDLL_EXPORT void qtrkcuda_enable_texture_cache(QueuedTracker *qtrk, int enable, ErrorCluster *e)
LStrHandle name
Definition: lv_qtrk_api.h:17
CDLL_EXPORT void DLL_CALLCONV qtrk_get_image_lut(QueuedTracker *qtrk, LVArrayND< float, 4 > **imageLUT, ErrorCluster *e)
Struct used to define the top-left corner position of an ROI within a frame. ROI is [ x ...
Definition: qtrk_c_api.h:178
unsigned int uint
Definition: std_incl.h:127
QueueFrameFlags
Definition: lv_qtrk_api.h:10
CDLL_EXPORT void qtrk_set_localization_mode(QueuedTracker *qtrk, uint locType, ErrorCluster *e)
CDLL_EXPORT void DLL_CALLCONV qtrk_queue_u16(QueuedTracker *qtrk, ErrorCluster *error, LVArray2D< ushort > **data, const LocalizationJob *jobInfo)
CDLL_EXPORT void DLL_CALLCONV qtrk_flush(QueuedTracker *qtrk, ErrorCluster *e)
CDLL_EXPORT void DLL_CALLCONV qtrk_dump_memleaks()
CDLL_EXPORT void qtrk_get_profile_report(QueuedTracker *qtrk, LStrHandle str)
Structure for job results.
Definition: qtrk_c_api.h:67
static bool CheckCUDAErrorLV(cudaError err, ErrorCluster *e)
Definition: lv_qtrk_api.h:26
CDLL_EXPORT int DLL_CALLCONV qtrk_get_results(QueuedTracker *qtrk, LocalizationResult *results, int maxResults, int sortByID, ErrorCluster *e)
CDLL_EXPORT void qtrk_build_lut_plane(QueuedTracker *qtrk, LVArray3D< float > **data, uint flags, int plane, ErrorCluster *err)
void normalize(TPixel *d, uint w, uint h)
Definition: utils.h:27
CDLL_EXPORT void DLL_CALLCONV qtrk_generate_gaussian_spot(LVArray2D< float > **image, vector2f *pos, float sigma, float I0, float Ibg, int applyNoise)
CDLL_EXPORT void DLL_CALLCONV qtrk_queue_float(QueuedTracker *qtrk, ErrorCluster *error, LVArray2D< float > **data, const LocalizationJob *jobInfo)
CDLL_EXPORT void qtrk_enable_zlut_cmpprof(QueuedTracker *qtrk, bool enable, ErrorCluster *e)
CDLL_EXPORT void qtrk_finalize_lut(QueuedTracker *qtrk, ErrorCluster *e)
Structure for the settings used by the algorithms implemented in QueuedTracker.
Definition: qtrk_c_api.h:82
LabVIEW Array template.
Definition: labview.h:33
CDLL_EXPORT void DLL_CALLCONV qtrk_set_logfile_path(const char *path)
CDLL_EXPORT void qtrkcuda_get_device(int device, CUDADeviceInfo *info, ErrorCluster *e)
CDLL_EXPORT void qtrk_test_array_passing(int n, LVArray< float > **flt1D, LVArray2D< float > **flt2D, LVArray< int > **int1D, LVArray2D< int > **int2D)
CDLL_EXPORT void DLL_CALLCONV qtrk_set_image_lut(QueuedTracker *qtrk, LVArrayND< float, 4 > **imageLUT, LVArray3D< float > **radialZLUT, ErrorCluster *e)
CDLL_EXPORT void DLL_CALLCONV qtrk_queue_pitchedmem(QueuedTracker *qtrk, uchar *data, int pitch, uint pdt, const LocalizationJob *jobInfo)
CDLL_EXPORT void DLL_CALLCONV qtrk_queue_array(QueuedTracker *qtrk, ErrorCluster *error, LVArray2D< uchar > **data, uint pdt, const LocalizationJob *jobInfo)
CDLL_EXPORT void qtrk_find_beads(uint8_t *image, int pitch, int w, int h, int *smpCornerPos, int roi, float imgRelDist, float acceptance, LVArray2D< uint32_t > **output)
CDLL_EXPORT QueuedTracker *DLL_CALLCONV qtrk_create(QTrkSettings *settings, LStrHandle warnings, ErrorCluster *e)
#define CDLL_EXPORT
Definition: dllmacros.h:9
CDLL_EXPORT void DLL_CALLCONV qtrk_set_pixel_calib_factors(QueuedTracker *qtrk, float offsetFactor, float gainFactor, ErrorCluster *e)
Set pixel calibration factors.
CDLL_EXPORT void DLL_CALLCONV qtrk_queue_u8(QueuedTracker *qtrk, ErrorCluster *error, LVArray2D< uchar > **data, const LocalizationJob *jobInfo)
CDLL_EXPORT void DLL_CALLCONV qtrk_free_all()
CDLL_EXPORT int DLL_CALLCONV qtrkcuda_device_count(ErrorCluster *e)
Structure for derived settings computed from base settings in QTrkSettings.
Definition: qtrk_c_api.h:189
LabVIEW N dimensions array template.
Definition: labview.h:66
CDLL_EXPORT int DLL_CALLCONV qtrk_idle(QueuedTracker *qtrk, ErrorCluster *e)
LabVIEW 3D Array template.
Definition: labview.h:57
LabVIEW 2D Array template.
Definition: labview.h:41
CDLL_EXPORT void qtrk_get_zlut_cmpprof(QueuedTracker *qtrk, LVArray2D< float > **output, ErrorCluster *e)
CDLL_EXPORT void DLL_CALLCONV qtrk_set_ZLUT(QueuedTracker *tracker, LVArray3D< float > **pZlut, LVArray< float > **zcmpWindow, int normalize, ErrorCluster *e)
CDLL_EXPORT void qtrk_simulate_tracking(QueuedTracker *qtrk, int nsmp, int beadIndex, vector3f *centerPos, vector3f *range, vector3f *outBias, vector3f *outScatter, float photonsPerWell, ErrorCluster *e)
#define DLL_CALLCONV
Definition: dllmacros.h:3
CDLL_EXPORT void DLL_CALLCONV qtrk_generate_image_from_lut(LVArray2D< float > **image, LVArray2D< float > **lut, float *LUTradii, vector2f *position, float z, float M, float sigma_noise)
CDLL_EXPORT void DLL_CALLCONV qtrkcuda_set_device_list(LVArray< int > **devices)
Abstract tracker interface, implemented by QueuedCUDATracker and QueuedCPUTracker.
Definition: QueuedTracker.h:86
CDLL_EXPORT void DLL_CALLCONV qtrk_clear_results(QueuedTracker *qtrk, ErrorCluster *e)
CDLL_EXPORT void qtrk_compute_fisher(LVArray2D< float > **lut, QTrkSettings *cfg, vector3f *pos, LVArray2D< float > **fisherMatrix, LVArray2D< float > **inverseMatrix, vector3f *xyzVariance, int Nsamples, float maxPixelValue)
Structure for region of interest metadata.
Definition: qtrk_c_api.h:49
unsigned char uchar
Definition: std_incl.h:130
CDLL_EXPORT void qtrk_compute_zlut_bias_table(QueuedTracker *qtrk, int bias_planes, LVArray2D< float > **lvresult, int smpPerPixel, int useSplineInterp, ErrorCluster *e)
CDLL_EXPORT int qtrk_resultcount(QueuedTracker *qtrk, ErrorCluster *e)
std::string SPrintf(const char *fmt,...)
Definition: utils.cpp:132
MgErr FillErrorCluster(MgErr err, const char *message, ErrorCluster *error)