tckgen - How can I track efficiently on brain surface?

Hi All,

I want to get the whole brain tractography on vertices of the white surface, and create a #vertices x #WholeBrainMask connection matrix ultimately. However, MRtrix3 does not provide an API to get the tractography at once. For substitute, I must track the vertices one by one using tckgen -seed_sphere, which is time-wasting - because I have to read a BIG FOD file for each vertex. Is there an efficient method to track on vertices? Or can MRtrix3 develop a convenient API to get the tractography of vertices at once?

1 Like

Welcome Chengyi!

We unfortunately do not yet have native support for surface data involving tractography, so this is not something that can currently be done with MRtrix3 commands. I think a lot of people are simply performing whole-brain tractography, then using their own code to load both the resulting streamlines data and the surface data and e.g. construct matrices from there. Your desire here is slightly different in that you are also interested in streamline-voxel visitations, and so if the majority of that processing were to be done outside of MRtrix3 you would also need to implement the relevant code for that process (and there’s a couple of little confounds to be aware of).

If you or a colleague have some C++ capability, there would be the opportunity to make use of the MRtrix3 API to implement something that solves your specific problem. The streamline-voxel mapping has existing functors that can be called easily. For the problem of assigning streamline endpoints to vertices, there is at least code for importing and representing surface data; @chunhungyeh additionally has some code for doing computationally fast lookups on surfaces that could be of use, it’s not yet in a tagged release but perhaps at least some of it is there in public code branches that would be accessible.

Alternatively, if you do not want to split the problem into two steps (i.e. generate a whole-brain tractogram, then use the streamlines to construct the connectivity information of interest), but instead want to propagate some number of streamlines from each vertex, then there’s a couple of possible solutions. You could implement a new seeding mechanism that would read from surface data, and instead of distributing its seed points homogeneously across the surface, instead generate some number of seeds exactly on each vertex (I think this is what FSL’s probtrackx does?). This may possibly have some nasty interactions with ACT if attempting to use that, given that the current ACT implementation is image-based; using 5ttgen hsvs and FreeSurfer-based seed vertices would mitigate, but there’s nevertheless a few ways that this could go wrong, so you’d need to be very critical in checking the details of the reconstruction. From there, you could either read the tractogram data in some downstream application of your own, using the first streamline vertex position as indication of the seed vertex, or indeed you could have a single MRtrix3 C++ application that controls both the generation of streamlines and the subsequent generation of voxel-wise connectivity per vertex. I’m sure that either of these would be of interest to others in the community; unfortunately I’m finding it increasingly difficult to commit time to implementing such things myself due to other obligations, but am more than happy to assist any community members interested in implementing such things.

Cheers
rob