Skip to content

Commit 62ab4b1

Browse files
josephmjeoesteban
authored andcommitted
fix tests
1 parent b705c0e commit 62ab4b1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

dmriprep/interfaces/images.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ def _run_interface(self, runtime):
4646
def extract_b0(in_file, b0_ixs, newpath=None):
4747
"""Extract the *b0* volumes from a DWI dataset."""
4848
import numpy as np
49-
import nibabel as nib
49+
import nibabel as nb
5050
from nipype.utils.filemanip import fname_presuffix
5151

5252
out_file = fname_presuffix(
5353
in_file, suffix='_b0', newpath=newpath)
5454

55-
img = nib.load(in_file)
55+
img = nb.load(in_file)
5656
data = img.get_fdata(dtype='float32')
5757

5858
b0 = data[..., b0_ixs]
@@ -61,7 +61,7 @@ def extract_b0(in_file, b0_ixs, newpath=None):
6161
hdr.set_data_shape(b0.shape)
6262
hdr.set_xyzt_units('mm')
6363
hdr.set_data_dtype(np.float32)
64-
nib.Nifti1Image(b0, img.affine, hdr).to_filename(out_file)
64+
nb.Nifti1Image(b0, img.affine, hdr).to_filename(out_file)
6565
return out_file
6666

6767

@@ -106,21 +106,21 @@ def rescale_b0(in_file, mask_file, newpath=None):
106106
and output a median image.
107107
"""
108108
import numpy as np
109-
import nibabel as nib
109+
import nibabel as nb
110110
from nipype.utils.filemanip import fname_presuffix
111111

112112
out_file = fname_presuffix(
113113
in_file, suffix='_median_b0', newpath=newpath)
114114

115-
img = nib.load(in_file)
115+
img = nb.load(in_file)
116116
if img.dataobj.ndim == 3:
117117
return in_file
118118
if img.shape[-1] == 1:
119119
nb.squeeze_image(img).to_filename(out_file)
120120
return out_file
121121

122122
data = img.get_fdata(dtype='float32')
123-
mask_img = nib.load(mask_file)
123+
mask_img = nb.load(mask_file)
124124
mask_data = mask_img.get_fdata(dtype='float32')
125125

126126
median_signal = data[mask_data > 0, ...].median(axis=0)
@@ -133,5 +133,5 @@ def rescale_b0(in_file, mask_file, newpath=None):
133133
hdr.set_data_shape(median_data.shape)
134134
hdr.set_xyzt_units('mm')
135135
hdr.set_data_dtype(np.float32)
136-
nib.Nifti1Image(median_data, img.affine, hdr).to_filename(out_file)
136+
nb.Nifti1Image(median_data, img.affine, hdr).to_filename(out_file)
137137
return out_file

dmriprep/workflows/dwi/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,6 @@ def _get_wf_name(dwi_fname):
212212
fname = split_filename(dwi_fname)[1]
213213
fname_nosub = '_'.join(fname.split("_")[1:])
214214
name = "dwi_preproc_" + fname_nosub.replace(
215-
".", "_").replace(" ", "").replace("-", "_").replace("_dwi", "_wf")
215+
".", "_").replace(" ", "").replace("-", "_").replace("dwi", "wf")
216216

217217
return name

0 commit comments

Comments
 (0)