Documentation for MATLAB code lambda_calculator_tif.m

This code is originally implemented in MATLAB version R2017b with the Computer Vision Toolbox installed.  This documentation provides a step-by-step instruction on how to use the code, ‘lambda_calculator_tif.m’ to track and calculate lambda value from a video of particles travelling in a microfluidic channel.

Author: Rachapun Rotrattanadumrong (

Download Matlab script file (.m)

  1. Once run a window prompt will ask the user to select a .tif file to be processed.

  2. The software will upload the selected file and once finished will ask for user input of parameters which includes frame rate of the original video and pixel per micron for velocity calculation.


  3. The user has an option to input particle diameter in microns or let the system calculate maximum and minimum particle size from reference frames.  A window will pop-up to allow user to look through each video frames and find reference frames for the software to calculate minimum and maximum particle sizes.


  4. The system begins tracking particles in the video.  Windows will pop up to show real-time tracking and the background-subtracted mask used for detection.

  5. After tracking is finished, a processed video showing the tracking and the mask are saved for later use.


  6. The software ask user whether to continue with lambda calculation.

  7. User is asked for parameter values that will be used for lambda calculation.  If any parameter is left blank, the default value will be used.

  8. A graphical interface will pop up to allow user to pick maximum velocity value by clicking on desired spot on the graph.

  9. User has options of either selecting a new maximum velocity value or ending the calculation.



File Attachments