Hi FSL experts (perhaps specifically Dr. Christian F. Beckmann), I'm working on adding ICA_AROMA functionality to another software tool (fmriprep): https://github.com/poldracklab/fmriprep/pull/539 where I'm having trouble: I'm attempting to recreate the fsl_regfilt partial regression equation, but instead of the output being the denoised data, I want a matrix of confounds where each column is a noise component, and the rows are the length of the time series. I see fsl_regfilt's partial regression explained here: https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind1307&L=fsl&D=0&P=288785 My thought process right now is to: 1) regress the image data against the entire melodic_mix: data_hat = B0 + B1*melodic_mix residual_data = data - data_hat 2) regress the noise_components against the signal_components and the residual_data noise_components_hat = B0 + B1*signal_components + B2*residual_data residual_noise_components = noise_components - noise_components_hat The residual_noise_components are the partially regressed noise components and if given to fsl_glm as a design matrix would give the same result as using fsl_regfilt with the filter and melodic_mix. Is my reasoning sound? Can anyone help with how I can conceptualize making this regression? Thank you so much! James