Skip to content

Commit 4597ec2

Browse files
committed
Enable lowb greater than zero in b0_average
1 parent fbb0d46 commit 4597ec2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nipype/workflows/dmri/fsl/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,11 @@ def recompose_xfm(in_bval, in_xfms):
381381
return out_files
382382

383383

384-
def b0_average(in_dwi, in_bval, out_file=None):
384+
def b0_average(in_dwi, in_bval, max_b=10.0, out_file=None):
385385
"""
386386
A function that averages the *b0* volumes from a DWI dataset.
387+
As current dMRI data are being acquired with all b-values > 0.0,
388+
the *lowb* volumes are selected by specifying the parameter max_b.
387389
388390
.. warning:: *b0* should be already registered (head motion artifact should
389391
be corrected).
@@ -403,7 +405,7 @@ def b0_average(in_dwi, in_bval, out_file=None):
403405
imgs = np.array(nb.four_to_three(nb.load(in_dwi)))
404406
bval = np.loadtxt(in_bval)
405407
b0s = [im.get_data().astype(np.float32)
406-
for im in imgs[np.where(bval == 0)]]
408+
for im in imgs[np.where(bval <= maxb)]]
407409
b0 = np.average(np.array(b0s), axis=0)
408410

409411
hdr = imgs[0].get_header().copy()

0 commit comments

Comments
 (0)