Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RF: Use scipy.interpolate.BSpline to construct spline basis #393

Merged
merged 5 commits into from
Sep 29, 2023

Conversation

effigies
Copy link
Member

This builds on and replaces #388. The additional padding broke our ability to reconstruct the field, as we were estimating more parameters but not actually saving them.

This PR maintains the current functionality and paves the way for implementing the Jacobian (#391) by using BSpline() objects directly instead of through BSpline.design_matrix(). I also restore the use of a within_support mask, which significantly decreases the runtime of unwarp_wf.resample nodes. There is little effect on bs_filter nodes, as we downsample to a low enough resolution to make the fit process very quick already.

@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c90c4ed) 80.53% compared to head (1d715a9) 80.56%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #393      +/-   ##
==========================================
+ Coverage   80.53%   80.56%   +0.03%     
==========================================
  Files          26       26              
  Lines        2296     2290       -6     
  Branches      286      287       +1     
==========================================
- Hits         1849     1845       -4     
+ Misses        402      401       -1     
+ Partials       45       44       -1     
Flag Coverage Δ
unittests ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
sdcflows/transform.py 77.65% <100.00%> (+0.35%) ⬆️
sdcflows/interfaces/bspline.py 68.92% <66.66%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@effigies effigies force-pushed the rf/scipy-bspline-take-3 branch 4 times, most recently from 6061011 to d17bd89 Compare September 24, 2023 15:56
oesteban and others added 3 commits September 26, 2023 07:57
Co-authored-by: Chris Markiewicz <[email protected]>
Use a construction that will potentially allow us to calculate
derivatives more easily.
@effigies effigies force-pushed the rf/scipy-bspline-take-3 branch from d17bd89 to a22f76c Compare September 26, 2023 11:58
@effigies effigies force-pushed the rf/scipy-bspline-take-3 branch from a22f76c to 58ecbe7 Compare September 26, 2023 12:01
@effigies
Copy link
Member Author

@oesteban This should be a relatively quick review. Apart from the specific B-spline invocation change, the main change is that our design matrices are transposed from before. The effect is that we can stop transposing them after generation.

The tests verify that the kron() products are unchanged apart from the transposition.

sdcflows/transform.py Outdated Show resolved Hide resolved
@effigies
Copy link
Member Author

Read through with fresh eyes. I'm going to go ahead and merge.

@effigies effigies merged commit 71a9ae3 into nipreps:master Sep 29, 2023
14 checks passed
@effigies effigies deleted the rf/scipy-bspline-take-3 branch September 29, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants