In the SPM world I was taught the Best Practice to use the parameters of fMRI realignment as nuisance regressors in 1st level analysis. That would be the “rp_.txt” parameter set from SPM realign (6 parameters: 3 rotations, 3 cartesian displacements). After running ANTS to calculate realignment / motion correction end up with matrices for each frame, but nothing i can directly use as a regressor. So:
Is there a conventional way to collect the displacements and rotations from the ANTS motion correction / realignment parameters to build nuisance regressors for 1st Level analysis?
fMRIprep to my understanding does use ANTS for realignment. It seems to have a way of transferring the parameters to the regressor table, but I have not found a documentation on exactly how that is done.
In more detail: From that ANTS realignment/MoCo step we get a bunch of .mat files for each volume, each containing the two arrays “AffineTransform_float_3_3” and ”fixed”. After reading up a bit and eyeballing them, I presume the first one to be a 3x4 representation of the rotation matrix and the displacement vector, while the second one seems to be the coordinates of the origin for the rotation. It cannot be too hard to get to some relevant regressors from here, but I do hope that, maybe, we do not need to reinvent the wheel here.
Can anyone comment on this or point me to some documentation on that issue?
fMRIPrep provides a host of confounds (stored as
*desc-confounds_timeseries.tsv files) that can be added to your GLM design matrix, see Outputs of fMRIPrep — fmriprep version documentation. This includes the motion transformation & rotations, as well as their temporal derivatives and quadratics.
As an aside, when building your design matrix for GLM or nuisance regression, it is highly recommended to only select a subset of the confounds provided by fMRIPrep.
To add to @dlevitas 's answer, to address more of the how:
Nilearn recently added an API to load confounds from fMRIPrep that correspond with benchmarked denoising strategies evaluated in publications. See more information here: Nilearn: Statistical Analysis for NeuroImaging in Python — Machine learning for NeuroImaging, that page also has relevant citations.
You can also use Fitlins to run GLMs (1st and 2nd level) using fMRIPrep-processed data. The software website has examples for constructing the JSON files, but Fitlins knows to draw covariates from the output
Thank you for your input. Yes, exactly I am talking about that use of confounds.
However, my situation is such, that I run ANTS only (because it clearly outperforms fMRIprep in terms of corregistration with my specific combination of 7T SMS-EPI/MP2RAGE volumes). Now I am searching for a way to convert the movement correction matrices I got from ANTS into the movement confounds.
My thought process regarding fMRIprep was: I understand that fMRIprep would run ANTS for realignment/motion correction under the hood. And it does provide the movement confounds (
rot_z), so there seems to be a convention on how to convert the ANTS output to these parameter lists, right? At least within the fMRIprep world.
However, I’d be just as happy to learn of any other convention to transfer these host of ANTS/ITK matrices into confound parameters.