Longitudinal fixel-based analysis

Hello MRtrixers,

First off thanks for providing the fixel-based analysis framework & documentation, I was able to implement this successfully for a cross-sectional study. Soon I will be attempting to use this framework using longitudinal data, and was wondering if this is currently possible using the existing statistical framework?

My question is more around implementing fixelcfestats for the statistical comparisons. For example, in FSL you can set up your GLM to handle repeated measures by either setting up a paired t-test to test a group difference (which I guess might be possible in CFE), but for a group-difference over time the 4D input file is subtracted over time (e.g. <all_FA_time2 - all_FA_time1>) to test a group difference over time. Given the input for fixelcfestats are individual fixel images, is it possible to generate this ‘subtracted’ fixel? I imagine this might get tricky when dealing with different fibre directions over time…

I think maybe the other option would be to generate whole-brain AFD maps and subtract them over time for a voxel-wise analysis, but I guess the voxel-averaged measure wouldn’t be specific to individual fibre populations. However, if this is the only way to do it at this stage - would it be feasible?

Thanks in advance, looking forward to hearing your suggestions!


Hey Sila,

Was really hoping that someone would take this one on while I was away on leave; alas… Although I’m working on developments with respect to stats and the GLM, I’m by no means an expert yet, so I’ll say what I can and we’ll see if anybody comes to my rescue.

For example, in FSL you can set up your GLM to handle repeated measures by either setting up a paired t-test to test a group difference (which I guess might be possible in CFE), …

Any experiment that you can express as a design matrix and contrast vector should be compatible with fixelcfestats. Having said that, we haven’t yet ourselves gotten to longitudinal analyses yet (as far as I know…), so I’d be curious to see how you progress with it.

… but for a group-difference over time the 4D input file is subtracted over time (e.g. ) to test a group difference over time.

If you need to / it is more convenient to pre-calculate individual difference-over-time images, this is absolutely possible; an advantage of the new fixel format is that each fixel is consistently represented using the same index across all fixel data files, and therefore commands such as mrcalc can in fact perform operations on fixel data files.

I imagine this might get tricky when dealing with different fibre directions over time…

The above is obviously only possible if you have fixel correspondence across all subjects and time points. So you’ll need a single fixel template for all data, not one for each time point.

Thinking about it on-the-fly, there’s a danger that if the results of FOD segmentation vary between time points for a particular subject (e.g. two lobes at timepoint 1 being segmented as a single lobe at timepoint 2), you could end up with massive false temporal changes that will significantly impact the GLM fit. So you will need to find a way of detecting when such mismatches occur, and probably set the temporal change to zero for that subject (I’ll have a better solution for this in the future…)

I think maybe the other option would be to generate whole-brain AFD maps…


I reckon shoot for the FBA. This is something we need to support, so you might as well be the pioneer… :smiley: Keep in touch if you need to.


Hi Rob,

Thanks for your reply and comments. I’ll give those suggestions a try and let you know how it goes.

Because I’m working with childhood/adolescent cases and their brains are rapidly developing, I expect within the span of 18 months we might get different FOD segmentations over time. But I’ll just have to process all the data right up until the stats portion and see how its looking. I could calculate the difference images and see if they look reasonable.

I might start off by testing changes over time, and then attempt to do the group comparison over time.

If anyone else has any other suggestions please let me know!



I’m also keen to try fixel-based analysis with longitudinal datasets. Specifically, I’ve got pre- and post- DTI data for a small (N=25) cohort of healthy but sedentary older adults that underwent a 6-month aerobic exercise intervention.

I’d also be interested in trying this with pre- and post- scans for ~50 healthy young adults randomized to 6-weeks of working memory training, or a processing speed active control condition.

Please keep me posted with updates on this. Happy to collaborate.


Now that I re-read this: you could try and build a template across the time dimension, and use fixelcorrespondence to overcome this as much as possible. Or even just build the template of the last time point, where you’d expect most fixels to be present. If doing the latter, fixelcorrespondence will reason that the FD is 0 for fixels that weren’t present in the child yet, which is then the best / most reasonable definition of their FD.

But choosing what to include in building your template, and eventually the main fixel analysis mask for such a study, will definitely play a crucial role in the design of the study / pipeline!

It’s not exactly “longitudinal” analysis, but a lot of useful information may already come from even simply treating pre and post as just 2 groups and doing a “traditional” FBA.

Hi Rob,
I am currently doing a similar analysis to Sila’s, with diffusion scans of a group of children at two time points 1.5 years apart. I have processed the images as you suggested, using a single template based on images from both of the two time points, and tried to calculate a difference image by subtracting Time1 fiber density image from Time2 fd image of the same person (mrcalc Time2_final_fd.msf Time1_final_fd.msf -subtract difference_fd.msf). However, the result is an image with only nan values. The original images have similar but not the same values. Is there anything I am doing wrong or overlooking here?
Any help would be appreciated. Thanks,

Hi Cam,

While it’s possible to do FBA longitudinally currently, it can only be done using a balanced, paired t-test design, which restricts the use of subject-wise nuisance regressors. I’m trying to bump the implementation of sign-flipping and the Freedman-Lane method up my priority list, which are required for more advanced longitudinal designs; I’ll keep you up to date as this progresses and I can confirm in collaboration with @sgenc that the code is doing as it should.

But if you have any spare coding monkeys lying around, I could really use the help :sweat_smile:


Hi Marjolein,

Firstly, while the pre-calculation of a difference image makes sense for a one-sample t-test, performing such within a permutation testing framework requires sign-flipping, which is not yet implemented in fixelcfestats.

Secondly, mrcalc will not exhibit the expected behaviour if operating on .msf files. Historically, such an operation would have been done using the fixelcalc command, which was designed to operate specifically on the sparse fixel image format. However as of MRtrix3 version 3.0_RC1 we are using the fixel directory format; this permits direct use of mrcalc in manipulatnig fixel data, but only if the data are stored according to that format.


Hi Rob,
Thanks for the quick reply.
Are there any plans to implement the one-sample t-test in the future? Performing the one-sample t-test on the difference images seems to be the only way to do a repeated measures analysis with permutation testing, at least according to the FSLwiki.

Thanks for the update Rob. Unfortunately, I have no such coding monkeys to declare. Looking forward to longitudinal analyses in MRtrix - many thanks for your work on this.


Hi Sila,

I’m also interested in performing longitudinal fixes-based analysis. I was just wondering if you managed to perform the analysis you had in mind or not. And if so, how did you end up doing it?

Please let mw know. Thanks.


Hey Joe,

I’m still working on my study, but basically just generated an intra-subject FOD template, and then generated a longitudinal template using these midpoint images.

In terms of the stats, I believe Rob might be able to answer on the progress of the longitudinal fixelcfestats capability.




Thanks for the the update, and good luck with your study :slight_smile: