How to annotate tracked particles in videos using Pimsviewer

In this brief tutorial, I’ll show you how to plot the positions of your tracked particles on top of your experimental movies using Pimsviewer, a Python image viewer that uses PIMS as it’s backend and can open various (scientific) image formats.

First, install Pimsviewer either via Conda forge:

conda install -c conda-forge pimsviewer

Or alternatively, via pip:

pip install pimsviewer

Pimsviewer should work with all the formats that can be handled by PIMS, this includes TIFF images or stacks and Nikon ND2 microscopy files. Start the viewer by running the following command:

pimsviewer

You should be presented with a GUI similar to the images below. Open your video file via the ‘File’ menu.

The annotation is available as a plugin via ‘Plugins -> Annotate plugin’. Also included is a dummy processing plugin (it simply adds noise to the images). It serves as an example of how to write your own plugins to extend the functionality of Pimsviewer. For more details on how to write your own plugins, see the README on Github.

Trajectories can then be loaded from a CSV file, which contains a column with the frame number, the x and y coordinates and optionally the radius (for example, as generated with TrackPy). As of now, the plugin only draws circles, but it could be easily extended to draw other particle shapes. By setting a custom scaling factor, you can convert the units of the x, y, r columns to pixels.

Now a circle is drawn on each frame of your video, corresponding to the data in the CSV file. You can then play the video to ensure your particles are properly tracked.

I hope you’ll find Pimsviewer useful, any bug reports or pull request are very welcome via our Github page. Please leave a comment to let me know how you use Pimsviewer and how it could be improved.

Flexibility-induced effects in the Brownian motion of colloidal trimers

All microscopic objects, from enzymes to paint particles, are jittering constantly, bombarded by solvent particles: this is called Brownian motion. How does this motion change when the object is flexible instead of rigid? Together with Pepijn Moerman and colleagues, we have published the first measurements in Physical Review Research as part of my PhD research.

Flexible colloidal trimer
Flexible colloidal trimers change shape as they diffuse through the fluid. These shape changes lead to correlations, which cause the trimers at short times to diffuse mostly towards the central particle when the “scallop” closes (and in the other direction when it opens), which we call the Brownian quasiscallop mode.

The paper studies the diffusive motion of a segmentally flexible colloidal model system through experiments and numerical calculations. We observed hydrodynamic couplings between conformational changes and displacements, which may have implications for the transport and function of synthetic and biological flexible objects at the microscale.

A short summary of the work can be found on the Leiden University website: “How microscopic scallops wander“. To see the colloidal scallops in action, see the video below:

For the full story, the paper is available from the publisher: Ruben W. Verweij, Pepijn G. Moerman, Nathalie E. G. Ligthart, Loes P. P. Huijnen, Jan Groenewold, Willem K. Kegel, Alfons van Blaaderen, and Daniela J. Kraft, ‘Flexibility-induced effects in the Brownian motion of colloidal trimers’,  Phys. Rev. Research 2, 033136, 24 July 2020 (open access).