be5bfc2ed3657ddf103a1ca91bd7b66190877417,dipy/io/gradients.py,,read_bvals_bvecs,#,8

Before Change



    if min(bvecs.shape) != 3:
        raise IOError("bvec file should have three rows")
    if bvecs.ndim != 2:
        raise IOError("bvec file should be saved as a two dimensional array")
    if bvecs.shape[1] > bvecs.shape[0]:
        bvecs = bvecs.T

    // If bvals is None, you don"t need to check that they have the same shape:
    if bvals is None:
        return bvals, bvecs

    if len(bvals.shape) > 1:
        raise IOError("bval file should have one row")

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

    return bvals, bvecs

After Change


    if bvecs is None:
        return bvals, bvecs

    if 3 not in bvecs.shape:
        raise IOError("bvec file should have three rows")
    if bvecs.ndim != 2:
        bvecs = bvecs[None, ...]
        bvals = bvals[None, ...]
        msg = "Only 1 direction detected on your bvec file. For diffusion "
        msg += "dataset, it is recommended to have minimum 3 directions."
        msg += "You may have problem during the reconstruction step."
        warnings.warn(msg)
    if bvecs.shape[1] !=3 and bvecs.shape[1] > bvecs.shape[0]:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: nipy/dipy
Commit Name: be5bfc2ed3657ddf103a1ca91bd7b66190877417
Time: 2020-10-17
Author: skab12@gmail.com
File Name: dipy/io/gradients.py
Class Name:
Method Name: read_bvals_bvecs


Project Name: ReactionMechanismGenerator/RMG-Py
Commit Name: c02df66939452dded7d83ac2bb422db76212eb8a
Time: 2020-04-26
Author: kspieker@mit.edu
File Name: rmgpy/tools/mergemodels.py
Class Name:
Method Name: combine_models


Project Name: UFAL-DSG/tgen
Commit Name: fb50688c503567c5db6207e45e2c5e2ee1ad33df
Time: 2014-08-25
Author: odusek@ufal.mff.cuni.cz
File Name: tgen/features.py
Class Name:
Method Name: depth