Export tracks generated by TrackMate into vector image format

Hi all,

Is there a way to export the tracks generated by TrackMate into a vector image file that can be opened with Illustrator so that I can change the color and thickness of tracks?

Thanks,
Kai

Hello John,

I hope you found a solution to your problem already but if it is not the case I have put together a small python library to handle lineage trees it should be able to handle TrackMate lineages.
Moreover, and that’s where it could be interesting for you, it can write svg files.
You can find the library there.
Once installed, you might want to use it the following way:

from LineageTree import lineageTree
lT = lineageTree('path/to/trackmate/file.xml', file_type='TrackMate')
lT.write_to_svg('path/to/output.svg',
                order_key=lT.node_name.get, # to order the tracks by ID names
                stroke_width=1, # controls the line width
                horizontal_space=5, # controls the space
                                    # between consecutive branches
                                    # you might want to play with that value
                draw_nodes=False # whether you want the nodes or not
                )

I have not directly tested with TrackMate tracks but I think it should work.
There are other parameters that you could play with if you want, they are described in docs/build/latex/lineageTree.pdf. The documentation is really minimal but don’t hesitate to ask me.

1 Like

Hello @Johncai

If you want to edit the tracks into the TrackScheme window, you can export the TrackScheme view as pdf, and edit them in Illustrator. This is what I do for the TrackMate papers.