Tckmap request - length contributions per fiber per voxel

Hi all,

I have a request / question regarding tckmap and the -contrast length option.

I would like get a summary of each individual fiber’s length contribution to each voxel it passes through. This information must already be computed when using the -precise option in tckmap.

Would it be possible to add an option to tckmap which would output individual fiber lengths per voxel on request?

I envisage something like this:

  1. Length contributions are calculated for each of the voxels a fiber visits
  2. These length contributions per voxel are saved with a corresponding voxel index
  3. Each voxel index would refer to a specific voxel in the tdi output image
  4. Do the same for the next fiber and repeat for all fibers

An alternative would be to take a .tck file and extract the first fiber. Use tckmap -contrast length -precise to produce a length weighted tdi map for the single fiber. Extract the fiber lengths per voxel and the voxel indices then repeat for all other fibers. This would work but has the drawback of being very slow (for e.g. ~10million fibers) and needing to repeatedly write to disk instead of working in memory.

Thanks for your help and I like the new website!

Dave

Hi David

The underlying streamline -> voxel mapping mechanism is actually used in a number of commands, not just tckmap. In this case, the functionality you describe may be slightly too tangential / clumsy to be added as an option to tckmap, and may be better off elsewhere. Not quite sure.

At first I thought it may be better off in the tcksample command (which I still need to overhaul at some point), but I’m not convinced by that either; its main focus (at least after I’ve changed it) will be sampling an underlying image along streamlines trajectories. But that’s not really what’s going on here; you’re interested in the actual streamline gridding, not the values of the image underneath.

It’s also worth noting that writing a comprehensive voxel visitation map - voxel coordinate / length pairs for every voxel traversed for every streamline - is going to be a lot of data to be writing out to e.g. ASCII text files.

So I guess I might take a step back and ask some more fundamental questions:

  • Would it be only the length of each streamline within each voxel traversed that you would be interested in? Or would you also want access to other parameters as well, e.g. the tangential direction, total streamline length, etc.? The required flexibility here has a reasonable influence on the scope of the problem.

  • Is there some more complex experiment that you’re trying to perform, for which this data is an intermediate step? In that case it may be easier to target the end goal rather than this intermediate step. (You can contact me directly if you don’t want to post super-secret experiment ideas up here)

  • The streamline -> voxel mapping mechanism is available as a functor within the MRtrix code library; so with literally a few lines of code, you can have a list of voxel locations and within-voxel streamline lengths for each streamline. It’ll even multi-thread and give you a progress bar for no effort :stuck_out_tongue: These data could then either be exported to file as a custom command (tck2voxel?), or further processing could be done by the command itself, taking full advantage of the MRtrix libraries.

Rob