QTrk
Functions | Variables
lv_queuetrk_api.cpp File Reference
#include "std_incl.h"
#include "utils.h"
#include "labview.h"
#include "QueuedTracker.h"
#include "threads.h"
#include "lv_qtrk_api.h"
#include "ResultManager.h"
#include "FisherMatrix.h"
#include "BeadFinder.h"
#include "cuda_runtime.h"

Go to the source code of this file.

Functions

CDLL_EXPORT void DLL_CALLCONV qtrk_free_all ()
 
void SetLVString (LStrHandle str, const char *text)
 
std::vector< std::string > LVGetStringArray (int count, LStrHandle *str)
 
MgErr FillErrorCluster (MgErr err, const char *message, ErrorCluster *error)
 
void ArgumentErrorMsg (ErrorCluster *e, const std::string &msg)
 
bool ValidateTracker (QueuedTracker *tracker, ErrorCluster *e, const char *funcname)
 Verify the referenced tracker is a valid QueuedTracker instance. More...
 
CDLL_EXPORT int qtrk_get_debug_image (QueuedTracker *qtrk, int id, LVArray2D< float > **data, ErrorCluster *e)
 
CDLL_EXPORT void DLL_CALLCONV qtrk_set_logfile_path (const char *path)
 
CDLL_EXPORT void DLL_CALLCONV qtrk_get_computed_config (QueuedTracker *qtrk, QTrkComputedConfig *cc, ErrorCluster *err)
 
CDLL_EXPORT void DLL_CALLCONV qtrk_set_ZLUT (QueuedTracker *tracker, LVArray3D< float > **pZlut, LVArray< float > **zcmpWindow, int normalize, ErrorCluster *e)
 
CDLL_EXPORT void DLL_CALLCONV qtrk_get_ZLUT (QueuedTracker *tracker, LVArray3D< float > **pzlut, ErrorCluster *e)
 
CDLL_EXPORT void DLL_CALLCONV qtrk_get_image_lut (QueuedTracker *qtrk, LVArrayND< float, 4 > **imageLUT, ErrorCluster *e)
 
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_set_pixel_calib_factors (QueuedTracker *qtrk, float offsetFactor, float gainFactor, ErrorCluster *e)
 Set pixel calibration factors. More...
 
CDLL_EXPORT void DLL_CALLCONV qtrk_set_pixel_calib (QueuedTracker *qtrk, LVArray3D< float > **offset, LVArray3D< float > **gain, ErrorCluster *e)
 Set pixel calibration images. More...
 
CDLL_EXPORT QueuedTrackerqtrk_create (QTrkSettings *settings, LStrHandle warnings, ErrorCluster *e)
 
CDLL_EXPORT void qtrk_destroy (QueuedTracker *qtrk, ErrorCluster *error)
 
template<typename T >
bool CheckImageInput (QueuedTracker *qtrk, LVArray2D< T > **data, ErrorCluster *error)
 
CDLL_EXPORT void qtrk_queue_u16 (QueuedTracker *qtrk, ErrorCluster *error, LVArray2D< ushort > **data, const LocalizationJob *jobInfo)
 
CDLL_EXPORT void qtrk_queue_u8 (QueuedTracker *qtrk, ErrorCluster *error, LVArray2D< uchar > **data, const LocalizationJob *jobInfo)
 
CDLL_EXPORT void qtrk_queue_float (QueuedTracker *qtrk, ErrorCluster *error, LVArray2D< float > **data, const LocalizationJob *jobInfo)
 
CDLL_EXPORT void qtrk_queue_pitchedmem (QueuedTracker *qtrk, uchar *data, int pitch, uint pdt, const LocalizationJob *jobInfo)
 
CDLL_EXPORT void qtrk_queue_array (QueuedTracker *qtrk, ErrorCluster *error, LVArray2D< uchar > **data, uint pdt, const LocalizationJob *jobInfo)
 
CDLL_EXPORT uint qtrk_read_timestamp (uchar *image, int w, int h)
 
CDLL_EXPORT uint 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 qtrk_clear_results (QueuedTracker *qtrk, ErrorCluster *e)
 
CDLL_EXPORT void qtrk_build_lut_plane (QueuedTracker *qtrk, LVArray3D< float > **data, uint flags, int plane, ErrorCluster *err)
 
CDLL_EXPORT void qtrk_finalize_lut (QueuedTracker *qtrk, ErrorCluster *e)
 
CDLL_EXPORT int qtrk_get_queue_len (QueuedTracker *qtrk, int *maxQueueLen, ErrorCluster *e)
 
CDLL_EXPORT int qtrk_resultcount (QueuedTracker *qtrk, ErrorCluster *e)
 
CDLL_EXPORT void qtrk_flush (QueuedTracker *qtrk, ErrorCluster *e)
 
