track_analysis
Track Analysis
Introduction
This app analyses the track data of multiparticle tracking microrheology and calculates the meansquare displacements (MSDs), the linear viscoelastic moduli (G′ and G″) by the generalized StokesEinstein relation (GSER), and the nonGaussian parameters, etc. ^{1}
Features:
 supports analysis upon multiple track files
 supports manual optimization for GSER calculation
 supports calculation of the distribution of diffusivity p(D) by Lucy's algorithm^{2}^{3}
Installation
Unzip and drag the .mlappinstall
file to the command window of MATLAB. After the installation it will appear in the app list.
Data preparation
Consider a timelapse video of M frames. The resolution of the video is X pixels × Y pixels. Each frame is labeled by a positive integer, called "frame ID". Suppose that previous image analysis has provided a result of a number of tracks from this video. Each track is labeled by a positive integer, called "track ID". The information of a track (bearing the same track ID) is provided by the data of x and y positions (in the unit of pixels), each of which corresponds to a distinct frame_ID's. So, each row of a track data consists of the ordered quadruple (x, y, frame ID, track ID). In general, different tracks would start at different frame ID's and last for different number of frames. Also, tracks that skipping some of the frames (i.e. under the same track ID, the frame ID's are not a set of continuous natural numbers) can be handled by this app. An N × 4 matrix each row of which is the quadruple (x, y, frame ID, track ID) is sufficient to completely describe a set of multiple tracks.
The app can open any .mat
file that contains an N × 4 matrix named tr
. The 4 columns of tr
are x positions, y positions, frame ID, and tracks ID in order. See tr_example.mat
for an example.
Within the same tr
data, the ordered pairs (frame ID, track ID) must be pairwise distinct, since no one particle (the same track ID) can appear at two or more positions in the same moment (frame ID).
The app can process multiple '.mat' files. For example, they may be the results from different videos but on the same sample. In this case the track ID and frame ID from the tr
of different imported .mat
files do not need to be distinct videowise. In other words, in each of these tr
variables, the track ID's and frame ID's can, without exception, be (re)starting from 1, regardless of the others.
Load data
Click Add...
to select .mat
files that contain the matrix tr
. Multiple selection is supported. Click Add...
many times to append more tracks. The files are listed in the table next to the button. Click Remove
to remove the currently selected file. The number of tracks contains in each file is also listed in this table.
Setting parameters
The parameters in the Parameters
panel should be set before calculation. Their meanings are listed below.
Resolution (µm/pixel)
The conversion factor of the unit of x/y position from pixel to micron. This value is determined by independent calibration of the microscope with a digital camera.
Temperature (°C)
The temperature of the experiment.
Particle radius (μm)
The radius of the probe particles.
Shutter time (s)
The lag time between adjacent steps of each tracks. This should be the same for all loaded tracks.
Calculate
Click Calculate
to start the calculation upon the currently loaded tracks. Status that indicating the currently processing quantity will be temporarily shown below the axes. Before finishing the calculation a window will pop up for the user to adjust the parameter for GSER calculation (will be introduced in later sections). After closing this window the calculation finishes. The status label read Done!
and the meansquare displacement (MSD) is plotted on the axes.
The GSER popup window
During the first calculation or after clicking the GSER
button the GSER popup window is shown for tuning. GSER calculation can be optimized by a) cutting unwanted portion of the MSD and b) smoothing the MSD curve and its derivative successively by the same smoothing algorithm and setting. By default the MSD is uncut; it and its derivative are smoothed by the movingaverage algorithm using a span of 3 data point. In the left figure, the original MSD curve is plotted as blue dots, and the cut and smoothed MSD curve is plotted as a red solid line. In the right figure the resulted G' and G'' are plotted. Change the two slider the set the minimum and maximum Δt to cut out unwanted portion of the MSD. The resulted upper and lower bounds are indicated as black dashed line in the left figure. Change smoothing algorithm by selecting the corresponding radio button in the Smooth algorithm
panel. Change the Span
(for movingaverage and robust lowess algorithms), and Knots
(for SLM engine) by the slider next to the panel. After any change both figures will update. Tune until the results are good. Click OK
or directly close the GSER popup windows will quit this session and confirm the GSER results.
Select plotting data
The Plot data
panel allow selection of the following observables to plot.
MSD
The multiparticle meansquare displacements <Δx^{2}>, <Δy^{2}>, and <Δr^{2}>, where Δr^{2} = Δx^{2} + Δy^{2}. A black dash line indicates the slope of unity.
Modulus
The storage and loss moduli G′ and G″ calculated by the GSER
popup window.
alpha_2
The mean singleparticle and multiparticle nonGaussian parameters^{2}. The mean singleparticle parameter is plotted with its standard error among all tracks.
van Hove
The distribution density of Δx (van Hove function, scattered) and the corresponding Gaussian distribution (solid) estimated from the MSD for the lag time Δt adjusted by the Lag time
slider.
SPMSD
Singleparticle MSD <Δx^{2}>_{single} (solid) and the corresponding multiparticle counterpart (dash).
Lucy
For each lag time Δt, adjusted by the Lag time
slider, the van Hove function can be deconvolve into a distribution of diffusivity P(D) using Lucy's algorithm^{3}. First select the lag time under which you want to calculate P(D), then click the Lucy
button to start the calculation. After the calculation the result will replace the content in the figure. P(D) is ploted as blue patches, and the corresponding cumulated distribution is plotted as line. Each click on the Lucy
button will replace the old result of P(D).
Saving data
By clicking the Save...
button a folder selection dialogue popup and the current calculated results will be saved into a MATLAB data file named msd_data.mat
in the selected folder. If a Lucy calculation has performed an addition MATLAB data file named PD_data_xxx.mat
in the same folder, where xxx is the lag time under which the P(D) was calculated. If no Lucy calculation has performed, a dialog stating this will appear after saving.
The msd_data.mat
contains the following 6 vairables.
msd
n × 4 matrix of the multiparticle MSDs, where n is the number of lag times. The 4 columns are: Δt (s), <Δx^{2}> (µm^{2}), <Δy^{2}> (µm^{2}), and <Δr^{2}> (µm^{2}), respectively.
msd_i
m × 1 cell array of the singleparticle MSD, where m is the total number of tracks processed. Each cell is an n × 4 matrix with the same column meaning as msd
.
G
3column matrix of the GSER result. The columns are angular frequency ω (rad/s), G′ (Pa), G″ (Pa), respectively.
alpha_2
and alpha_2_i
Multiparticle and mean singleparticle nonGaussian parameters, both of which are 3column matrices. The 3 columns of alpha_2_i
are Δt (s), the mean α_{2} among multiple tracks, and the standard error of α_{2} among multiple tracks. The 3 columns of alpha_2
are Δt (s), the multiparticle α_{2}, and the finitesample variance of the multiparticle α_{2}.
van_Hove
The displacement Δx distribution density p(Δx), an n × 2 cell array. The 2 cells in each row are the distribution densities and the bins edges, respectively.
The PD_data_xxx.mat
contains the following 3 variables
p_D
and P_D
The distribution density and distribution function of diffusivity, respectively. Both are 2column matrices: D (m^{2}/s), p(D) (s m^{−2}) or P(D) ().
van_Hove_rec
A reconstructed van_Hove function from the calculated P(D) data. It is a 2column matrix: Δx (micro;m), distribution density p(Δx) (You may check the validity of the latter by comparing van_Hove_rec
with the van_Hove data of the same lag time in the msd_data.mat
file.
Footnotes

This
readme.md
and also the app are for users familiar with the field of probe microrheology. See for example: Waigh, T. A. "Microrheology of Complex Fluids." Reports on Progress in Physics 68, no. 3 (2005): 685742. ↩ 
See for example: Hong, W., et al. “Colloidal Probe Dynamics in Gelatin Solution During the Sol–Gel Transition.” Soft Matter 14, no. 19 (2018): 3694703. ↩ ↩^{2}

Lucy, L. B. “An Iterative Technique for the Rectification of Observed Distributions.” The Astronomical Journal 79, no. 6 (1974): 74554. ↩ ↩^{2}
Cite As
Andrew Sun (2023). track_analysis (https://github.com/andrewx101/track_analysis/releases/tag/v2.05), GitHub. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version  Published  Release Notes  

2.05  See release notes for this release on GitHub: https://github.com/andrewx101/track_analysis/releases/tag/v2.05 

2.04 