I have been working on a set of scripts for our lab that can be used in multiple MRI analyses. We have recently moved to pre-processing all of our data with fmriprep, but we like to use AFNI to do the last few steps, including the GLM. I would like to know if I am on the right track with the afni_proc.py command below.
Based on some conversations on this forum (including here and here), I've decided to add most of my regressors with -regress_extra_ortvec, including motion regressors, drift, and censoring. This is because depending on the experiment, lab members may choose different denoising and/or censoring strategies (and there is not 100% consensus on the right way to denoise anyway).
Below is an example of the afni_proc.py command that is generated for a single subject in one of our experiments, a go-nogo task with different stimulus durations. Is there anything to be wary of here? Anything I'm missing? Any suggestions of better/newer options compared to what I have here?
This seems reasonable, though it might be a little nicer to tell afni_proc.py what the motion file is (extract those 6 columns), so that such information can be included in the QC. That could be done without AP doing any actual motion censoring, but using an external censor file.
I don't see any censoring option (-regress_censor_extern).
For -regress_extra_ortvec and -regress_extra_ortvec_labels, it will not look for labels in a csv file and extract those columns from the tsv. Rather, provide -regress_extra_ortvec with a list of files (partitioned as you wish, e.g. drift, ventricle), and then provide -regress_extra_ortvec_labels with corresponding labels. This is more like the other -regress_* options (like -regress_stim_times), for example,
Also, adding -compare_opts 'publish 3b' to your command will show the differences between it and the given example name. That is often a useful way to compare.
though it might be a little nicer to tell afni_proc.py what the motion file is (extract those 6 columns)
If I do this, can I still include motion derivatives/powers/etc in the regress_extra_ortvec file without causing problems?
I don't see any censoring option (-regress_censor_extern)
Currently these are also accounted for in the regress_extra_ortvec file; each censored timepoint is its own regressor with a stick function at the censored TR (see sample X-matrix below). Is there a problem with specifying them like that?
This is more like the other -regress_* options (like -regress_stim_times)
Ah, I understand. I was wondering why the resulting afni files were labeled so generically.
I already filtered the tsv so that the file I feed to afni_proc includes only the regressors I want; so I guess I could make it simple by doing something like:
Yes, when providing the 6 motion params separately, it is still okay to pass other ortvecs. The only point would be to avoid overlap, but for example, you are not using -regress_apply_mot_types, so no problem there.
The -regress_censor_extern option is almost 15 years old, so you should have it. What is shown for "afni -ver"? And to be sure, where are you looking for that option, in case there is someplace that I forgot to add it?
Censoring via extra ortvecs should be fine. It won't affect the betas, but it is possible that it would affect at least the full F-stat (since it may alter what the baseline model is). Still, it wouldn't be bad for afni_proc.py to know what censoring was done for QC, like with the motion params.
Yes, using multiple regressor groups/labels for regress_extra_orvec is the intention of the option. However, unless using -bout with 3dDeconvolve, there will probably be no way to even detect any difference, as that is part of the baseline model. The -bout option would output those betas, so at least the labels for them would differ. So whatever you prefer is good.
Oh, sorry, I think there was a slight misunderstanding-- when I pasted "I don't see any censoring option (-regress_censor_extern)" that was a quote from you, and I was replying to it. You were wondering why I did not use it in my afni_proc call, if I'm correct.
There is no error/problem with that option, I just chose to have everything in one chunk (fed to -regress_extra_ortvec) since our lab users may choose different censoring strategies that depend on various columns from the fmriprep regressor output. Once we know the pipeline works, I can go back and split things out into censors/motion/etc to get better QC and labeling, but that is lower priority at the moment.
Oh my, sorry about that. That's the second time recently that formatting in these threads has blown past me, plus I did not recognize my own text.
Is there any point left to resolve then, or are we good?
Sorry about my confusion, it will happen again. :)
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.