Tract lengths from MRtrix3

Skip to first unread message

Mahta Mousavi

Aug 16, 2021, 11:46:24 AMAug 16
to TVB Users

Hello everyone,

I've recently created connectomes using mrtrix3 and estimated the connectome weights and tract lengths using lines 2571-2581 here:

However, the tract lengths matrix in has many zeros in it while what I estimated using mrtix3 for each subjects' data I'm working with does not. I wonder if you could please help me figure out why that could be the case?

Thank you very much for your time and help.

Best Regards,


Aug 19, 2021, 3:42:13 AMAug 19


Likely the 68 matrix has many zeros in the weights matrix, and if the weight is zero, the tract length can be set to zero as well, i.e. if there's no tract, there's no length either.   In the case of MRtrix3 you probably have tracks between among all pairs of regions so you get non zero tract lengths for all pairs of regions.



From: <> on behalf of Mahta Mousavi <>
Sent: Monday, August 16, 2021 5:46:24 PM
To: TVB Users
Subject: [TVB] Tract lengths from MRtrix3
You received this message because you are subscribed to the Google Groups "TVB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Mahta Mousavi

Aug 20, 2021, 9:03:53 AMAug 20
to TVB Users
Hi Marmaduke,

Thanks very much for your response. I see, so in a way, the `effective tract lengths' are the ones with non-zero connectivity weights. My connectivity matrix is as sparse as the connectivity 68 weights. Probably the tract-lengths for connectivity68 were pruned to reflect only lengths between the regions with non-zero weights. I was concerned my code is incorrect since the constructed tract lengths matrix isn't as sparse, but there's not a problem then! 

Thanks very much for your help.

Best Regards,
Reply all
Reply to author
0 new messages