Tracking: announcing new R package TrackMateR

A short post to announce TrackMateR, a new R package to analyse TrackMate XML outputs.


TrackMate is a plug-in for ImageJ which ships with Fiji. It’s essential for single particle tracking work, particularly for microscopy movies. For example, tracking the movement of fluorescent vesicles inside cells.

A tracking session generates a TrackMate XML file. The idea was to write something for R that could load these XML files and do some analysis.


The package has functions to display tracks and to analyse:

  • speed, displacement, cumulative distance
  • mean squared displacement, alpha
  • jump distance
  • fractal dimension
  • track density (number of neighbouring tracks with a search radius)


Full instructions are here. Briefly, install via devtools.

# install.packages("devtools")

The idea is that a user would have either one TrackMate file to analyse or many.

One TrackMate file

The user can load and process the file automatically to generate a report:

# an example file is provided, otherwise use file.choose()
xmlPath <- system.file("extdata", "ExampleTrackMateData.xml", package="TrackMateR")
# read the TrackMate XML file into R using
tmObj <- readTrackMateXML(XMLpath = xmlPath)
# Pixel size is 0.04 um and original data was 1 pixel, xyscalar = 0.04
tmObj <- correctTrackMateData(dataList = tmObj, xyscalar = 0.04, xyunit = "um")
# automatically generate report using

or they can fine tune the parameters to generate a report using different settings (details here).

Multiple TrackMate files

Using compareDatasets() it is possible to analyse multiple datasets using different conditions. This workflow will generate:

  • one report per dataset
  • one summary per condition
  • one comparison of all conditions
  • a number of text file outputs for reuse


The code builds on initial work on a package called TrackR from Julien Godet. Some test data generated by Méghane Sittewelle is included to get started.

The post title comes from “Tracking” by Ambush which comes from a compilation “Sonics Everywhere”

2 thoughts on “Tracking: announcing new R package TrackMateR

Leave a Comment

Your email address will not be published.