Skip to content

Commit

Permalink
Fix orthaggr confound bug (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo authored Aug 29, 2024
1 parent e1b6819 commit d3f8b26
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/fmripost_aroma/interfaces/confounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit d3f8b26

Please sign in to comment.