Skip to content

Commit 7f2020c

Browse files
committed
FIX: PEP8 - E251 unexpected spaces around keyword / parameter equals
1 parent a663c5d commit 7f2020c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+467
-469
lines changed

examples/dmri_camino_dti.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def get_affine(volume):
9292

9393
datasource = pe.Node(interface=nio.DataGrabber(infields=['subject_id'],
9494
outfields=list(info.keys())),
95-
name = 'datasource')
95+
name='datasource')
9696

9797
datasource.inputs.template = "%s/%s"
9898

@@ -200,7 +200,7 @@ def get_affine(volume):
200200
trace = pe.Node(interface=camino.ComputeTensorTrace(), name='trace')
201201
dteig = pe.Node(interface=camino.ComputeEigensystem(), name='dteig')
202202

203-
analyzeheader_fa = pe.Node(interface= camino.AnalyzeHeader(), name = "analyzeheader_fa")
203+
analyzeheader_fa = pe.Node(interface=camino.AnalyzeHeader(), name="analyzeheader_fa")
204204
analyzeheader_fa.inputs.datatype = "double"
205205
analyzeheader_trace = analyzeheader_fa.clone('analyzeheader_trace')
206206

examples/dmri_connectivity.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def select_aparc_annot(list_of_files):
147147

148148
datasource = pe.Node(interface=nio.DataGrabber(infields=['subject_id'],
149149
outfields=list(info.keys())),
150-
name = 'datasource')
150+
name='datasource')
151151

152152
datasource.inputs.template = "%s/%s"
153153
datasource.inputs.base_directory = data_dir
@@ -185,24 +185,24 @@ def select_aparc_annot(list_of_files):
185185
FSL's Brain Extraction tool is used to create a mask from the b0 image
186186
"""
187187

188-
b0Strip = pe.Node(interface=fsl.BET(mask = True), name = 'bet_b0')
188+
b0Strip = pe.Node(interface=fsl.BET(mask=True), name='bet_b0')
189189

190190
"""
191191
FSL's FLIRT function is used to coregister the b0 mask and the structural image.
192192
A convert_xfm node is then used to obtain the inverse of the transformation matrix.
193193
FLIRT is used once again to apply the inverse transformation to the parcellated brain image.
194194
"""
195195

196-
coregister = pe.Node(interface=fsl.FLIRT(dof=6), name = 'coregister')
196+
coregister = pe.Node(interface=fsl.FLIRT(dof=6), name='coregister')
197197
coregister.inputs.cost = ('corratio')
198198

199-
convertxfm = pe.Node(interface=fsl.ConvertXFM(), name = 'convertxfm')
199+
convertxfm = pe.Node(interface=fsl.ConvertXFM(), name='convertxfm')
200200
convertxfm.inputs.invert_xfm = True
201201

202-
inverse = pe.Node(interface=fsl.FLIRT(), name = 'inverse')
202+
inverse = pe.Node(interface=fsl.FLIRT(), name='inverse')
203203
inverse.inputs.interp = ('nearestneighbour')
204204

205-
inverse_AparcAseg = pe.Node(interface=fsl.FLIRT(), name = 'inverse_AparcAseg')
205+
inverse_AparcAseg = pe.Node(interface=fsl.FLIRT(), name='inverse_AparcAseg')
206206
inverse_AparcAseg.inputs.interp = ('nearestneighbour')
207207

208208
"""
@@ -334,7 +334,7 @@ def select_aparc_annot(list_of_files):
334334
"""
335335

336336
roigen = pe.Node(interface=cmtk.ROIGen(), name="ROIGen")
337-
cmp_config = cmp.configuration.PipelineConfiguration(parcellation_scheme = "NativeFreesurfer")
337+
cmp_config = cmp.configuration.PipelineConfiguration(parcellation_scheme="NativeFreesurfer")
338338
cmp_config.parcellation_scheme = "NativeFreesurfer"
339339
roigen.inputs.LUT_file = cmp_config.get_freeview_lut("NativeFreesurfer")['freesurferaparc']
340340
roigen_structspace = roigen.clone('ROIGen_structspace')

examples/dmri_connectivity_advanced.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115

116116
datasource = pe.Node(interface=nio.DataGrabber(infields=['subject_id'],
117117
outfields=list(info.keys())),
118-
name = 'datasource')
118+
name='datasource')
119119

120120
datasource.inputs.template = "%s/%s"
121121
datasource.inputs.base_directory = data_dir
@@ -244,7 +244,7 @@
244244
thresholding it at a reasonably high level.
245245
"""
246246

247-
bet = pe.Node(interface=fsl.BET(mask = True), name = 'bet_b0')
247+
bet = pe.Node(interface=fsl.BET(mask=True), name='bet_b0')
248248
gen_WM_mask = pe.Node(interface=mrtrix.GenerateWhiteMatterMask(), name='gen_WM_mask')
249249
threshold_wmmask = pe.Node(interface=mrtrix.Threshold(), name='threshold_wmmask')
250250
threshold_wmmask.inputs.absolute_threshold_value = 0.4
@@ -287,7 +287,7 @@
287287
so that they are in the same space as the regions of interest.
288288
"""
289289

290-
coregister = pe.Node(interface=fsl.FLIRT(dof=6), name = 'coregister')
290+
coregister = pe.Node(interface=fsl.FLIRT(dof=6), name='coregister')
291291
coregister.inputs.cost = ('normmi')
292292

293293
"""

examples/dmri_dtk_dti.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
datasource = pe.Node(interface=nio.DataGrabber(infields=['subject_id'],
101101
outfields=list(info.keys())),
102-
name = 'datasource')
102+
name='datasource')
103103

104104
datasource.inputs.template = "%s/%s"
105105

examples/dmri_dtk_odf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
datasource = pe.Node(interface=nio.DataGrabber(infields=['subject_id'],
101101
outfields=list(info.keys())),
102-
name = 'datasource')
102+
name='datasource')
103103

104104
datasource.inputs.template = "%s/%s"
105105

