Skip to content

Commit

Permalink
[loader] hotfix '_get_bdata'
Browse files Browse the repository at this point in the history
  • Loading branch information
dvm-shlee committed Feb 10, 2022
1 parent cca336b commit aee467a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions brkraw/lib/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,13 +820,13 @@ def _get_bdata(method):
# bmat = get_value(method, 'PVM_DwBMat')
# return bval, bvec, bmat
bval = get_value(method, 'PVM_DwBvalEach')
n_bval = len([bval]) if isinstance(bval, int) else len(bval)
bval = [bval] if isinstance(bval, int) else bval
num_b0 = get_value(method, 'PVM_DwAoImages')
num_exp = get_value(method, 'PVM_DwNDiffExp')
num_dir = int((num_exp - num_b0) / n_bval)
num_dir = int((num_exp - num_b0) / len(bval))
bdir = get_value(method, 'PVM_DwDir')
bvals = np.r_[np.zeros(num_b0), np.concatenate([bval for i in np.ones(num_dir).astype(int)], axis=0)]
bvecs = np.concatenate([np.zeros([num_b0, 3])] + [bdir] * n_bval, axis=0).T
bvecs = np.concatenate([np.zeros([num_b0, 3])] + [bdir] * len(bval), axis=0).T
# test if results are correctly built
try:
assert(bvals.shape[0] == num_exp)
Expand Down

0 comments on commit aee467a

Please sign in to comment.