Perform statistics on streamlines

Hi all!
I’m hoping to perform a statistical analysis on individual streamlines, but not sure how to proceed. I have 20 subjects, each with a slightly different white matter lesion. Each subject has a clinical score. I have performed whole-brain tractography, in a standardized space (MNI, on HCP data), and normalized the lesions to that space. Now I would like to, for each tract, compare the clinical score of the lesions the tract passes through, vs the clinical score of the lesions the tract does not pass through (perform a 2 group t-test). I can handle the stats part of it, but not sure how to apply the analysis to the tracts. I sense that tcksample (or something like it) is what I’m looking for, but haven’t been able to figure it out!
Any help would be greatly appreciated!

Hi @BennyD,

Even though you’ve got a reasonably detailed description, it might still be lacking a little specificity for me to be 100% confident about exactly what you’re describing. But I’ll have a go at what I think you’re looking for, and you can correct me in whichever direction is necessary.

From your main text, I don’t think you’ll actually be “performing statistics on streamlines”, in that the space of streamlines (a set of ordered vertices in 3D space) is not actually the manifold on which you want to perform statistical inference. This is I think an important distinction because there are in fact methods / analysis frameworks that do precisely that, and so it might be a bit of a red herring. You’re using streamlines data to derive the data on which you will be performing statistics, but it’s tough to communicate exactly what you’re doing within a forum thread title.

Let me try to express what you have & what you want in my own way. So what you have is a set of masks in template space, where each mask corresponds to an individual subject lesion, and you associate with each lesion some quantitative value from that subject. Now, for any given tract delineated in template space, you want to perform a binary classification of each lesion, based on whether or not there is any overlap between the lesion mask and the tract mask.

Once expressed in that way, it seems like it should not be too difficult. For each tract, you need to generate a binary voxel mask: once you’ve selected a subset of streamlines from the whole-brain tractogram corresponding to that tract, you can generate a map of streamlines density using tckmap, then convert that to a binary mask using mrthreshold. Then, to test for intersection between that tract mask and the mask of each individual lesion, the simplest approach would be to multiply the two images using mrcalc, feed that to mrstats, and interrogate the maximum value: it will be 1 if there is at least one voxel that is included in both masks, and 0 if no such voxel exists. Looping over all lesions for a given tract of interest should then give you the data for your two “groups” (intersect vs. no intersect), and you can repeat the whole process for any set of tracts of interest.

If I’m missing the mark let me know.


Thanks a lot Rob, that all makes sense. You’re right, I’m not trying to perform a statistical analysis on the streamlines themselves. I think the key point I was missing, was that I need to first isolate my wholebrain tractogram into individual tracts of interest, and then perform the sequence you outlined. I will proceed in that fashion. Thank you!