Streamline length

Dear MRtrix team,

Is there a way of outputing streamline length for each ROI-ROI connection in a connectome analysis.

Thanks

Peter

Yep: in the tck2connectome help page, check out the options for the connectivity metric, as well as the -stat_edge option (note that the command interface here changed as part of the last tagged update).

So, for instance, if you want the mean streamline length in each edge:

  • Use -scale_length: This makes the contribution of each streamline to the relevant edge equal to the length of that streamline, rather than unity.
  • Use -stat_edge mean: This takes the value of each edge as the mean of the values contributed by each streamline within that edge, rather than their sum.

“Calculate the lengths, take the mean” = mean length :stuck_out_tongue: It’s not as immediately obvious as the old interface, but it’s a lot more flexible.

Have fun!
Rob

I was looking at this today and edges that don’t have any length end up being recorded in the file as -nan (i.e., when I set -scale_length -stat_edge mean). Is this the correct behaviour? It makes parsing the file a bit difficult and I think that this also results in the file taking up much more space than it would if the -nan was simply 0.

… since I am on a space and memory optimization kick at the moment! :slight_smile:
Chris

Is this the correct behaviour?

No, that’s a mistake I introduced when making the tck2connectome memory-saving changes (the problem isn’t there in master). Pushed the fix to tag_0.3.16 straight away since it’s a trivial thing.

Perfect, thank you!

A post was split to a new topic: SIFT2 weights & streamlines lengths