Skip to content

Commit 83e55cc

Browse files
author
Clark
committed
PEP8 compliance for utils.py
1 parent 2005b6f commit 83e55cc

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

nipype/interfaces/spm/utils.py

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
import os
44
import numpy as np
55

6-
from .base import SPMCommandInputSpec, SPMCommand, Info, scans_for_fnames, scans_for_fname
6+
from .base import (SPMCommandInputSpec, SPMCommand, Info, scans_for_fnames,
7+
scans_for_fname)
78
from ..matlab import MatlabCommand
89
from ..base import (TraitedSpec, BaseInterface,
910
BaseInterfaceInputSpec, isdefined,
1011
OutputMultiPath, InputMultiPath)
1112
from ..base import File, traits
12-
from ...utils.filemanip import split_filename, fname_presuffix, filename_to_list, list_to_filename
13+
from ...utils.filemanip import (split_filename, fname_presuffix,
14+
filename_to_list, list_to_filename)
1315

1416

1517
class Analyze2niiInputSpec(SPMCommandInputSpec):
@@ -45,7 +47,8 @@ class CalcCoregAffineInputSpec(SPMCommandInputSpec):
4547
target = File(exists=True, mandatory=True,
4648
desc='target for generating affine transform')
4749
moving = File(exists=True, mandatory=True, copyfile=False,
48-
desc='volume transform can be applied to register with target')
50+
desc=('volume transform can be applied to register with '
51+
'target'))
4952
mat = File(desc='Filename used to store affine matrix')
5053
invmat = File(desc='Filename used to store inverse affine matrix')
5154

@@ -346,7 +349,8 @@ class ResliceToReferenceOutput(TraitedSpec):
346349

347350

348351
class ResliceToReference(SPMCommand):
349-
""" Uses spm to reslice a volume to a target image space or to a provided voxel size and bounding box
352+
"""Uses spm to reslice a volume to a target image space or to a provided
353+
voxel size and bounding box
350354
351355
Examples
352356
--------
@@ -409,10 +413,11 @@ class DicomImportInputSpec(SPMCommandInputSpec):
409413
icedims = traits.Bool(False,
410414
field='convopts.icedims',
411415
usedefault=True,
412-
desc='If image sorting fails, one can try using the additional\
413-
SIEMENS ICEDims information to create unique filenames.\
414-
Use this only if there would be multiple volumes with\
415-
exactly the same file names.')
416+
desc=('If image sorting fails, one can try using '
417+
'the additional SIEMENS ICEDims information '
418+
'to create unique filenames. Use this only if '
419+
'there would be multiple volumes with exactly '
420+
'the same file names.'))
416421

417422

418423
class DicomImportOutputSpec(TraitedSpec):
@@ -468,9 +473,13 @@ def _list_outputs(self):
468473
if self.inputs.output_dir_struct == "flat":
469474
outputs['out_files'] = glob(os.path.join(od, '*.%s' % ext))
470475
elif self.inputs.output_dir_struct == 'series':
471-
outputs['out_files'] = glob(os.path.join(od, os.path.join('*', '*.%s' % ext)))
472-
elif self.inputs.output_dir_struct in ['patid', 'date_time', 'patname']:
473-
outputs['out_files'] = glob(os.path.join(od, os.path.join('*', '*', '*.%s' % ext)))
476+
outputs['out_files'] = glob(
477+
os.path.join(od, os.path.join('*', '*.%s' % ext)))
478+
elif (self.inputs.output_dir_struct in
479+
['patid', 'date_time', 'patname']):
480+
outputs['out_files'] = glob(
481+
os.path.join(od, os.path.join('*', '*', '*.%s' % ext)))
474482
elif self.inputs.output_dir_struct == 'patid_date':
475-
outputs['out_files'] = glob(os.path.join(od, os.path.join('*', '*', '*', '*.%s' % ext)))
483+
outputs['out_files'] = glob(
484+
os.path.join(od, os.path.join('*', '*', '*', '*.%s' % ext)))
476485
return outputs

0 commit comments

Comments
 (0)