Skip to content

Commit b81611a

Browse files
author
Clark
committed
PEP8 compliance for preprocess.py (5%)
1 parent 83e55cc commit b81611a

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

nipype/interfaces/spm/preprocess.py

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ class SliceTimingInputSpec(SPMCommandInputSpec):
4747
'calculated as TR-(TR/num_slices)'),
4848
mandatory=True)
4949
slice_order = traits.List(traits.Int(), field='so',
50-
desc='1-based order in which slices are acquired',
50+
desc=('1-based order in which slices are '
51+
'acquired'),
5152
mandatory=True)
5253
ref_slice = traits.Int(field='refslice',
5354
desc='1-based Number of the reference slice',
@@ -104,7 +105,8 @@ def _list_outputs(self):
104105
filelist = filename_to_list(self.inputs.in_files)
105106
for f in filelist:
106107
if isinstance(f, list):
107-
run = [fname_presuffix(in_f, prefix=self.inputs.out_prefix) for in_f in f]
108+
run = [fname_presuffix(in_f, prefix=self.inputs.out_prefix)
109+
for in_f in f]
108110
else:
109111
run = fname_presuffix(f, prefix=self.inputs.out_prefix)
110112
outputs['timecorrected_files'].append(run)
@@ -126,7 +128,8 @@ class RealignInputSpec(SPMCommandInputSpec):
126128
separation = traits.Range(low=0.0, field='eoptions.sep',
127129
desc='sampling separation in mm')
128130
register_to_mean = traits.Bool(field='eoptions.rtm',
129-
desc='Indicate whether realignment is done to the mean image')
131+
desc=('Indicate whether realignment is '
132+
'done to the mean image'))
130133
weight_img = File(exists=True, field='eoptions.weight',
131134
desc='filename of weighting image')
132135
interp = traits.Range(low=0, high=7, field='eoptions.interp',
@@ -138,10 +141,12 @@ class RealignInputSpec(SPMCommandInputSpec):
138141
minlen=2, maxlen=2, usedefault=True,
139142
desc='determines which images to reslice')
140143
write_interp = traits.Range(low=0, high=7, field='roptions.interp',
141-
desc='degree of b-spline used for interpolation')
144+
desc=('degree of b-spline used for '
145+
'interpolation'))
142146
write_wrap = traits.List(traits.Int(), minlen=3, maxlen=3,
143147
field='roptions.wrap',
144-
desc='Check if interpolation should wrap in [x,y,z]')
148+
desc=('Check if interpolation should wrap in '
149+
'[x,y,z]'))
145150
write_mask = traits.Bool(field='roptions.mask',
146151
desc='True/False mask output image')
147152
out_prefix = traits.String('r', field='roptions.prefix', usedefault=True,
@@ -150,20 +155,25 @@ class RealignInputSpec(SPMCommandInputSpec):
150155

151156
class RealignOutputSpec(TraitedSpec):
152157
mean_image = File(exists=True, desc='Mean image file from the realignment')
153-
modified_in_files = OutputMultiPath(traits.Either(traits.List(File(exists=True)),
154-
File(exists=True)),
155-
desc='Copies of all files passed to in_files.\
156-
Headers will have been modified to align all\
157-
images with the first, or optionally to first\
158-
do that, extract a mean image, and re-align to\
159-
that mean image.')
160-
realigned_files = OutputMultiPath(traits.Either(traits.List(File(exists=True)),
161-
File(exists=True)),
162-
desc='If jobtype is write or estwrite, these will be the\
163-
resliced files. Otherwise, they will be copies of\
164-
in_files that have had their headers rewritten.')
158+
modified_in_files = OutputMultiPath(traits.Either(
159+
traits.List(File(exists=True)), File(exists=True)),
160+
desc=('Copies of all files passed to '
161+
'in_files. Headers will have '
162+
'been modified to align all '
163+
'images with the first, or '
164+
'optionally to first do that, '
165+
'extract a mean image, and '
166+
're-align to that mean image.'))
167+
realigned_files = OutputMultiPath(traits.Either(
168+
traits.List(File(exists=True)), File(exists=True)),
169+
desc=('If jobtype is write or estwrite, '
170+
'these will be the resliced files.'
171+
' Otherwise, they will be copies '
172+
'of in_files that have had their '
173+
'headers rewritten.'))
165174
realignment_parameters = OutputMultiPath(File(exists=True),
166-
desc='Estimated translation and rotation parameters')
175+
desc=('Estimated translation and '
176+
'rotation parameters'))
167177

168178

169179
class Realign(SPMCommand):
@@ -220,10 +230,9 @@ def _list_outputs(self):
220230
tmp_imgf = imgf[0]
221231
else:
222232
tmp_imgf = imgf
223-
outputs['realignment_parameters'].append(fname_presuffix(tmp_imgf,
224-
prefix='rp_',
225-
suffix='.txt',
226-
use_ext=False))
233+
outputs['realignment_parameters'].append(
234+
fname_presuffix(tmp_imgf, prefix='rp_', suffix='.txt',
235+
use_ext=False))
227236
if not isinstance(imgf, list) and func_is_3d(imgf):
228237
break
229238
if self.inputs.jobtype == "estimate":

0 commit comments

Comments
 (0)