How to enter regressors (created outside of afni) into afni_proc.py for nuisance regression

Hello afni experts,

I would like to know how I can enter regressors that I created outside of afni into afni_proc.py for nuisance regression in a resting state analysis. I ca not find the answer. Is there a specific format that the files should have? Does .txt work?

I have a .txt file that contains 10 columns separated by tabs (compcor regressors (5 principal components for wm, 5 PC for csf) derived from antsR).

Thank you in advance for your help
Carolin

Hi Carolin,

There is currently no direct afni_proc.py option for that, though a list of (vertical) text files can be passed via -regress_extra_stim_files, e.g.,

  -regress_extra_stim_files reg_of_no_int_[0-5].1D \
  -regress_extra_stim_labels resp roni{0,1,2,3,4,5} \

But as you are at least the 4th person to want that, myself included, I will look into passing multi-column files.

  • rick

Hello Rick,

thank you very much for your reply!
So you are saying that with using -regress_extra_stim_files I can only pass in text files that include only one column? So I need to create 10 of those if I have 10 regressors?

Can it be a .txt file or does it have to be .1D?

Best
Carolin

Thanks for the reminder, Carolin. I did add options -regress_extra_ortvec and -regress_extra_ortvec_labels so that you can pass full matrices of regressors (of no interest). That was added 2/24, so if your binaries are newer than those, you no long need to break those into separate files.

This should mention those new options if you are current:

afni_proc.py -hist | tail

Please let me know how it goes, thanks!

BTW, it is only on the “todo” list to make sure the lengths of those columns are appropriate…

  • rick

Hi Rick,

thanks a lot! It seems to work! The length of my columns is 150 volumes. I can see that those additional regressors are now considered in the regression. There are 10 additional regressors included in X.xmat.1D and in the output script it says:

initial DF : 150 : 100.0%

DF used for regs of interest : 0 : 0.0%
DF used for censoring : 0 : 0.0%
DF used for polort : 4 : 2.7%
DF used for motion : 0 : 0.0%
DF used for other RONI : 10 : 6.7%
total DF used : 14 : 9.3%

final DF : 136 : 90.7%

Thank you very much for your help again!
Carolin

That is good to hear Carolin, thanks!

  • rick