Skip to content

Commit d5c93fd

Browse files
committed
PEP8
1 parent 0b91a37 commit d5c93fd

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

nipype/interfaces/nipy/preprocess.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424

2525
class ComputeMaskInputSpec(BaseInterfaceInputSpec):
2626
mean_volume = File(exists=True, mandatory=True,
27-
desc="mean EPI image, used to compute the threshold for the mask")
27+
desc="mean EPI image, used to compute the threshold for the mask")
2828
reference_volume = File(exists=True,
29-
desc=("reference volume used to compute the mask. "
30-
"If none is give, the mean volume is used."))
29+
desc=("reference volume used to compute the mask. "
30+
"If none is give, the mean volume is used."))
3131
m = traits.Float(desc="lower fraction of the histogram to be discarded")
3232
M = traits.Float(desc="upper fraction of the histogram to be discarded")
3333
cc = traits.Bool(desc="Keep only the largest connected component")
@@ -69,7 +69,6 @@ def _list_outputs(self):
6969

7070
class FmriRealign4dInputSpec(BaseInterfaceInputSpec):
7171

72-
7372
in_file = InputMultiPath(exists=True,
7473
mandatory=True,
7574
desc="File to realign")
@@ -144,10 +143,10 @@ def _run_interface(self, runtime):
144143
TR_slices = self.inputs.tr_slices
145144

146145
R = FR4d(all_ims, tr=self.inputs.tr,
147-
slice_order=self.inputs.slice_order,
148-
tr_slices=TR_slices,
149-
time_interp=self.inputs.time_interp,
150-
start=self.inputs.start)
146+
slice_order=self.inputs.slice_order,
147+
tr_slices=TR_slices,
148+
time_interp=self.inputs.time_interp,
149+
start=self.inputs.start)
151150

152151
R.estimate(loops=self.inputs.loops,
153152
between_loops=self.inputs.between_loops,
@@ -159,11 +158,11 @@ def _run_interface(self, runtime):
159158

160159
for j, corr in enumerate(corr_run):
161160
self._out_file_path.append(os.path.abspath('corr_%s.nii.gz' %
162-
(split_filename(self.inputs.in_file[j])[1])))
161+
(split_filename(self.inputs.in_file[j])[1])))
163162
save_image(corr, self._out_file_path[j])
164163

165164
self._par_file_path.append(os.path.abspath('%s.par' %
166-
(os.path.split(self.inputs.in_file[j])[1])))
165+
(os.path.split(self.inputs.in_file[j])[1])))
167166
mfile = open(self._par_file_path[j], 'w')
168167
motion = R._transforms[j]
169168
# nipy does not encode euler angles. return in original form of
@@ -190,19 +189,21 @@ class TrimInputSpec(BaseInterfaceInputSpec):
190189
exists=True, mandatory=True,
191190
desc="EPI image to trim")
192191
begin_index = traits.Int(
193-
0,usedefault=True,
192+
0, usedefault=True,
194193
desc='first volume')
195194
end_index = traits.Int(
196-
0,usedefault=True,
195+
0, usedefault=True,
197196
desc='last volume indexed as in python (and 0 for last)')
198197
out_file = File(desc='output filename')
199198
suffix = traits.Str(
200-
'_trim',usedefault=True,
199+
'_trim', usedefault=True,
201200
desc='suffix for out_file to use if no out_file provided')
202201

202+
203203
class TrimOutputSpec(TraitedSpec):
204204
out_file = File(exists=True)
205205

206+
206207
class Trim(BaseInterface):
207208
""" Simple interface to trim a few volumes from a 4d fmri nifti file
208209
@@ -223,14 +224,14 @@ def _run_interface(self, runtime):
223224
out_file = self._list_outputs()['out_file']
224225
nii = nb.load(self.inputs.in_file)
225226
if self.inputs.end_index == 0:
226-
s = slice(self.inputs.begin_index,nii.shape[3])
227+
s = slice(self.inputs.begin_index, nii.shape[3])
227228
else:
228-
s = slice(self.inputs.begin_index,self.inputs.end_index)
229+
s = slice(self.inputs.begin_index, self.inputs.end_index)
229230
nii2 = nb.Nifti1Image(
230-
nii.get_data()[...,s],
231+
nii.get_data()[..., s],
231232
nii.get_affine(),
232233
nii.get_header())
233-
nb.save(nii2,out_file)
234+
nb.save(nii2, out_file)
234235
return runtime
235236

236237
def _list_outputs(self):
@@ -243,5 +244,3 @@ def _list_outputs(self):
243244
suffix=self.inputs.suffix)
244245
outputs['out_file'] = os.path.abspath(outputs['out_file'])
245246
return outputs
246-
247-

0 commit comments

Comments
 (0)