We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4a2390 commit 4717e23Copy full SHA for 4717e23
nipype/algorithms/confounds.py
@@ -1190,12 +1190,13 @@ def _make_cosine_regressors(ntimepoints, timestep, period_cut):
1190
1191
1192
def _make_legendre_regressors(ntimepoints, degree):
1193
- X = np.ones((ntimepoints, 1)) # quick way to calc degree 0
1194
- for i in range(degree):
1195
- polynomial_func = Legendre.basis(i + 1)
1196
- value_array = np.linspace(-1, 1, ntimepoints)
1197
- X = np.hstack((X, polynomial_func(value_array)[:, np.newaxis]))
1198
- return X
+ support = np.linspace([-1], [1], ntimepoints)
+ return np.hstack(
+ [
+ np.ones((ntimepoints, 1)), # Degree 0 is a constant
+ *(Legendre.basis(i + 1)(support) for i in range(degree)),
+ ]
1199
+ )
1200
1201
1202
def _high_pass_filter(
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments