How to creat Voxel to voxel connectivity matrix?

Dear all,

I am a beginner about Mrtrix3. I can use tckgen -seed_random_per_voxel to get the voxel to nodes connectivity matrix. And now I want to get the connectivity from ROI to another ROI, which is a voxel to voxel connectivity matrix. But I don’t know how to get it through Mrtrix. It’s kind of like the -omatrix2 command in FSL.

I will appreciate that if you can give me a solution. Thank you very much.

Thanks,
Liang Shi

Hi Liang,

Such a functionality is not currently implemented in MRtrix3, mostly because developers simply haven’t had a use for such. There are quite a number of different ways in which one could conceivably go about achieving such, with varying degrees of coding requirements / computational efficiency.

The question I would pose first, since it influences the amount of time it would require of me to explain: Would you be looking for an individual streamline to contribute node-to-node connectivity for all voxels traversed by that streamline, or only the two voxels in which the streamline endpoints reside?

Hello Dr. Robert Smith,

Thank you very much for your reply.

The target is to get the voxel to voxel connectivity matrix between left thalamus area and left M1 area.

Firstly, I use left thalamus as the seed region and left M1 as the targeted region. The command

tckgen -algorithm iFOD2 -seed_random_per_voxel L_tha.mif 50 -act 5tt_coreg.mif -backtrack -seed_undirectional wmfod_norm.mif ltha_all.tck

is used to generate streamlines of the left thalamus area to all the brain.

Secondly, I use

tckedit -include L_4.mif ltha_all.tck tha_l4.tck

command to generate the streamline from left thalamus to left M1.

Then I use

tckconvert tha_l4_1.tck tha_l4/output-[].txt

command generate the txt file of streamlines. Each streamline position is included in one txt file.

The questions are as follows:

  1. Is the coordinate of streamline txt file described in the image coordinate for all the voxels that are included in the individual streamline?
  2. How to get the voxel-to-voxel connectivity matrix between left thalamus area and left M1 area? I mean the streamlines that start from left thalamus area and end or just pass the left M1 area.

Thank you very much.

Hello Dr. Robert Smith,

I"m so sorry to bother you again. I still didn’t find a solution to create the voxel connectivity matrix. I’m looking for the streamline to contribute node-to-node connectivity for all voxels from seed region to target region traversed by that streamline. Can you give me some hint about how to get it by MRtrix.

Thank you so much.

The target is to get the voxel to voxel connectivity matrix between left thalamus area and left M1 area.

Can I infer from this that you want, for every voxel in the left thalamus, a vector of connectivity values, one value per voxel in M1?

If that’s the case, what I would suggest is trying this script. Provide a thalamus mask as the region of interest from which streamlines will be seeded. For the parcellation image, what you would need to do is produce an image where every voxel in M1 contains a unique integer value. I don’t know of an existing command to do this, but it would probably not be very difficult for anyone with a little bit of coding ability to produce.

tckgen -algorithm iFOD2 -seed_random_per_voxel L_tha.mif 50 -act 5tt_coreg.mif -backtrack -seed_undirectional wmfod_norm.mif ltha_all.tck

If you want to characterise the connectivity to every voxel in M1 independently from every thalamic voxel, you are going to need a lot more than 50 streamlines per voxel. The numbers need to be large enough to counteract the stochastic nature of the tractography algorithm; and when quantifying voxel-to-voxel connectivity, this number will be huge.

  1. Is the coordinate of streamline txt file described in the image coordinate for all the voxels that are included in the individual streamline?

In MRtrix3 streamline vertex locations are defined in real / scanner space. This is independent of any particular image voxel grid.

I’m looking for the streamline to contribute node-to-node connectivity for all voxels from seed region to target region traversed by that streamline.

This actually sounds like the converse of what you described in the first post. Whether or not a streamline contributes to the connection strength only between the two voxels in which the two streamline endpoints reside, or whether the long list of voxels intersected by each streamline is constructed and then the voxel-voxel connectivity is incremented for every possible pair in that list, is a crucial detail that influences how such calculations can / should be performed.