examples/dmri_fsl_dti.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
info = dict(dwi=[['subject_id', 'data']],
7575
bvecs=[['subject_id', 'bvecs']],
7676
bvals=[['subject_id', 'bvals']],
77-
seed_file = [['subject_id', 'MASK_average_thal_right']],
78-
target_masks = [['subject_id', ['MASK_average_M1_right',
77+
seed_file=[['subject_id', 'MASK_average_thal_right']],
78+
target_masks=[['subject_id', ['MASK_average_M1_right',
7979
'MASK_average_S1_right',
8080
'MASK_average_occipital_right',
8181
'MASK_average_pfc_right',
@@ -108,7 +108,7 @@
108108

109109
datasource = pe.Node(interface=nio.DataGrabber(infields=['subject_id'],
110110
outfields=list(info.keys())),
111-
name = 'datasource')
111+
name='datasource')
112112

113113
datasource.inputs.template = "%s/%s"
114114

examples/dmri_mrtrix_dti.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
datasource = pe.Node(interface=nio.DataGrabber(infields=['subject_id'],
6060
outfields=list(info.keys())),
61-
name = 'datasource')
61+
name='datasource')
6262

6363
datasource.inputs.template = "%s/%s"
6464
datasource.inputs.base_directory = data_dir
@@ -135,7 +135,7 @@
135135
thresholding it at a reasonably high level.
136136
"""
137137

138-
bet = pe.Node(interface=fsl.BET(mask = True), name = 'bet_b0')
138+
bet = pe.Node(interface=fsl.BET(mask=True), name='bet_b0')
139139
gen_WM_mask = pe.Node(interface=mrtrix.GenerateWhiteMatterMask(), name='gen_WM_mask')
140140
threshold_wmmask = pe.Node(interface=mrtrix.Threshold(), name='threshold_wmmask')
141141
threshold_wmmask.inputs.absolute_threshold_value = 0.4

examples/fmri_ants_openfmri.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def create_fs_reg_workflow(name='registration'):
370370
binarize = Node(fs.Binarize(min=0.5, out_type="nii.gz", dilate=1), name="binarize_aparc")
371371
register.connect(fssource, ("aparc_aseg", get_aparc_aseg), binarize, "in_file")
372372

373-
stripper = Node(fsl.ApplyMask(), name ='stripper')
373+
stripper = Node(fsl.ApplyMask(), name='stripper')
374374
register.connect(binarize, "binary_file", stripper, "mask_file")
375375
register.connect(convert, 'out_file', stripper, 'in_file')
376376

examples/fmri_freesurfer_smooth.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@
163163
164164
"""
165165

166-
volsmooth = pe.Node(interface=spm.Smooth(), name = "volsmooth")
167-
surfsmooth = pe.MapNode(interface=fs.Smooth(proj_frac_avg=(0, 1, 0.1)), name = "surfsmooth",
166+
volsmooth = pe.Node(interface=spm.Smooth(), name="volsmooth")
167+
surfsmooth = pe.MapNode(interface=fs.Smooth(proj_frac_avg=(0, 1, 0.1)), name="surfsmooth",
168168
iterfield=['in_file'])
169169

170170
"""
@@ -198,15 +198,15 @@
198198
:class:`nipype.interfaces.spm.SpecifyModel`.
199199
"""
200200

201-
modelspec = pe.Node(interface=model.SpecifySPMModel(), name= "modelspec")
201+
modelspec = pe.Node(interface=model.SpecifySPMModel(), name="modelspec")
202202
modelspec.inputs.concatenate_runs = True
203203

204204
"""
205205
Generate a first level SPM.mat file for analysis
206206
:class:`nipype.interfaces.spm.Level1Design`.
207207
"""
208208

209-
level1design = pe.Node(interface=spm.Level1Design(), name= "level1design")
209+
level1design = pe.Node(interface=spm.Level1Design(), name="level1design")
210210
level1design.inputs.bases = {'hrf': {'derivs': [0, 0]}}
211211

212212
"""
@@ -222,7 +222,7 @@
222222
first level contrasts specified in a few steps above.
223223
"""
224224

225-
contrastestimate = pe.Node(interface = spm.EstimateContrast(), name="contrastestimate")
225+
contrastestimate = pe.Node(interface=spm.EstimateContrast(), name="contrastestimate")
226226

227227
volanalysis.connect([(modelspec, level1design, [('session_info', 'session_info')]),
228228
(level1design, level1estimate, [('spm_mat_file', 'spm_mat_file')]),
@@ -417,7 +417,7 @@
417417

418418
datasource = pe.Node(interface=nio.DataGrabber(infields=['subject_id'],
419419
outfields=['func', 'struct']),
420-
name = 'datasource')
420+
name='datasource')
421421
datasource.inputs.base_directory = data_dir
422422
datasource.inputs.template = '%s/%s.nii'
423423
datasource.inputs.template_args = info

examples/fmri_fsl.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"""
7474

7575
img2float = pe.MapNode(interface=fsl.ImageMaths(out_data_type='float',
76-
op_string = '',
76+
op_string='',
7777
suffix='_dtype'),
7878
iterfield=['in_file'],
7979
name='img2float')
@@ -84,7 +84,7 @@
8484
"""
8585

8686
extract_ref = pe.Node(interface=fsl.ExtractROI(t_size=1),
87-
name = 'extractref')
87+
name='extractref')
8888

8989
"""
9090
Define a function to pick the first file from a list of files
@@ -116,10 +116,10 @@ def getmiddlevolume(func):
116116
Realign the functional runs to the middle volume of the first run
117117
"""
118118

119-
motion_correct = pe.MapNode(interface=fsl.MCFLIRT(save_mats = True,
120-
save_plots = True),
119+
motion_correct = pe.MapNode(interface=fsl.MCFLIRT(save_mats=True,
120+
save_plots=True),
121121
name='realign',
122-
iterfield = ['in_file'])
122+
iterfield=['in_file'])
123123
preproc.connect(img2float, 'out_file', motion_correct, 'in_file')
124124
preproc.connect(extract_ref, 'roi_file', motion_correct, 'ref_file')
125125

@@ -138,7 +138,7 @@ def getmiddlevolume(func):
138138
Extract the mean volume of the first functional run
139139
"""
140140

141-
meanfunc = pe.Node(interface=fsl.ImageMaths(op_string = '-Tmean',
141+
meanfunc = pe.Node(interface=fsl.ImageMaths(op_string='-Tmean',
142142
suffix='_mean'),
143143
name='meanfunc')
144144
preproc.connect(motion_correct, ('out_file', pickfirst), meanfunc, 'in_file')
@@ -147,10 +147,10 @@ def getmiddlevolume(func):
147147
Strip the skull from the mean functional to generate a mask
148148
"""
149149

150-
meanfuncmask = pe.Node(interface=fsl.BET(mask = True,
150+
meanfuncmask = pe.Node(interface=fsl.BET(mask=True,
151151
no_output=True,
152-
frac = 0.3),
153-
name = 'meanfuncmask')
152+
frac=0.3),
153+
name='meanfuncmask')
154154
preproc.connect(meanfunc, 'out_file', meanfuncmask, 'in_file')
155155

156156
"""
@@ -160,7 +160,7 @@ def getmiddlevolume(func):
160160
maskfunc = pe.MapNode(interface=fsl.ImageMaths(suffix='_bet',
161161
op_string='-mas'),
162162
iterfield=['in_file'],
163-
name = 'maskfunc')
163+
name='maskfunc')
164164
preproc.connect(motion_correct, 'out_file', maskfunc, 'in_file')
165165
preproc.connect(meanfuncmask, 'mask_file', maskfunc, 'in_file2')
166166

@@ -170,7 +170,7 @@ def getmiddlevolume(func):
170170
"""
171171

172172
getthresh = pe.MapNode(interface=fsl.ImageStats(op_string='-p 2 -p 98'),
173-
iterfield = ['in_file'],
173+
iterfield=['in_file'],
174174
name='getthreshold')
175175
preproc.connect(maskfunc, 'out_file', getthresh, 'in_file')
176176

@@ -197,7 +197,7 @@ def getthreshop(thresh):
197197
"""
198198

199199
medianval = pe.MapNode(interface=fsl.ImageStats(op_string='-k %s -p 50'),
200-
iterfield = ['in_file'],
200+
iterfield=['in_file'],
201201
name='medianval')
202202
preproc.connect(motion_correct, 'out_file', medianval, 'in_file')
203203
preproc.connect(threshold, 'out_file', medianval, 'mask_file')
@@ -318,25 +318,25 @@ def getinormscale(medianvals):
318318
"""
319319

320320
nosestrip = pe.Node(interface=fsl.BET(frac=0.3),
321-
name = 'nosestrip')
322-
skullstrip = pe.Node(interface=fsl.BET(mask = True),
323-
name = 'stripstruct')
321+
name='nosestrip')
322+
skullstrip = pe.Node(interface=fsl.BET(mask=True),
323+
name='stripstruct')
324324

325325
coregister = pe.Node(interface=fsl.FLIRT(dof=6),
326-
name = 'coregister')
326+
name='coregister')
327327

328328
"""
329329
Use :class:`nipype.algorithms.rapidart` to determine which of the
330330
images in the functional series are outliers based on deviations in
331331
intensity and/or movement.
332332
"""
333333

334-
art = pe.MapNode(interface=ra.ArtifactDetect(use_differences = [True, False],
335-
use_norm = True,
336-
norm_threshold = 1,
337-
zintensity_threshold = 3,
338-
parameter_source = 'FSL',
339-
mask_type = 'file'),
334+
art = pe.MapNode(interface=ra.ArtifactDetect(use_differences=[True, False],
335+
use_norm=True,
336+
norm_threshold=1,
337+
zintensity_threshold=3,
338+
parameter_source='FSL',
339+
mask_type='file'),
340340
iterfield=['realigned_files', 'realignment_parameters'],
341341
name="art")
342342

@@ -377,7 +377,7 @@ def getinormscale(medianvals):
377377
"""
378378

379379
modelgen = pe.MapNode(interface=fsl.FEATModel(), name='modelgen',
380-
iterfield = ['fsf_file', 'ev_files'])
380+
iterfield=['fsf_file', 'ev_files'])
381381

382382

383383
"""
@@ -389,14 +389,14 @@ def getinormscale(medianvals):
389389
mask_size=5,
390390
threshold=1000),
391391
name='modelestimate',
392-
iterfield = ['design_file', 'in_file'])
392+
iterfield=['design_file', 'in_file'])
393393

394394
"""
395395
Use :class:`nipype.interfaces.fsl.ContrastMgr` to generate contrast estimates
396396
"""
397397

398398
conestimate = pe.MapNode(interface=fsl.ContrastMgr(), name='conestimate',
399-
iterfield = ['tcon_file', 'param_estimates',
399+
iterfield=['tcon_file', 'param_estimates',
400400
'sigmasquareds', 'corrections',
401401
'dof_file'])
402402

@@ -539,7 +539,7 @@ def num_copes(files):
539539

540540
datasource = pe.Node(interface=nio.DataGrabber(infields=['subject_id'],
541541
outfields=['func', 'struct']),
542-
name = 'datasource')
542+
name='datasource')
543543
datasource.inputs.base_directory = data_dir
544544
datasource.inputs.template = '%s/%s.nii'
545545
datasource.inputs.template_args = info
@@ -615,7 +615,7 @@ def subjectinfo(subject_id):
615615
========================
616616
"""
617617

618-
l1pipeline = pe.Workflow(name= "level1")
618+
l1pipeline = pe.Workflow(name="level1")
619619
l1pipeline.base_dir = os.path.abspath('./fsl/workingdir')
620620
l1pipeline.config = {"execution": {"crashdump_dir": os.path.abspath('./fsl/crashdumps')}}
621621

0 commit comments

Comments
 (0)