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

[ENH] Add emc helper functions - vectors #76

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

dPys
Copy link
Collaborator

@dPys dPys commented Feb 11, 2020

*All of these support the signal prediction routines.
*Each function will need a unit test.

@dPys dPys changed the title [ENH] Miscellaneous emc helper functions vectors [ENH] Miscellaneous emc helper functions -- vectors Feb 11, 2020
@dPys dPys changed the title [ENH] Miscellaneous emc helper functions -- vectors [ENH] Add emc helper functions - vectors Feb 11, 2020
@dPys dPys requested a review from oesteban February 12, 2020 02:48
arokem added a commit to arokem/dmriprep that referenced this pull request Feb 25, 2020
Copy link
Member

@oesteban oesteban left a 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 Show resolved Hide resolved
Comment on lines 404 to 432
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]
Copy link
Member

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

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)

@oesteban oesteban added this to the 0.4.0 milestone Mar 23, 2020
dmriprep/utils/vectors.py Outdated Show resolved Hide resolved
@pep8speaks
Copy link

pep8speaks commented Mar 24, 2020

Hello @dPys, Thank you for updating!

Cheers! There are no style issues detected in this Pull Request. 🍻 To test for issues locally, pip install flake8 and then run flake8 dmriprep.

Comment last updated at 2020-03-24 20:09:36 UTC

@codecov
Copy link

codecov bot commented Mar 24, 2020

Codecov Report

Merging #76 into master will decrease coverage by 0.59%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
dmriprep/utils/vectors.py 90.1% <100%> (-9.9%) ⬇️
dmriprep/config/__init__.py 56.72% <0%> (-43.28%) ⬇️
dmriprep/cli/run.py 4.1% <0%> (-26.3%) ⬇️
dmriprep/workflows/base.py 24.67% <0%> (-4.91%) ⬇️
dmriprep/interfaces/vectors.py 100% <0%> (ø) ⬆️
dmriprep/__init__.py 100% <0%> (ø) ⬆️
dmriprep/utils/images.py 13.33% <0%> (ø)
dmriprep/cli/parser.py 56.57% <0%> (ø)
dmriprep/utils/misc.py 50% <0%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 127a65d...8b365f8. Read the comment docs.

dmriprep/utils/vectors.py Outdated Show resolved Hide resolved
Co-Authored-By: Ariel Rokem <arokem@gmail.com>
@dPys dPys force-pushed the miscellaneous_emc_helper_functions_vectors branch from 49e0a0a to 7e1b11e Compare March 24, 2020 18:12
@dPys dPys mentioned this pull request Mar 25, 2020
@oesteban oesteban modified the milestones: 0.4.0, 0.5.0 Dec 10, 2020
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.

None yet

4 participants