Skip to content

Commit 648e47e

Browse files
smoiaalaurasparsi
andcommitted
Fix harmonics loops
Co-authored-by: Stefano Moia <[email protected]> Co-authored-by: alaurasparsi <[email protected]>
1 parent 05698af commit 648e47e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

phys2denoise/metrics/multimodal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,21 +194,21 @@ def retroicor(
194194
# It's not computationally efficient to loop multiple times per if statement,
195195
# but organising regressors this way is better for users.
196196
if card_data is not None:
197-
for m in n_harmonics:
197+
for m in range(1, n_harmonics + 1):
198198
retroicor_regressors[n] = retroicor_regressors[n] + [
199199
np.cos(m * phases[n]["card"]),
200200
np.sin(m * phases[n]["card"]),
201201
]
202202

203203
if resp_data is not None:
204-
for m in n_harmonics:
204+
for m in range(1, n_harmonics + 1):
205205
retroicor_regressors[n] = retroicor_regressors[n] + [
206206
np.cos(m * phases[n]["resp"]),
207207
np.sin(m * phases[n]["resp"]),
208208
]
209209

210210
if compute_interaction and card_data is not None:
211-
for m in n_harmonics:
211+
for m in range(1, n_harmonics + 1):
212212
retroicor_regressors[n] = retroicor_regressors[n] + [
213213
np.cos(m * phases[n]["card"]) * np.cos(m * phases[n]["resp"]),
214214
np.cos(m * phases[n]["card"]) * np.sin(m * phases[n]["resp"]),

0 commit comments

Comments
 (0)