Skip to content

Commit a8bf448

Browse files
committed
PEP8
1 parent 40859ca commit a8bf448

File tree

1 file changed

+65
-61
lines changed

1 file changed

+65
-61
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 65 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ class To3DInputSpec(AFNICommandInputSpec):
2727
argstr='-prefix %s', name_source=["in_folder", "infolder"], usedefault=True)
2828
in_xor = ["infolder", "in_folder"]
2929
in_folder = Directory(desc='folder with DICOM images to convert',
30-
argstr='%s/*.dcm',
31-
position=-1,
32-
mandatory=True,
33-
exists=True,
34-
xor=in_xor)
35-
30+
argstr='%s/*.dcm',
31+
position=-1,
32+
mandatory=True,
33+
exists=True,
34+
xor=in_xor)
35+
3636
infolder = Directory(desc='folder with DICOM images to convert',
3737
argstr='%s/*.dcm',
3838
position=-1,
@@ -209,36 +209,36 @@ class WarpInputSpec(AFNICommandInputSpec):
209209
in_file = File(desc='input file to 3dWarp',
210210
argstr='%s',
211211
position=-1,
212-
mandatory=True,
213-
exists=True)
212+
mandatory=True,
213+
exists=True)
214214

215215
out_file = File("%s_warp", desc='output image file name',
216-
argstr='-prefix %s', name_source="in_file", usedefault=True)
216+
argstr='-prefix %s', name_source="in_file", usedefault=True)
217217

218218
tta2mni = traits.Bool(desc='transform dataset from Talairach to MNI152',
219-
argstr='-tta2mni')
219+
argstr='-tta2mni')
220220

221221
mni2tta = traits.Bool(desc='transform dataset from MNI152 to Talaraich',
222-
argstr='-mni2tta')
222+
argstr='-mni2tta')
223223

224224
matparent = File(desc="apply transformation from 3dWarpDrive",
225-
argstr="-matparent %s",
226-
exists=True)
225+
argstr="-matparent %s",
226+
exists=True)
227227

228228
deoblique = traits.Bool(desc='transform dataset from oblique to cardinal',
229-
argstr='-deoblique')
229+
argstr='-deoblique')
230230

231231
interp = traits.Enum(('linear', 'cubic', 'NN', 'quintic'),
232-
desc='spatial interpolation methods [default = linear]',
233-
argstr='-%s')
232+
desc='spatial interpolation methods [default = linear]',
233+
argstr='-%s')
234234

235235
gridset = File(desc="copy grid of specified dataset",
236-
argstr="-gridset %s",
237-
exists=True)
236+
argstr="-gridset %s",
237+
exists=True)
238238

239239
zpad = traits.Int(desc="pad input dataset with N planes" +
240-
" of zero on all sides.",
241-
argstr="-zpad %d")
240+
" of zero on all sides.",
241+
argstr="-zpad %d")
242242

243243
suffix = traits.Str('_warp', desc="out_file suffix", usedefault=True)
244244

@@ -268,16 +268,16 @@ class Warp(AFNICommand):
268268
class ResampleInputSpec(AFNICommandInputSpec):
269269

270270
in_file = File(desc='input file to 3dresample',
271-
argstr='-inset %s',
272-
position=-1,
273-
mandatory=True,
274-
exists=True)
271+
argstr='-inset %s',
272+
position=-1,
273+
mandatory=True,
274+
exists=True)
275275

276276
out_file = File("%s_resample", desc='output image file name',
277-
argstr='-prefix %s', name_source="in_file", usedefault=True)
277+
argstr='-prefix %s', name_source="in_file", usedefault=True)
278278

279279
orientation = traits.Str(desc='new orientation code',
280-
argstr='-orient %s')
280+
argstr='-orient %s')
281281

282282

283283
class Resample(AFNIBaseCommand):
@@ -300,26 +300,29 @@ class Resample(AFNIBaseCommand):
300300
_cmd = '3dresample'
301301
input_spec = ResampleInputSpec
302302
output_spec = AFNICommandOutputSpec
303-
303+
304+
304305
class AutoTcorrelateInputSpec(AFNICommandInputSpec):
305306
in_file = File(desc='timeseries x space (volume or surface) file',
306-
argstr='%s',
307-
position=-1,
308-
mandatory=True,
309-
exists=True)
307+
argstr='%s',
308+
position=-1,
309+
mandatory=True,
310+
exists=True)
310311

