Replicating longitudinal fixel-based analysis approach

As far as I know, the midway transformation has only been used for the alignment of paired images, population_template has been used in a number of group-wise peer-reviewed publications. Pairwise registration can introduce problems and might be inferior to groupwise approaches. See for instance here. Assuming pairwise registration works equally well as image-to-template registration, best case you’d get equivalent behaviour between population_template and the pairwise approach. As I hinted at in the last message, if your deformation manifold was nonlinear, you get a suboptimal template using the pairwise approach. The mental picture of 3 people on a hill might help: Assuming one can only walk on the surface of the hill, the average of the pairwise midpoints between people lies inside the hill. The flatter the surface (linear manifold) or the closer the people, the better the approximation of the centre. This problem arises because we average transformed images instead of computing the average transformation on the diffeomorphic manifold which is not possible within MRtrix3.

If you still want to go for pairwise registration (which I would advise against if you could not tell…):

  1. Compute the average space of all non-transformed (translated is fine if their centres are too far off) images. Here is where you decide on the desired target resolution.
  2. Register each image pair, save the full warps.
  3. For each warp:
    1. Convert the full warp to two midway warps using warpconvert -midway -from <image>.
    2. Regrid the midway warps to average space using mrtransform -template average_space.mif
  4. For each image: Warp towards the two other images using the regridded midway warps
  5. Average warped images using mrmath

Hi Max,

Do you know whether that method in here is applicable to FOD images? My understanding is that dealing with FOD images is different from intensity images as FOD involves direction information too.
Please advise.

Thanks,
Mahmoud

Yes, FOD registration requires reorientation and the method is not implemented in MRtrix3. population_template works differently, see for instance above. As already written in a previous personal message 7 days ago, you’d need to use population_template.

Again, population_template, see my PM.

1 Like

Hi Max

Thanks again for those useful comments.

Just to check I have understood this correctly - Use population_template to create an intra-subject template first and then feed that intra-subject template with it’s template mask and 39 other intra-subject templates to form my group template.

Then, in order to register each individual scan to the final group template - how would that work? Is it the same as the generic FBA pipeline using mrregister for the individual scan to the group template? For those subjects used in building the group template, would you need to register each scan to their own intra-subject template before registering to the group template?

Thanks again,

Paul

I don’t have more information over what’s stated in the paper:

Both statements are correct, as far as I understand the above paragraph.

If you mean to transform the subject to its intra-subject template before registration with the population template, no, that would cause two interpolations. I doubt it is necessary to initialise the registration so simply register the original images to the population template. (mrregister has an option to initialise the nonlinear registration with a 5D warp but since you have two registration steps - subject to intra-subject template and intra-subject template to population template - you’d need to compose those, which is not trivial due to the warps being defined in their midway spaces.)

1 Like

Hi,

I have a very small (and probably relatively basic) follow-up question. I managed to create an unbiased population template for my cohort as described in Genc et al., 2018, but of course there’s still the issue of lack of CFE support for longitudinal analysis. So, I have a simple idea to analyze my longitudinal data, and just wanted to check if it’s statistically sound.

My study has 2 groups (patients and controls) and 2 timepoints, and I’m trying to see if the patient group exhibited a higher degree of degenerative progression between the 2 timepoints compared to the healthy controls. Would it make sense (statistically), to calculate the difference in FBA values between the 2 timepoints for each group, and then use CFE to perform an independent sample t-test to compare the change of FBA measures over time between the 2 groups? I hope that made sense :sweat_smile:

Any input would be appreciated.Thanks!

-Joe

… there’s still the issue of lack of CFE support for longitudinal analysis …

If you’re willing to do some Git branch jumping, the relevant code is now in the public domain.

Would it make sense (statistically), to calculate the difference in FBA values between the 2 timepoints for each group, and then use CFE to perform an independent sample t-test to compare the change of FBA measures over time between the 2 groups?

This is a GLM / error modelling question rather than a CFE question. I think that in your case the model errors would be both independent and symmetric (enabling random negation of model residuals) and exchangeable (enabling permutation of model residuals), following which the contrast matrix would be responsible for testing the hypothesis that the difference between the two regression coefficients corresponding to the group longitudinal changes is non-zero. If you were to run these data using the current MRtrix3 code, where errors are assumed to be exchangeable only, you would certainly get something, in that the code would run and you’d get output images; what I’m unsure about is whether or not the incomplete modelling of the model errors would bias the null distribution.

That’s good to know, thanks :grinning:

I already analyzed my data using the approach I explained in my previous post, and I actually ended up getting the results I expected to get, but of course that doesn’t mean that the GLM modelling was unbiased. Is there anyway to check whether the GLM model worked properly or not? I’m really in over my head with all the GLM stuff, so any help would be highly appreciated :sweat_smile:

-Joe

If you’re willing to do some Git branch jumping, the relevant code is now in the public domain .

I think I managed to merge the updated branch with my local MRtrix3 repository. Thank you for that.

Just a small follow-up question, how can I choose to use sign-flipping instead of permutation testing in fixelcfestats? Is there an option for that? I couldn’t find anything about it in the documentation.

Thanks again for the help!

Best,
Joe

Is there anyway to check whether the GLM model worked properly or not?

It’s not a matter of whether or not it “worked properly”; that’s the danger with the GLM, it’ll usually do something, but whether or not that something is “proper” is up to the researcher, not the software.

My intuition says:

  • You’d simply not be exploiting all possible mechanisms for shuffling, and therefore wouldn’t be able to generate as many unique shuffles as you would otherwise, but in most scenarios we don’t process anywhere near the maximum possible number of unique shuffles anyway.

  • If there were to be any bias in the null distribution arising from the incomplete error modelling, it’s probably smaller in magnitude than the biases that result from using the Shuffle-X method in the presence of nuisance regressors (assuming you have any).

Depends on the extent to which you’re willing to bet the integrity of your research on a stranger from the internet :sweat_smile: I won’t be offended if you seek clarification from someone with more GLM experience than myself.

I think I managed to merge the updated branch with my local MRtrix3 repository. Thank you for that.

Just beware that the difference between that branch, and what you were using previously, may not be restricted to only the statistical inference commands: stats_enhancements is based on dev, which includes myriad changes not yet merged to master.

Just a small follow-up question, how can I choose to use sign-flipping instead of permutation testing in fixelcfestats ? Is there an option for that? I couldn’t find anything about it in the documentation.

You won’t find it in the online documentation, because that’s generated automatically from the code, and the code used to generate the documentation doesn’t have this capability. If you check the command’s help page by running the command without any arguments, or use the -help option, that’s the documentation that’s relevant for the particular version of the software you have compiled and are running. Here you’re specifically looking for the -errors option.

Rob

1 Like

Thank you for the detailed reply.

So what I’m making of this is that, while there is probably some bias present, it is negligible. Am I correct?

Thanks again :+1:

Dear all

I would like to continue on this topic by asking for advice if one has a longitudinal study design that includes more than two time points. We have data with 6 scans (time points) per subject and two groups. As a result, it would be difficult follow the same strategy as in the paper by Genc et al. (2018 NeuroImage), i.e. subtract FD(timepoint1) of FD(timepoint 2) and divide this by the time interval in years, and perform statistical analyses on the difference map.

The preprocessing would be quite similar as discussed in the previous messages, right? First compute a within-subject template based on all datasets of that subject (population_template) and then use those within-subject templates to create population-based between-subject template (population_template). Next, combine both spatial transformations (transformcompose) and apply them to the native space FOD maps (mrregister)? This way all FODs are transformed to the population-based template space, right?

For the statistical analyses, would it be possible to do a repeated-measures ANOVA or mixed model analysis? Alternatively, if that would not be possible, would it be a sound approach to, like fMRI, compute a first level (within-subject) statistical test to identify fixels that exhibit a significant main effect of time for e.g. FD? And then for a second level (group) analysis, perform e.g. a one sample t test to identify those fixels that display a consistent change over time across all subjects of the group? Or a two sample t test to compare for differences over time effect between two groups?

Any ideas/suggestions/help would be great! :slight_smile: Thanks in advance!

Best
Julie

I would like to continue on this topic by asking for advice if one has a longitudinal study design that includes more than two time points.

My suspicion is that you might be the first one to do this using FBA. Hope you’re up for the challenge!

Next, combine both spatial transformations (transformcompose) and apply them to the native space FOD maps (mrregister)? This way all FODs are transformed to the population-based template space, right?

The key here is not so much that FODs get transformed to the population-based template space, but that this occurs with a single interpolation step, and intra-individual alignment is not impacted by the potential variability introduced by registering each scan from that subject to a population template rather than an individual-specific template.

For the statistical analyses, would it be possible to do a repeated-measures ANOVA or mixed model analysis? Alternatively, if that would not be possible, would it be a sound approach to, like fMRI, compute a first level (within-subject) statistical test to identify fixels that exhibit a significant main effect of time for e.g. FD? And then for a second level (group) analysis, perform e.g. a one sample t test to identify those fixels that display a consistent change over time across all subjects of the group? Or a two sample t test to compare for differences over time effect between two groups?

fixelcfestats uses the General Linear Model, just like basically any other neuroimaging software, and the underlying raw fixel data can be manipulated using any arbitrary mathematical manipulations. So if you can determine what the recommended processing pipeline would be for an equivalent experiment using fMRI data, I see no reason why you shouldn’t be able to do exactly the same operations for fixel data; though the incoming software changes may be required for various aspects. I would also suggest looking at the two new commands created as part of those developments and strongly consider their use in the context of your more complex experiment.

As far as two-level analyses go, I’m most certainly not experienced with the details of fMRI data analysis, but I would have presumed that the first-level analysis is not about finding a significant main effect of time (and then looking for consistency of such binary identification of such across subjects), but simply quantifying a parameter of interest from the individual subject data (e.g. rate of change over time; equivalent to simply performing a subtraction between two time points, but generalised to more than two scans), and then taking the map of this parameter for each subject and performing a group-level analysis (e.g. to determine if the group mean is non-zero). I suppose either approach would technically be statistically sound; but the quantity being derived, and hence the hypothesis being tested, would be substantially different between the two.

If you’re looking to e.g. reduce the 6 timepoints per subject to a scalar rate of change over time, this could be done using the -notest option in fixelcfestats; this will provide you with the regression coefficients for your particular intra-individual design matrix, which, if constructed appropriately, one of which should correspond to the rate of change over time.

As far as “what test to do”, I’ll repeat my usual schtick when it comes to the GLM: You need to define what your hypothesis is, with sufficient accuracy that you can then build your design and contrast matrices accordingly. In my own experience it tends to be a lack of specificity in one’s hypothesis that leads to uncertainty as to how to operate the software.

Also shout-out to this document that describes the relationships between common statistical test terminology and linear models.

So what I’m making of this is that, while there is probably some bias present, it is negligible. Am I correct?

Maybe not precisely my intent, but close enough. I’d say that if the bias were likely to be substantial, I’d be more likely to be able to figure out what it is; therefore, the fact that I can’t would imply that if it’s non-zero, it’s likely to be small.

THANK YOU very much for your detailed answer! I will look into it! :slight_smile:

Hi,

I want to compare the effects of an intervention vs. a control group after the intervention vs baseline (T2 vs T1) and 3 months post intervention vs baseline (T3 vs T1).

First of all, I have a very basic question about how to do the sign-flipping and use the Freedman-Lane method as described in the article of Genc et al. (2018). Is it sufficient to use the option -exchange_whole, as I assume to have independent and symmetric errors? And is it correct that the generation of an empirical null distribution is automatically done with the Freedman-Lane method in the latest version of MRtrix? I’m sorry if I overlooked this in the online documentation!! I got a bit lost along the way…

Second, similar to Julie, we wanted to analyze the differences between groups over time by first subtracting the time-point 1 from the time-point two image (first level) and then defining the contrast based on group (second level). We use age (and intracranial volume for FD) as covariates, which gives the following contrast: 1 -1 0 (0) for intervention > control at e.g. T2-T1, T1-T2, T3-T1 and T1-T3. If I’m correct, this gives the group-by-time interaction effects, but correct me if I’m wrong!
However, for the within group effects, we didn’t use the subtracted images but a paired design matrix and we defined all the contrasts separately (e.g. T2 > T1 for the intervention). This is how we would build the GLM for fMRI data, but I’m not sure if it works the same way for the fixel data?

Thanks in advance!!

Best wishes,
Michelle

1 Like

Welcome Michelle!

First of all, I have a very basic question about how to do the sign-flipping and use the Freedman-Lane method as described in the article of Genc et al. (2018). Is it sufficient to use the option -exchange_whole, as I assume to have independent and symmetric errors? And is it correct that the generation of an empirical null distribution is automatically done with the Freedman-Lane method in the latest version of MRtrix?

  • There is a conflation here between:

    • Restricted exchangeability (see “Whole-block exchangeability” in this manuscript), which is what -exchange_whole does;
    • Independent and symmetric errors (see “Permutations and exchangeability” in the same manuscript), which is indicated via -errors ise or -errors both.
  • Yes, as of version 3.0.0, the null distribution is always generated using the Freedman-Lane method.

Second, similar to Julie, we wanted to analyze the differences between groups over time by first subtracting the time-point 1 from the time-point two image (first level) and then defining the contrast based on group (second level). We use age (and intracranial volume for FD) as covariates, which gives the following contrast: 1 -1 0 (0) for intervention > control at e.g. T2-T1, T1-T2, T3-T1 and T1-T3. If I’m correct, this gives the group-by-time interaction effects, but correct me if I’m wrong!

  • I can’t verify whether or not a particular contrast matrix is or is not correct without also knowing the design matrix in full. But if I assume that your groups are G1 and G2, and your design matrix columns are:

    G1:T2-T1        G2:T2-T1        Age        eICV
    

    , then that contrast will test the hypothesis that the change from time point T1 to time point T2 is greater in G1 than it is in G2.

  • I find it interesting that you regress intracranial volume only specifically for FD, given that my own suggestion has been the opposite.

  • I suppose that you can refer to this as a “group-by-time interaction effect”. Just be wary that the notion of “interaction” is often queried quite differently in a GLM to how it is done here (due to pre-calculation of the difference over time in this case).

However, for the within group effects, we didn’t use the subtracted images but a paired design matrix and we defined all the contrasts separately (e.g. T2 > T1 for the intervention). This is how we would build the GLM for fMRI data, but I’m not sure if it works the same way for the fixel data?

  • If I’m understanding this correctly, you want to test, only in the intervention group, both T2>T1 (or equivalently T2-T1 > 0) and T3>T1 (or equivalently T3-T1>0). This sounds like “Single group, three measurements”, which, as the FSL GLM Wiki states, can’t be done in randomise in the same way as it is done in feat.

    What you can consider doing with such data is that instead of pre-computing a difference between two time points at the first level and feeding that into a second-level model for a hypothesis test, you instead use all three time points at the first level to estimate a quadratic relationship between your exploratory variable and time, and then at the second level use an F-test to test the hypothesis that both the linear and quadratic terms are zero (i.e. there’s no change of any nature over time). This requires quite a lot more GLM trickery, but it can be done.

  • The particular modality used to generate the data are being fed into the GLM is irrelevant. Where there does seem to be a difference in handling (based on their GLM Wiki page) is specifically between feat and randomise in FSL. While I’m not intimately familiar with how / why these differences arise, statistical inference in MRtrix3 operates on the same principles as randomise, and so I would generally advise that reading the FSl GLM wiki and translating it to FBA should be interpreted through that lens.

Cheers
Rob

1 Like

Hi Rob,

Thank you for the extensive answer, it helped me a lot!!

It is correct that we wanted to perform something like a ‘single group, three measurements’ analysis to compute the within-group effect, but after reading the FSL Wiki, I agree that computing the difference images from two time-points is much easier with regard to the GLM. Moreover, with the difference images, we wouldn’t have to account for the restricted exchangeability anymore so I guess we’ll just stick to this approach for now :slight_smile:

Thank you for the verification of the contrast matrix of the “group-by-time interaction effect”, that is exactly what I meant!
And sorry, I made a typo… We DON’T regress intracranial volume for FD, only for log_fc and FDC based on your suggestion in your conference paper.

Best wishes,
Michelle

Hi,

I am a new user to the MRtrix and pardon me if the question is very basic.

I am trying to perform the whole-brain FBA analysis for a study where we have multiple scans for each subject with different amount of scans (i.e., some have 6 scans, some have 3 scans, some have only 1 scan) and different elapsed time between scans (i.e., subject was scanned 4 weeks after the first scan, and some was scanned 6 weeks after the first scan. The timing of the first scan was also different). We are interested to see if FD/FC/FDC changes as a function of gestational week. I am wondering if there is any way to do a linear mixed effect model to deal with these where the dependent variables are FD/FC/FDC, gestational week is the fixed variable, and subject is the random variable.

Any thoughts/suggestions would be much appreciated!

Best,
Yanbin

1 Like

Hi Rob,

Firstly; thank you (and your colleagues) for all your extensive replies above. I am impressed by the detail you provide to very issue, which has helped me a lot in the past.
Secondly, I was wondering if you could share you thoughts on a recent preprint on fixel statistics in an external software package: ModelArray: a memory-efficient R package for statistical analysis of fixel data | bioRxiv. We do have noticed a first limitation: this approach eliminates the used of CFE, disregarding valuable anatomical information. However, as you have no doubt noticed, the field of neuroimaging is really struggling to find appropriate ways of handling longitudinal data. So, I am very interested to hear your thoughts on the matter (or possibilities to combine the best of both worlds?). Again, I appreciate all of the team efforts in the development and maintenance of the MRtrix community.

Best,
Gwen S. (currently at Deakin University)

1 Like