Skip to content

Tutorial

Nicolas Bruot edited this page Jan 29, 2017 · 3 revisions

Learn here how to track particles on a movie with CorrTrack.

Open a movie

  • Open corrtrack.exe.

  • With File \ Open, load the sample movie "movie.rawm" in the "examples" folder.

You can play the movie and change its play speed with the bottom controls. Intensity settings can be adjusted in View \ Intensity settings.

Set the tracking parameters

The algorithm correlates a kernel image of a particle with the movie frames. The kernel is a .dat text file containing a 2d array of numbers.

  • Go to Filter \ Filter.

  • Select the correlation filter "kernel.dat" in the "examples" folder by clicking the "..." button.

  • Keep the other parameters to their default values and click OK.

  • On the first frame of the movie, click on the particle you want to track. This is used by the algorithm as a guess of the initial position and does not need to be precise to the pixel.

Two rectangles appear on the image. The blue rectangle shows the area in which the kernel will be correlated to the image. The red area indicates the pixels that will be used to calculate the correlation map. These areas will follow the particle during the analysis (although the program does not display this process). If the red rectangle goes out of the image boundaries, the analysis will stop with an error.

Test the parameters and analyze

  • Click on File \ Test correlation. The image is updated to display in the blue area the correlation map calculated for the first frame. The black pixel in the correlation map shows the centre of the particle.

  • Click on File \ Analyze to process all the frames.

The position of the particle gets written in a .dat file with the same name as the movie. In this file, the positions are in pixels. The number of columns in this file depends on the number of particles being tracked (for multi-particle movies, you can click on several particles when setting the tracking parameters).

More on correlation kernels

You should construct kernel (.dat) files adapted to your particles and imaging conditions. A kernel should be a picture of an ideal particle minus the background intensity. It is simply represented as an array of floating numbers.

For example, consider the following perfect image of a tiny colloid, without noise (the numbers are pixel intensities):

    ... ... ... ... ... ... ...
... 100 100 100 100 100 100 100 ...
... 100 100  89 100 100 100 100 ...
... 100  89 233  89 100 100 100 ...
... 100 100  89 100 100 100 100 ...
... 100 100 100 100 100 100 100 ...
... 100 100 100 100 100 100 100 ...
... 100 100 100 100 100 100 100 ...
    ... ... ... ... ... ... ...

The colloid is centred at the "233" pixel. A kernel can be defined from the pixels around this centre, by subtracting the background intensity "100". Limiting the kernel to 3x3 pixels around the particle gives the following .dat file (numbers should be tab-separated):

  0 -11   0
-11 133 -11
  0 -11   0

Important notes:

  • Theoretically, the kernel extends to more than 3x3 pixels. But since this would only add zeros to the array, the other pixels can be neglected. You should always have kernels that encompass the whole particle, i.e. pixels outside the kernel should be zeros.

  • Kernel arrays can use floating-point numbers.

More on the correlation parameters

The parameters of the Filter \ Filter window are the following:

  • Width, Height: Size in pixels of the window in which the correlation map is calculated. To analyze a given frame, the algorithm recenters the window to the position calculated in the previous frame (or uses the clicked position for the first frame). Therefore, the size of this window does not need to cover the whole area of motion of the particle during the whole movie. It should be related to how much a particle moves between two frames.

  • Filter file: Array of tab-separated numbers as described above that represents the correlation kernel.

  • Fit radius: To calculate positions with a subpixel resolution, the algorithm fits the correlation map with a parabola. For the fit, it only uses the points within the "fit radius" from the pixel at which the correlation is maximal. This parameter should be kept small, as the correlation map can only be approximated to a parabola close the the maximum. Btu if you have very noisy images, you may consider increasing it.