With the preprocessed bold data from fMRIPrep I would like to perform denoising using the generated confounds tsv file. I decided to remove the 6 motion parameters, cosines, and some aCompCor components but wanted to validate that the order of operations is correct. As an example, I will use the
data = clean_img(data, detrend=False, standardize=False, confounds=[motion])
data = clean_img(data, detrend=False, standardize=False, confounds=[cosines])
data = clean_img(data, detrend=False, standardize=False, confounds=[acompcor])
The idea is to first remove the motion parameters since they were estimated without any prior high-pass filtering. As a next step, I apply the high-pass filtering via the cosines as this is required to filter out the aCompCor components. Finally, the aCompCor confounds can be regressed out of the data.
Now my question is whether these steps are correct and have to be taken separately or whether I can simply include all confounds at once. Also, I am wondering if I can now detrend my data after the 3 steps, since detrending is typically done before any confounds are removed. If I understood it right, fMRIPrep does not detrend the data before estimating the aCompCor confounds though.
Any help with this issue is appreciated!