Loading fmriprep confound regressors into SPM

Hello everyone,

I’ve been trying to analyse my fmriprepped data in SPM and keep on running into error messages. One of them is that the confound regressors cannot be read. I created a txt file containing those confounds I wish to regress out, including the first six a_comp_cors and the six usual movement regressors.
Wherever I look, the regressors are stored in txt files in a column wise format (?) but please correct me if I am wrong.

Unknown text on line number 1 of ASCII file
data_MRI/Derivatives/sub-105/func/sub-105_task-maintask_run-01_desc-confounds_timeseries.txt
“a_comp_cor_00”.

I don’t even understand why matlab is unable to read the file properly, when it can clearly tell me the content of the first element in the txt file. Should I save my files as .mat instead?

thank you for your help!

Nevermind!
I found the problem: The txt file is not meant to come with headers. I saved the regressors again as a txt without headers and it worked. Although I do think that is a little counterintuitive.

yoo may want to have a look at this script that uses BIDS matlab to extract the confounds you want and save them in a SPM friendly format

if you just remove the header and save as as text you may end up with too many regressors that are not useful for your analysis

1 Like