Skip to content

Commit deb8025

Browse files
committed
Add zeros to confounds.
1 parent db411b6 commit deb8025

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/fmripost_aroma/interfaces/confounds.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def _get_ica_confounds(mixing, aroma_features, skip_vols, newpath=None):
7979
mixing_out = os.path.join(newpath, 'mixing.tsv')
8080
aroma_confounds = os.path.join(newpath, 'AROMAAggrCompAROMAConfounds.tsv')
8181

82-
# pad mixing_arr with rows of zeros corresponding to number non steady-state volumes
82+
# pad mixing_arr with rows of zeros corresponding to number of non steady-state volumes
8383
if skip_vols > 0:
8484
zeros = np.zeros([skip_vols, mixing_arr.shape[1]])
8585
padded_mixing_arr = np.vstack([zeros, mixing_arr])
@@ -107,6 +107,12 @@ def _get_ica_confounds(mixing, aroma_features, skip_vols, newpath=None):
107107
pred_bad_timeseries = np.dot(signal_mixing_arr_z, betas)
108108
orthaggr_mixing_arr = aggr_mixing_arr_z - pred_bad_timeseries
109109

110+
# pad confounds with rows of zeros corresponding to number of non steady-state volumes
111+
if skip_vols > 0:
112+
zeros = np.zeros([skip_vols, aggr_mixing_arr.shape[1]])
113+
aggr_mixing_arr = np.vstack([zeros, aggr_mixing_arr])
114+
orthaggr_mixing_arr = np.vstack([zeros, orthaggr_mixing_arr])
115+
110116
# add one to motion_ic_indices to match melodic report.
111117
aggr_confounds_df = pd.DataFrame(
112118
aggr_mixing_arr,

0 commit comments

Comments
 (0)