I have used trackpy with HDF5 xyt hyperstack movies and with avi movies. Here are my ipython notebooks.
Using ipyparallel is recommended in the trackpy walkthrough for speeding up particle tracking. Here I have implemented it. This notebook
- opens a color avi movie in greyscale,
- imports ipyparallel for parallel processing, (You will need to start the appropriate number of engines either in the clusters tab or from the command line.)
- locates dark spots in the movie with trackpy and parallel processing,
- filters out trajectories of few frames using trackpy.filter_stubs.
(original file name: 2016-02-11_track_mov_2016-01-26_02_60x1.0_Hem_swim_w_violet_100%--2016-02-26,ipyparallel.ipynb)
This notebook
- opens a color avi movie in greyscale,
- calculates median darkcount and bright background images,
- backgrounds the movie with both darkcount and bright background images, but recovers if there is not enough memory available,
- locates dark spots in the movie with trackpy,
- links these into trajectories with trackpy,
- filters out trajectories of few frames using trackpy.filter_stubs,
- saves the results,
- creates a movie of the particle trajectories.
(original file name: 2016-02-11_tracking_movie_2016-01-26-01_60x1.0_Hematite_swimmers.ipynb)
This notebook
- opens an HDF5 xyt hyperstack file,
- converts it (slowly) into a file that can be used with trackpy,
- background divides the movie but recovers if there is not enough memory available,
- locates dark spots in the movie,
- links these into trajectories,
- filters out trajectories of few frames using filter_stubs,
- filters out trajectories of particles that move a distance below some threshold (currently 4 microns), and
- saves the results (below an 'error' lines that prevents accidentally saving the results if you run the whole notebook.
Note that displacement_um will overestimate the maximum extents of the particle trajectory because it obtains the extreme x and y independently, not as an (x,y) pair from the same frame.
(original file name: 2015-09-15 movie150902,17 particles in droplet _ save trajectories, minimal human intervention, improved_2016-02-10.ipynb)
This notebook explores the standard deviation in the ensemble mean square displacement.
This notebook shows some examples of how to work with a color avi file in python. If you run into errors opening an avi file using pims, make sure to run the setup script, available at https://github.com/vivarose/setup_script.
(original file name: 2015-02-20 & 06-25 & 07-01 Background subtracting color -- red swimmers and blue tracers.ipynb)
An implementation of rotational drift subtraction. Particles that are tracked are assumed to have correlated three-dimensional motion; this removes that average motion.
(original file name: 2016-08-04_Rotational_drift_subtract_entire_movie.ipynb)