Importing TrackMate data into Matlab

Dear ImageJ community,

I am trying to perform some data analysis on my TrackMate data using Matlab (R2016b) for which I am relying on the extensive TrackMate documentation. However, I am currently experiencing some error for which I could not find any solution in the documentation. I am trying to display the TrackScheme in Matlab using the code provided on page 86. Unfortunately this is the result I get.

Does anybody have any idea why my graph looks so strange and how to possibly overcome this problem?

Thank you in advance!

Hi @disputator1991

Can you send me the xml file and the script used to generate the figure?

I need to dig into this because for R2016 b they changed the DirectedGraph class plotting capabilities :frowning: . I fear it messes with what we said in the doc.

The code I used to generate this figure is the same as given in your documentation:

figure
hp = plot(G, ’layout’, ’layered’);
set(hp, ’YData’, G.Nodes.FRAME);
set(gca, ’YDir’, ’reverse’, ’XColor’, ’none’)
ylabel(’Time point’)
box off

processed.zip (947.5 KB)

Many thanks for your help

1 Like

Thanks, I will get back to you in a bout 1 week.

Hi @disputator1991

So I tested your data, and did NOT find an error with the MATLAB script.

The data you ship is correctly imported in MATLAB, and the image you showed of the graph is the correct one.

It is puzzling because you have a lot of disconnected spots in each frame that generate this stairway-like looking shape in the MATLAB graph, but if you zoom to the connected part of the graph you get this:

which is correct.

TrackScheme does not import solitary spots when opening, this is why you do not see the stairway in TrackScheme.

The MATLAB script imports everything in the XML file, even solitary spots so this is why you have this shape. If you do not want them to appear, you have to filter them out from the graph.

Best
jy

2 Likes

Thanks @tinevez.

How can I remove all unconnected spots? Is this something I have to do in Matlab or possibly already in TrackMate.

Thanks a lot for your help. Really appreciate it.

I found the Trim all non-visible data function in TrackMate, but it seems that although it reduces the number of unconnected spots there are still many left over.