Hi there! I’m interested in using the covariates put out during fmriprep as a multiple regressor in SPM. SPM requires the multiple regressor to be in a specific format (.txt or .mat). From the SPM12 manual: You will first need to create a *.mat file containing a matrix R or a *.txt file containing the covariates. Each column of R will contain a different covariate. Unless the covariates names are given in a cell array called ’names’ in the MAT-file containing variable R, the covariates will be named R1, R2, R3, …etc.
Has anyone translated the covariate txt output from fmriprep to this SPM multiple covariate format? Would love insight!
I write a script to loop through my subjects to pull out regressors of interest from the XXXXXXX_desc-confounds_regressors.tsv output from fmriprep and write it into a .txt file for SPM. I’m not sure if that’s what your trying to do?
For example, to pull the data from columns 1, 3 and 5 of the .tsv file I use something like:
Sorry, I’m no expert in this. I happened to find something that worked.
Are you typing this as command line or running as a script?
The only similar thing I can find says you need to use #!/bin/bash and not #!/bin/sh if you’re running a script.