Hi,
I ran into troubles trying to create graph in MRtrix.
I have created a parcellation (.nii), have the output file of the constrained spherical deconvolution (.mif) and the track file (.tck) ready.

I am thinking of using tck2connectome to create a graph. I would like to weight the connections by the number of streamlines divided by the mean volume of the two nodes they connect. Unfortunately none of the “standard” option of the function seems to do that. Is there any way to custom design a weighting according to my needs?

I would appreciate any advice.
Regards,
Lena

Edit: For now I am simply creating one graph using the option to weight by the number of streamlines, and another one, weighting by the inverse volume. I then invert the matrix of the volume and divide the streamlines matrix by it. I am assuming there is a simpler option though.

The -scale_invnodevol option in tck2connectome should do precisely the weighting you’re looking for.

With regards to “custom” weighting designs, it’s possible, but how to do it depends on the nature of the weighting. If the relative weighting of different edges is constant for all streamlines within the edge, then it’s possible to apply such a weighting aftertck2connectome. For instance, if you’re scaling contributions to the connectome by the inverse of the mean volume of the two parcels, this “scaling” is identical for all streamlines within the edge; so you can use tck2connectome to get the number of streamlines per edge, then manually calculate the parcel volumes and perform the scaling after the fact. For more advanced weightings, where the contribution from each streamline is unique, you can pre-calculate these values, and provide them to tck2connectome via the -scale_file option.

Hi Rob,
thanks for your response. I am a little confused. I understood the the -scale_invnodevol option to weight the edges by the inverse volume of the two nodes. What I am looking for is a weighting by the (Number of Streamlines between two nodes)/(Mean Volume of two nodes).
Am I just confused?
Regards,
Lena

If the weight of each connectome edge were simply the inverse of the mean node volume, then there would be no measure of “connectivity” between regions, and there would be no need to use any streamlines. The quantification of connectivity in tck2connectomealways uses the number of streamlines (or, more generally, the sum of streamline weights) as part of its quantification; the -scale_* options simply scale the contribution of each streamline according to some other quantity.