Tutorial 3 — Particle Tracking

In this tutorial we will use a Python software package to track particles. This is a much more efficient and precise method to track particles than the "manual tracking" you did using ImageJ in the first tutorial. The particle tracking software does a lot and contains many many lines of code, but the user interface to the software package uses Jupyter notebook and is fairly straightforward.

To get acquainted with the tracking software, go through the following steps. The figures referenced are all at the bottom of this page.

  1. Download the Python particle tracking package found here: https://github.com/rmcgorty/ParticleTracking-Python (see Figure 1)
  2. Go through the Jupyter notebook file "Particle Tracking -- DEMONSTRATION, TUTORIAL.ipynb" found in the software package downloaded from GitHub. Note where you will need to edit that file to get it to run. That Jupyter notebook file will be analyzing the video found here and, after you download that video file, you will need to edit the ipynb file so that it can find it (see Figure 2). As you go through the code, try to understand what each bit does and read carefully all documentation.
  3. Make a copy of the "Particle Tracking -- DEMONSTRATION, TUTORIAL.ipynb" notebook (in Jupyter notebook, just go File -> Make a Copy...). Rename the copy to whatever you'd like. Then analyze one of your videos you took as part of Tutorial 2. Do this for either the 1:10 or 1:100 dilution, whichever you think will work better.
    • Before analyzing you may need to or want to edit your videos. If the videos contain regions with no beads or with aggregates of multiple beads, you may want to crop those out of the frame. See Figure 3 for how to crop an image in ImageJ.
    • If you used the OT setup, you will also want to convert your movies (saved in the .avi format) to .tif files. To do that, open the file in ImageJ. Then run Image -> Type -> 8-bit. Then save as a .tif file (File -> Save As -> Tiff...).
    • If you used the OT setup, you will also want to adjust the background so that the beads show up as bright on a dark background. To do so, go Edit -> Invert (the image should be 8-bit before you do this). Then save.
  4. Create a plot of the MSD versus time. Find the slope of the line that best fits your data, as was done in the "Particle Tracking -- DEMONSTRATION, TUTORIAL.ipynb" code (see Figure 4).
  5. Since all of you are involved in research where particle tracking is used to find, for example, the diffusion coefficient, you were probably familiar with the basic idea behind the previous tasks (even if the Python programming was new). So now, we will do something a little different. We will see how particle tracking is used in a technique known as traction force microscopy. To begin, read over the paper found here: Traction force microscopy in physics and biology. Also read the supplemental materials.
  6. As stated in the paper linked to above, the authors included in the supplemental materials two fluorescent images of the beads in the elastic silicone substrate. One image was taken with the cell in place on the substrate and a second image was taken with the cell removed. The image of the cell is shown in Figure 5. Those images of fluorescent beads can be found here (the file is a stack of two images -- one of the beads with the cell on top; one of the beads after the cell has been removed). To extract traction force data, we need to compute the displacements of the beads between the two frames. Use the Python particle tracking code to do so. [The pixel size for these images is 116 nm.] Note that you will have to correct the data for drift as described in Section C of the supplemental materials. Think about how you can do that. To visualize the bead displacements, create a quiver plot (using this matplotlib function). Your end result should look something like that shown in Figure 6.


This tutorial will be due by the end of Thursday 2/7. Turn in the plot of MSD versus time and report the slope as described in step #4. Also turn in the quiver plot as described in step #6. Do not worry if you don't get through all of this (especially steps 5 and 6) by the end of Thursday 1/31. But on 1/31 you should at least get through the first 4 steps.

Figure 1. Finding and downloading the package from the GitHub repository.

Figure 2. This code cell in "Particle Tracking -- DEMONSTRATION, TUTORIAL.ipynb" will need to be edited so that the data_file and data_directory variables point to the correct location of the video file "images_2x2bin_40x_128x128_1_Invert_BGSubtract.tif" which you downloaded to your local computer.

Figure 3. You may want to crop your time series of images that you took as part of Tutorial 2. To do so, open the image in ImageJ. Then use the Rectangle tool (that's the tool to the far left of the main ImageJ window). Then run Image -> Crop to crop the image to just the selected rectangle (the keyboard shortcut Ctrl+Shift+X also works). Make sure the save the cropped result.

Figure 4. The mean squared displacement versus time. You should acquire such a plot after analyzing images you took as part of Tutorial 2.

Figure 5. We will see how traction force microscopy can be used to back out the forces a cell, like the one shown, exerts on the substrate on which it crawls.

Figure 6. Tracking the particles in the two frames and subtracting off an estimate of the drift allows us to determine the displacement of many beads.