Particle tracking plugins file formats and converter

Recently I’veĀ  been working on projects involving heavy usage of particle tracking. There are many available solutions to do that, but since I’m a big fan of ImageJ/FIJI, I’m sticking to it. Among multiple plugins for tracking there are two best options (in my opinion): TrackMate for the automatic tracking and MTrackJ for the manual and track editing/visualization.

There are a couple of reasons, why I don’t use TrackMate alone:

1) TrackMate does allow manual tracking and track editing, but it happens that I got used to the style of MTrackJ, where user interface is more visually intuitive (in my opinion).

2) There are more options for track visualizations in MTrackJ (transparency, show only points till current time, track point marker size and shape, etc). Well, maybe not more, but they are different.

3) File format of MTrackJ is plane text, while TrackMate uses XML. I must note that the parsing of XML in Matlab (using standard library) takes painfully long time for big files ( file size > a couple of megabytes).

The last point is especially annoying if I have about hundred megabytes per only one experimental condition.

The list of “why I don’t use MTrackJ alone” is very short, but convincing: because it is not a tool for an automatic tracking.

I came up with two possible solutions: either re-write Matlab import script using Java XML stream libraries (I promise I’ll do that in the future) or write a converter fromĀ  XML to MDF (MTrackJ format file). And further import MDF file to Matlab, since its format is quite straightforward. Since I’m using MTrackJ to control/examine/edit tracking results from TrackMate anyway, I decided to go with the second option.

So here is converter from TrackMate to MTrackJ.

And Matlab import function for tracks stored as mdf files.

I must note that the converter works only with”linear”, non-splitting tracks, since it is the only one supported by MTrackJ.

  1. Manu left a comment on October 20, 2015 at 04:10

    Hello, I am interested in importing data from MTrackJ to Trackmate and so I must convert the mdf files from MTrackJ to xml for Trackmate. You included a java script to go from xml to mdf, is there a script to due the oppisite? (go from mdf to xml)

    I’m sure I can write a script to save the track info of an mdf file saved as an xml but I’m not sure what headers and source element Trackmate looks for in an xml file.

    Any help would be much appreciated!

    – Manu

Leave a Comment

Your email address will not be published.