Open effigies opened 6 months ago
@jhlegarreta I wonder if I could bug you for a review. I suspect this would be a quick one for you, but let me know if it's not.
Attention: Patch coverage is 85.71429%
with 2 lines
in your changes are missing coverage. Please review.
Project coverage is 70.47%. Comparing base (
4d1352a
) to head (4dde564
).:exclamation: Current head 4dde564 differs from pull request most recent head 17bac08
Please upload reports for the commit 17bac08 to get more accurate results.
Files | Patch % | Lines |
---|---|---|
nipype/algorithms/confounds.py | 85.71% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Legendre and cosine detrending are implemented almost identically, although with several minor variations. Here I separate regressor creation from detrending to unify the implementations.
This now uses
np.linalg.pinv(X)
to estimate the betas in both cases, rather than usingnp.linalg.lstsq
in the cosine filter. lstsq uses SVD and can thus fail to converge in rare cases. Under no circumstances should (X.T @ X) be singular, so the pseudoinverse is unique and precisely what we want.Issue raised in https://neurostars.org/t/fmriprep-numpy-linalg-linalg-linalgerror-svd-did-not-converge/29525.