Importing MaMuT XML files into Matlab

Hi everyone,

I have tracking data generated via TGMM from the Keller Lab, and imported into MaMuT for manual pruning/editing. I’m now hoping to import the tracks from MaMuT into Matlab for further analysis. This is particularly valuable for me as:

(a) I’ve noticed that the object labels generated by TGMM (when directly imported into Matlab using their scripts) are not conserved when importing these results into MaMuT. Ideally, I would like to be able to access in Matlab tracks/objects with particular labels as visualized in MaMuT.

(b) I would like to maintain my manual edits when importing results into Matlab.

I’m relatively new to the various track visualization tools out there so please let me know if I completely missed some documentation on this, though a quick search didn’t lead me to an obvious answer. The scripts for importing TrackMate results into Matlab (e.g. importTrackMateTracks) don’t seem to do the job for MaMuT XMLs.

Best,

Deniz

Hi @daksel

In the scripts folder of your Fiji installation, you should find several MATLAB functions like

  • trackmateGraph.m
  • trackmateSpots.m
  • trackmateFeatureDeclarations.m
    that should do what you want. They should work with MaMuT files as well.

They are documented with MATLAB help function, and their use is described in the TrackMate pdf manual.
This manual is a supp-info of the TrackMate paper, but I realize that the link is broken on the Wiki.
I will try to upload it myself somewhere else and report.

The TrackMate manual is here:

You want to start reading at page 77. Tell us how it goes!

I’ve tried using the TrackMate scripts for importing, but get the following error with trackmateSpots.m:

Error using containers.Map/subsref
The specified key is not present in this container.

Error in trackmateSpots (line 163)
            vDescriptions{ k }  = fs( vn ).name;

Any advice on resolving this issue?

Thanks!

Mmmh no clue. Maybe an incorrect feature declaration?

Could you please send me the faulty xml file so that I can investigate?

@tinevez I sent you an email with the XML file. Thanks again for taking a look!

Ourgh.
How much time does it take on your side to complete? Me it’s been running the import for 30 min +

Gotcha.

Are you actually using Mastodon and not MaMut?

I do something a little convoluted: I import the TGMM results into MaMuT as an xml, then import this .xml into Mastodon for manual editing. (This is mainly because I found Mastodon to run a bit more smoothly for this data) Once done with editing, I export from Mastodon as a new MaMuT xml.

The features name and keys in Mastodon differ after export. The problem in the script is that I assume they are the same.

So the fastest way around this problem is to edit the feature definition section of the XML and replace all spaces in feature names by underscores _