AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
March 08, 2022 01:15PM
Hi Ilaria,

Just adding a few comments to the useful reply from jbteves.

Indeed, since fmriprep seems to do preprocessing through alignment, some external package will be needed to complete processing through linear regression, and afni_proc.py can do that. The most important thing is for you to have a good idea of what fmriprep has and has not done. Whether you use the MELODIC output might affect what you ask afni_proc.py to do.

1. Indeed, the order of volreg parameters matters, though not too much from the perspective of afni_proc.py.

For censoring (via the enorm time series, generated as the Euclidean norm of the first diffs of the parameters) and regression, the order will not affect the results. The order *will* affect what is plotted in the HTML report, as it assumes the order from 3dvolreg. But that is just for labeling, not a big deal.

But you can always reorder the 6 columns as from 3dvolreg: roll, pitch, yaw, dS, dL, dP. It is the -1Dfile format that is applied.

Note that you would not be able to do outlier censoring (though that could be done separately, with a censor file passed to afni_proc.py via -regress_censor_extern).

External motion parameters should be passed via -regress_motion_file.


2. As jbteves notes, yes, the regressors are just text files of numbers. You can pass one or multiple matrices of these, or individual columns as you see fit. Multi-column (matrix) inputs could be passed via -regress_extra_ortvec, labeled with the corresponding -regress_extra_ortvec_labels option. I would suggest one file per type, just to have an appropriate label attached, e.g. motion_deriv or comp_cor_6.

Note that you would _not_ pass the motion parameters to afni_proc.py this way (use -regress_motion_file).

You should be able to regress the first differences too if you choose, maybe applying "-regress_apply_mot_types demean deriv". Or you can pass the first differences as an ortvec (-regress_extra_ortvec) as you see fit.


3. Yes, you can tell afni_proc.py which blocks to run via something like "-blocks mask blur scale regress". If it has the motion parameter file, it can censor from that. You can also (additionally) provide an external censor file, which would be combined with any motion censoring (e.g. outliers).


4. Yes, if you want to include other noise regressors, they should be applied in the same regression model at this level. Consider use of one or more -regress_extra_ortvec options.

It is important to keep all regressors in a single model, including censoring (and possibly but hopefully not bandpassing).


That is right, as jbteves also notes. If you verify that fmriprep is using 3dTshift to align to the middle of the TR, that offset should be subtracted from the stimulus times. This correction can be applied in afni_proc.py via -regress_stim_times_offset, or separately using timing_tool.py -add_offset, passing the negative offset in either case. Note that the offset is not *exactly* TR/2, but it is close (TR/2 * (nslices-1)/nslices).


Hopefully this seems reasonable.

- rick
Subject Author Posted

AFNIproc.py after fMRIprep.

Ilaria March 07, 2022 06:07PM

Re: AFNIproc.py after fMRIprep.

jbteves March 08, 2022 11:34AM

Re: AFNIproc.py after fMRIprep.

jbteves March 08, 2022 11:37AM

Re: AFNIproc.py after fMRIprep.

rick reynolds March 08, 2022 01:15PM

Re: AFNIproc.py after fMRIprep.

Ilaria March 08, 2022 01:35PM

Re: AFNIproc.py after fMRIprep.

audachang December 03, 2022 03:26AM

Re: AFNIproc.py after fMRIprep.

rick reynolds December 04, 2022 11:39PM