From d3f8b26693fec3d854f93431ebd60d8dafa400ef Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Thu, 29 Aug 2024 17:22:10 -0400 Subject: [PATCH] Fix orthaggr confound bug (#59) --- src/fmripost_aroma/interfaces/confounds.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/fmripost_aroma/interfaces/confounds.py b/src/fmripost_aroma/interfaces/confounds.py index d2df368..977f0de 100644 --- a/src/fmripost_aroma/interfaces/confounds.py +++ b/src/fmripost_aroma/interfaces/confounds.py @@ -99,12 +99,9 @@ def _get_ica_confounds(mixing, aroma_features, skip_vols, newpath=None): # Select the mixing matrix rows corresponding to the motion ICs aggr_mixing_arr = mixing_arr[motion_ics, :].T + # Regress the good components out of the bad time series to get "pure evil" regressors signal_mixing_arr = mixing_arr[signal_ics, :].T orthaggr_mixing_arr = aggr_mixing_arr.copy() - orthaggr_mixing_arr = aggr_mixing_arr - np.dot( - np.dot(np.linalg.pinv(good_ic_arr), good_ic_arr), aggr_mixing_arr - ) - # Regress the good components out of the bad time series to get "pure evil" regressors aggr_mixing_arr_z = stats.zscore(aggr_mixing_arr, axis=0) signal_mixing_arr_z = stats.zscore(signal_mixing_arr, axis=0) betas = np.linalg.lstsq(signal_mixing_arr_z, aggr_mixing_arr_z, rcond=None)[0]