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

dipy.io.gradients read_bvals_bvecs does not check bvals length #697

Closed
samuelstjean opened this Issue Aug 4, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@samuelstjean
Contributor

samuelstjean commented Aug 4, 2015

Probably stumbled deep into old stuff, but here it is

from dipy.io.gradients import read_bvals_bvecs
bvals, bvecs = read_bvals_bvecs('bvecs_KS_HCP104_PmRS.txt', 'bvecs_KS_HCP104_PmRS.txt')

In [11]: np.all(bvals == bvecs)
Out[11]: True

Also, there is a typo in the docstring,

    fbvecs : str
             path of file with b-vectorsl, or None if you don't want to read bvecs

Culprit seems to be the last lines of the function, where the check can be tricked.

    if max(bvals.shape) != max(bvecs.shape):
            raise IOError('b-values and b-vectors shapes do not correspond')

@samuelstjean samuelstjean changed the title from dipy.dipy.io.gradients read_bvals_bvecs does not check bvals length to dipy.io.gradients read_bvals_bvecs does not check bvals length Aug 4, 2015

arokem added a commit to arokem/dipy that referenced this issue Sep 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment