Skip to content

Commit 97bdbd5

Browse files
committed
STY: Black
1 parent 8e44223 commit 97bdbd5

File tree

5 files changed

+9
-19
lines changed

5 files changed

+9
-19
lines changed

nipype/algorithms/confounds.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,9 +919,7 @@ class TSNR(BaseInterface):
919919
def _run_interface(self, runtime):
920920
img = nb.load(self.inputs.in_file[0], mmap=NUMPY_MMAP)
921921
header = img.header.copy()
922-
vollist = [
923-
nb.load(filename) for filename in self.inputs.in_file
924-
]
922+
vollist = [nb.load(filename) for filename in self.inputs.in_file]
925923
data = np.concatenate(
926924
[
927925
vol.get_fdata(dtype=np.float32).reshape(vol.shape[:3] + (-1,))

nipype/algorithms/misc.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,9 +1432,7 @@ def merge_rois(in_files, in_idxs, in_ref, dtype=None, out_file=None):
14321432
for cname, iname in zip(in_files, in_idxs):
14331433
f = np.load(iname)
14341434
idxs = np.squeeze(f["arr_0"])
1435-
cdata = np.asanyarray(nb.load(cname).dataobj).reshape(
1436-
-1, ndirs
1437-
)
1435+
cdata = np.asanyarray(nb.load(cname).dataobj).reshape(-1, ndirs)
14381436
nels = len(idxs)
14391437
idata = (idxs,)
14401438
try:
@@ -1464,9 +1462,7 @@ def merge_rois(in_files, in_idxs, in_ref, dtype=None, out_file=None):
14641462
idxs = np.squeeze(f["arr_0"])
14651463

14661464
for d, fname in enumerate(nii):
1467-
data = np.asanyarray(nb.load(fname).dataobj).reshape(
1468-
-1
1469-
)
1465+
data = np.asanyarray(nb.load(fname).dataobj).reshape(-1)
14701466
cdata = nb.load(cname).dataobj[..., d].reshape(-1)
14711467
nels = len(idxs)
14721468
idata = (idxs,)

nipype/interfaces/dipy/simulate.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,7 @@ def _run_interface(self, runtime):
140140

141141
# Volume fractions of isotropic compartments
142142
nballs = len(self.inputs.in_vfms)
143-
vfs = np.squeeze(
144-
nb.concat_images(
145-
self.inputs.in_vfms
146-
).dataobj
147-
)
143+
vfs = np.squeeze(nb.concat_images(self.inputs.in_vfms).dataobj)
148144
if nballs == 1:
149145
vfs = vfs[..., np.newaxis]
150146
total_vf = np.sum(vfs, axis=3)
@@ -162,9 +158,7 @@ def _run_interface(self, runtime):
162158
nvox = len(msk[msk > 0])
163159

164160
# Fiber fractions
165-
ffsim = nb.concat_images(
166-
self.inputs.in_frac
167-
)
161+
ffsim = nb.concat_images(self.inputs.in_frac)
168162
ffs = np.nan_to_num(np.squeeze(ffsim.dataobj)) # fiber fractions
169163
ffs = np.clip(ffs, 0.0, 1.0)
170164
if nsticks == 1:

nipype/interfaces/nipy/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _run_interface(self, runtime):
115115
if isinstance(functional_runs, (str, bytes)):
116116
functional_runs = [functional_runs]
117117
nii = nb.load(functional_runs[0])
118-
data = nii.get_fdata(caching='unchanged')
118+
data = nii.get_fdata(caching="unchanged")
119119

120120
if isdefined(self.inputs.mask):
121121
mask = np.asanyarray(nb.load(self.inputs.mask).dataobj) > 0

nipype/utils/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ def __init__(self, *args, **kwargs):
9191
self._config = configparser.ConfigParser()
9292
self._cwd = None
9393

94-
config_dir = os.path.expanduser(os.getenv("NIPYPE_CONFIG_DIR", default="~/.nipype"))
94+
config_dir = os.path.expanduser(
95+
os.getenv("NIPYPE_CONFIG_DIR", default="~/.nipype")
96+
)
9597
self.data_file = os.path.join(config_dir, "nipype.json")
9698

9799
self.set_default_config()

0 commit comments

Comments
 (0)