311-
polort = traits.Int(desc='Remove polynomical trend of order m or -1 for no detrending',
312+
polort = traits.Int(
313+
desc='Remove polynomical trend of order m or -1 for no detrending',
312314
argstr="-polort %d")
313315
eta2 = traits.Bool(desc='eta^2 similarity',
314-
argstr="-eta2")
315-
mask = File(exists=True, desc="mask of voxels",
316-
argstr="-mask %s")
317-
mask_only_targets = traits.Bool(desc="use mask only on targets voxels",
318-
argstr="-mask_only_targets")
316+
argstr="-eta2")
317+
mask = File(exists=True, desc="mask of voxels",
318+
argstr="-mask %s")
319+
mask_only_targets = traits.Bool(desc="use mask only on targets voxels",
320+
argstr="-mask_only_targets")
319321

320322
out_file = File("%s_similarity_matrix.1D", desc='output image file name',
321-
argstr='-prefix %s', name_source="in_file", usedefault=True)
322-
323+
argstr='-prefix %s', name_source="in_file", usedefault=True)
324+
325+
323326
class AutoTcorrelate(AFNICommand):
324327
"""
325328
Examples
@@ -334,7 +337,7 @@ class AutoTcorrelate(AFNICommand):
334337
>>> corr.inputs.mask = 'mask.nii'
335338
>>> corr.inputs.mask_only_targets = True
336339
>>> corr.cmdline # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
337-
'3dAutoTcorrelate -eta2 -mask mask.nii -mask_only_targets -prefix ...my_similarity_matrix.1D -polort -1 functional.nii'
340+
'3dAutoTcorrelate -eta2 -mask mask.nii -mask_only_targets -prefix ...my_similarity_matrix.1D -polort -1 functional.nii'
338341
>>> res = corr.run() # doctest: +SKIP
339342
"""
340343
input_spec = AutoTcorrelateInputSpec
@@ -346,19 +349,20 @@ def _overload_extension(self, value):
346349
if ext.lower() not in [".1d", ".nii.gz", ".nii"]:
347350
ext = ext + ".1D"
348351
return os.path.join(path, base + ext)
349-
352+
350353
def _gen_filename(self, name):
351354
return os.path.abspath(super(AutoTcorrelate, self)._gen_filename(name))
352355

356+
353357
class TStatInputSpec(AFNICommandInputSpec):
354358
in_file = File(desc='input file to 3dTstat',
355-
argstr='%s',
356-
position=-1,
357-
mandatory=True,
358-
exists=True)
359+
argstr='%s',
360+
position=-1,
361+
mandatory=True,
362+
exists=True)
359363

360364
out_file = File("%s_tstat", desc='output image file name',
361-
argstr='-prefix %s', name_source="in_file", usedefault=True)
365+
argstr='-prefix %s', name_source="in_file", usedefault=True)
362366

363367

364368
class TStat(AFNICommand):
@@ -385,13 +389,13 @@ class TStat(AFNICommand):
385389

386390
class DetrendInputSpec(AFNICommandInputSpec):
387391
in_file = File(desc='input file to 3dDetrend',
388-
argstr='%s',
389-
position=-1,
390-
mandatory=True,
391-
exists=True)
392+
argstr='%s',
393+
position=-1,
394+
mandatory=True,
395+
exists=True)
392396

393397
out_file = File("%s_detrend", desc='output image file name',
394-
argstr='-prefix %s', name_source="in_file", usedefault=True)
398+
argstr='-prefix %s', name_source="in_file", usedefault=True)
395399

396400

397401
class Detrend(AFNICommand):
@@ -419,13 +423,13 @@ class Detrend(AFNICommand):
419423

420424
class DespikeInputSpec(AFNICommandInputSpec):
421425
in_file = File(desc='input file to 3dDespike',
422-
argstr='%s',
423-
position=-1,
424-
mandatory=True,
425-
exists=True)
426+
argstr='%s',
427+
position=-1,
428+
mandatory=True,
429+
exists=True)
426430

427431
out_file = File("%s_despike", desc='output image file name',
428-
argstr='-prefix %s', name_source="in_file", usedefault=True)
432+
argstr='-prefix %s', name_source="in_file", usedefault=True)
429433

430434

431435
class Despike(AFNICommand):
@@ -451,13 +455,13 @@ class Despike(AFNICommand):
451455

452456
class AutomaskInputSpec(AFNICommandInputSpec):
453457
in_file = File(desc='input file to 3dAutomask',
454-
argstr='%s',
455-
position=-1,
456-
mandatory=True,
457-
exists=True)
458+
argstr='%s',
459+
position=-1,
460+
mandatory=True,
461+
exists=True)
458462

459463
out_file = File("%s_mask", desc='output image file name',
460-
argstr='-prefix %s', name_source="in_file", usedefault=True)
464+
argstr='-prefix %s', name_source="in_file", usedefault=True)
461465

462466
brain_file = File("%s_masked",
463467
desc="output file from 3dAutomask",

0 commit comments

Comments
 (0)