-
Notifications
You must be signed in to change notification settings - Fork 24
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
[ENH] Add emc helper functions - vectors #76
base: master
Are you sure you want to change the base?
[ENH] Add emc helper functions - vectors #76
Conversation
Best reviewed: commit by commit
Optimal code review plan (1 warning)
|
See travis errors in nipreps#76,nipreps#77, nipreps#78, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit tests for _nonoverlapping_qspace_samples
would be great to have and it is a very low hanging fruit - we want this function to be super-robust.
dmriprep/utils/vectors.py
Outdated
def _rasb_to_bvec_list(in_rasb): | ||
""" | ||
Create a list of b-vectors from a rasb gradient table. | ||
|
||
Parameters | ||
---------- | ||
in_rasb : str or os.pathlike | ||
File path to a RAS-B gradient table. | ||
""" | ||
import numpy as np | ||
|
||
ras_b_mat = np.genfromtxt(in_rasb, delimiter="\t") | ||
bvec = [vec for vec in ras_b_mat[:, 0:3] if not np.isclose(all(vec), 0)] | ||
return list(bvec) | ||
|
||
|
||
def _rasb_to_bval_floats(in_rasb): | ||
""" | ||
Create a list of b-values from a rasb gradient table. | ||
|
||
Parameters | ||
---------- | ||
in_rasb : str or os.pathlike | ||
File path to a RAS-B gradient table. | ||
""" | ||
import numpy as np | ||
|
||
ras_b_mat = np.genfromtxt(in_rasb, delimiter="\t") | ||
return [float(bval) for bval in ras_b_mat[:, 3] if bval > 0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you point me at the location where these are needed? I believe our Gradients class has already this covered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oesteban -- These are all used in signal prediction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and not covered in Gradients class)
Hello @dPys, Thank you for updating! Cheers! There are no style issues detected in this Pull Request. 🍻 To test for issues locally, Comment last updated at 2020-03-24 20:09:36 UTC |
Codecov Report
@@ Coverage Diff @@
## master #76 +/- ##
=========================================
- Coverage 52.37% 51.77% -0.6%
=========================================
Files 16 21 +5
Lines 907 1240 +333
Branches 114 164 +50
=========================================
+ Hits 475 642 +167
- Misses 431 586 +155
- Partials 1 12 +11
Continue to review full report at Codecov.
|
Co-Authored-By: Ariel Rokem <[email protected]>
49e0a0a
to
7e1b11e
Compare
*All of these support the signal prediction routines.
*Each function will need a unit test.