QTrk
|
QueuedTracker, or QTrk in short, is an API that facilitates the 3 dimensional subpixel tracking of a magnetic bead in a Magnetic Tweezers (MT) setup. The code found here generates a general purpose library in the form of a DLL that can be used from either .NET applications or LabVIEW. The LabVIEW GUI and hardware control, which is not included in this documentation, has been created very specifically for the setups as designed and used in the Nynke Dekker lab.
The MT setups are homebuilt devices for biological single molecule measurements. They have evolved over the years and so has the need for the related software. Considering the framerate and number of pixels of state of the art cameras involved in the setups, the requirements with regards to data handling are now very steep. A measurement running for a few hours generates hundreds of gigabytes worth of image data. As such, the need arose to do the image analysis fast, in real-time. This software was created to do precisely that. To ensure high speed data analysis, multiple algorithms have been implemented in multithreaded CPU and GPU (through CUDA) implementations, with a scheduling shell (QueuedCPUTracker and QueuedCUDATracker) and separate data gathering and saving thread (ResultManager).
The goal is to find a 3 dimensional position of a bead from a microscopic image. A typical image of a single bead is displayed below:
To perform the tracking, specific algorithms exist and have been implemented. Currently the available options are:
Algorithm | Dimensions | CPU | CUDA | Reference | Notes |
---|---|---|---|---|---|
Starting point | QueuedCPUTracker::ProcessJob | QueuedCUDATracker::ExecuteBatch | Functions from which the algorithms are called dependent on settings. | ||
Center of Mass (COM) | x,y | CPUTracker::ComputeMeanAndCOM | BgCorrectedCOM | https://en.wikipedia.org/wiki/Image_moment | Always executed for first guess. |
1D Cross Correlation (XCor1D) | x,y | CPUTracker::ComputeXCorInterpolated | Not implemented | https://en.wikipedia.org/wiki/Cross-correlation | |
Quadrant Interpolation (QI) | x,y | CPUTracker::ComputeQI | QI, QI::Execute | [3] | Recommended algorithm. Optimized for speed and accuracy. |
2D Gaussian fit | x,y | CPUTracker::Compute2DGaussianMLE | G2MLE_Compute | https://en.wikipedia.org/wiki/Gaussian_function#Two-dimensional_Gaussian_function | |
Lookup table (LUT) | z | CPUTracker::ComputeRadialProfile CPUTracker::LUTProfileCompare | ZLUT_RadialProfileKernel ZLUT_ComputeZ | [3] | Only available method for z localization. |
Internally, QI has grown to be the most used and verified algorithm. Usage of it is recommended for data equality.
To be able to compile the DLLs, you need:
To be able to use the CUDA DLLs, the cudart32_65.dll and cufft32_65.dll (or 64 bit versions if compiled with that) need to be known and accessible by the system, i.e. they need to be in the same folder. We are currently limited to using CUDA 6.5 instead of newer versions due to the fact that we have a 32 bit LabVIEW version on setups and 32 bit cuFFT has been deprecated in newer CUDA versions.
Code is provided as-is. Bugs may be encountered. Maintenance and support at the discretion of lab members.
This code and documentation is intended for internal use and provided publicly in the interest of transparency.
Original work by Jelmer Cnossen [1]. Maintenance, testing, documentation and improvements by Jordi Wassenburg.