CDLL_EXPORT int qtrk_get_results (QueuedTracker *qtrk, LocalizationResult *results, int maxResults, int sortByID, ErrorCluster *e)
 
CDLL_EXPORT void qtrk_get_zlut_cmpprof (QueuedTracker *qtrk, LVArray2D< float > **output, ErrorCluster *e)
 
CDLL_EXPORT void qtrk_enable_zlut_cmpprof (QueuedTracker *qtrk, bool enable, ErrorCluster *e)
 
CDLL_EXPORT void qtrk_set_localization_mode (QueuedTracker *qtrk, uint locType, ErrorCluster *e)
 
CDLL_EXPORT int qtrk_idle (QueuedTracker *qtrk, ErrorCluster *e)
 
CDLL_EXPORT void qtrk_compute_zlut_bias_table (QueuedTracker *qtrk, int bias_planes, LVArray2D< float > **lvresult, int smpPerPixel, int useSplineInterp, ErrorCluster *e)
 
CDLL_EXPORT void qtrk_set_zlut_bias_table (QueuedTracker *qtrk, LVArray2D< float > **biastbl, ErrorCluster *e)
 
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_generate_image_from_lut (LVArray2D< float > **image, LVArray2D< float > **lut, float *LUTradii, vector2f *position, float z, float M, float sigma_noise)
 
CDLL_EXPORT void qtrk_dump_memleaks ()
 
CDLL_EXPORT void qtrk_get_profile_report (QueuedTracker *qtrk, LStrHandle str)
 
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)
 
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 void qtrk_test_array_passing (int n, LVArray< float > **flt1D, LVArray2D< float > **flt2D, LVArray< int > **int1D, LVArray2D< int > **int2D)
 
CDLL_EXPORT void qtrk_simulate_tracking (QueuedTracker *qtrk, int nsmp, int beadIndex, vector3f *centerPos, vector3f *range, vector3f *outBias, vector3f *outScatter, float photonsPerWell, ErrorCluster *e)
 
CDLL_EXPORT void qtrkcuda_set_device_list (LVArray< int > **devices)
 
CDLL_EXPORT int qtrkcuda_device_count (ErrorCluster *e)
 
CDLL_EXPORT void qtrkcuda_get_device (int device, CUDADeviceInfo *info, ErrorCluster *e)
 
CDLL_EXPORT void qtrkcuda_enable_texture_cache (QueuedTracker *qtrk, int enable, ErrorCluster *e)
 

Variables

static Threads::Mutex trackerListMutex
 
static std::vector< QueuedTracker * > trackerList
 

Detailed Description

Labview API for the functionality in QueuedTracker.h

Definition in file lv_queuetrk_api.cpp.

Function Documentation

§ CheckImageInput()

template<typename T >
bool CheckImageInput ( QueuedTracker qtrk,
LVArray2D< T > **  data,
ErrorCluster error 
)

Definition at line 260 of file lv_queuetrk_api.cpp.

261 {
262  if (!data) {
263  ArgumentErrorMsg(error, "Image data array is empty");
264  return false;
265  } else if( (*data)->dimSizes[1] != qtrk->cfg.width || (*data)->dimSizes[0] != qtrk->cfg.height ) {
266  ArgumentErrorMsg(error, SPrintf( "Image data array has wrong size (%d,%d). Should be: (%d,%d)", (*data)->dimSizes[1], (*data)->dimSizes[0], qtrk->cfg.width, qtrk->cfg.height));
267  return false;
268  }
269  return true;
270 }
int width
Width of regions of interest to be handled. Typically equals height (square ROI). ...
Definition: qtrk_c_api.h:106
int height
Height of regions of interest to be handled. Typically equals width (square ROI). ...
Definition: qtrk_c_api.h:107
void ArgumentErrorMsg(ErrorCluster *e, const std::string &msg)
QTrkComputedConfig cfg
The settings used by this instance of QueuedTracker.
std::string SPrintf(const char *fmt,...)
Definition: utils.cpp:132

§ qtrk_read_timestamp()

CDLL_EXPORT uint qtrk_read_timestamp ( uchar image,
int  w,
int  h 
)

Definition at line 324 of file lv_queuetrk_api.cpp.

325 {
326  if (w*h<4) return 0;
327 
328  uint ts;
329  uchar *timestamp = (uchar*)&ts;
330  // Assume little endian only
331  for (int i=0;i<4;i++)
332  timestamp[i] = image[i];
333  return ts;
334 }
unsigned int uint
Definition: std_incl.h:127
unsigned char uchar
Definition: std_incl.h:130

Variable Documentation

§ trackerList

std::vector<QueuedTracker*> trackerList
static

Definition at line 18 of file lv_queuetrk_api.cpp.

§ trackerListMutex

Threads::Mutex trackerListMutex
static

Definition at line 17 of file lv_queuetrk_api.cpp.