Skip to content

Commit c2bdc66

Browse files
author
David Ellis
committed
FIX: updates test files.
1 parent eaacfbb commit c2bdc66

File tree

10 files changed

+138
-143
lines changed

10 files changed

+138
-143
lines changed

examples/smri_fsreconall.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
================
66
77
This script, smri_fsreconall.py, demonstrates the ability to use the
8-
reconall nipype workflow with a set of subjects and then make an average
8+
reconall nipype workflow with a set of subjects and then make an average
99
subject::
1010
1111
python smri_fsreconall.py
@@ -75,13 +75,4 @@
7575
wf.connect(datasource, 'struct', recon_all, 'inputspec.T1_files')
7676
wf.connect(inputspec, 'subject_id', recon_all, 'inputspec.subject_id')
7777

78-
"""
79-
Make average subject
80-
"""
81-
82-
#average = pe.Node(interface=MakeAverageSubject(), name="average")
83-
#average.inputs.subjects_dir = subjects_dir
84-
85-
#wf.connect(recon_all, 'outputspec.subject_id', average, 'subjects_ids')
86-
8778
wf.run("MultiProc", plugin_args={'n_procs': 4})

nipype/interfaces/freesurfer/longitudinal.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ class RobustTemplateInputSpec(FSTraitedSpec):
3939
transform_outputs = InputMultiPath(File(exists=False),
4040
argstr='--lta %s',
4141
desc='output xforms to template (for each input)')
42-
intensity_scaling = traits.Bool(default_value=False,
43-
argstr='--iscale',
42+
intensity_scaling = traits.Bool(default_value=False,
43+
argstr='--iscale',
4444
desc='allow also intensity scaling (default off)')
4545
scaled_intensity_outputs = InputMultiPath(File(exists=False),
4646
argstr='--iscaleout %s',
4747
desc='final intensity scales (will activate --iscale)')
48-
subsample_threshold = traits.Int(argstr='--subsample %d',
48+
subsample_threshold = traits.Int(argstr='--subsample %d',
4949
desc='subsample if dim > # on all axes (default no subs.)')
5050
average_metric = traits.Enum('median', 'mean', argstr='--average %d',
5151
desc='construct template from: 0 Mean, 1 Median (default)')
52-
initial_timepoint = traits.Int(argstr='--inittp %d',
52+
initial_timepoint = traits.Int(argstr='--inittp %d',
5353
desc='use TP# for spacial init (default random), 0: no init')
5454
fixed_timepoint = traits.Bool(default_value=False, argstr='--fixtp',
5555
desc='map everthing to init TP# (init TP is not resampled)')

nipype/interfaces/freesurfer/tests/test_auto_MRIFill.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def test_MRIFill_inputs():
1717
position=-2,
1818
),
1919
log_file=dict(argstr='-a %s',
20-
mandatory=False,
2120
),
2221
out_file=dict(argstr='%s',
2322
mandatory=True,
@@ -41,7 +40,8 @@ def test_MRIFill_inputs():
4140

4241

4342
def test_MRIFill_outputs():
44-
output_map = dict(out_file=dict(),
43+
output_map = dict(log_file=dict(),
44+
out_file=dict(),
4545
)
4646
outputs = MRIFill.output_spec()
4747

nipype/interfaces/freesurfer/tests/test_auto_ParcellationStats.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def test_ParcellationStats_inputs():
1212
),
1313
copy_inputs=dict(mandatory=False,
1414
),
15+
cortex_label=dict(),
1516
environ=dict(nohash=True,
1617
usedefault=True,
1718
),
@@ -71,6 +72,9 @@ def test_ParcellationStats_inputs():
7172
),
7273
terminal_output=dict(nohash=True,
7374
),
75+
th3=dict(argstr='-th3',
76+
requires=['cortex_label'],
77+
),
7478
thickness=dict(mandatory=True,
7579
),
7680
transform=dict(mandatory=True,

nipype/workflows/smri/freesurfer/autorecon1.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def create_AutoRecon1(name="AutoRecon1", longitudinal=False, field_strength='1.5
6464
inputspec.cw256 : Conform inputs to 256 FOV (optional)
6565
inputspec.num_threads: Number of threads to use with EM Register (default=1)
6666
Outpus::
67-
67+
6868
"""
6969
ar1_wf = pe.Workflow(name=name)
7070
inputspec = pe.Node(interface=IdentityInterface(fields=['T1_files',
@@ -114,14 +114,14 @@ def convert_modalities(in_file=None, out_file=None):
114114
convert_modalities),
115115
name="T2_Convert")
116116
T2_convert.inputs.out_file = 'T2raw.mgz'
117-
ar1_wf.connect([(inputspec, T2_convert, [('T2_file', 'in_file')])])
117+
ar1_wf.connect([(inputspec, T2_convert, [('T2_file', 'in_file')])])
118118

119119
FLAIR_convert = pe.Node(Function(['in_file', 'out_file'],
120120
['out_file'],
121121
convert_modalities),
122122
name="FLAIR_Convert")
123123
FLAIR_convert.inputs.out_file = 'FLAIRraw.mgz'
124-
ar1_wf.connect([(inputspec, FLAIR_convert, [('FLAIR_file', 'in_file')])])
124+
ar1_wf.connect([(inputspec, FLAIR_convert, [('FLAIR_file', 'in_file')])])
125125
else:
126126
# longitudinal inputs
127127
inputspec = pe.Node(interface=IdentityInterface(fields=['T1_files',
@@ -151,7 +151,7 @@ def output_names(T1_files):
151151
output_names),
152152
name="Longitudinal_Filenames")
153153
ar1_wf.connect([(inputspec, filenames, [('T1_files', 'T1_files')])])
154-
154+
155155
copy_ltas = pe.MapNode(Function(['in_file', 'out_file'],
156156
['out_file'],
157157
copy_file),
@@ -173,7 +173,7 @@ def output_names(T1_files):
173173
ar1_wf.connect([(copy_ltas, concatenate_lta, [('out_file', 'in_file')]),
174174
(inputspec, concatenate_lta, [('subj_to_template_lta', 'subj_to_base')])])
175175

176-
176+
177177
# Motion Correction
178178
"""
179179
When there are multiple source volumes, this step will correct for small
@@ -215,7 +215,7 @@ def createTemplate(in_files, out_file):
215215
out_file = robtemp.outputs.out_file
216216
out_file = os.path.abspath(out_file)
217217
return out_file, intensity_scales, transforms
218-
218+
219219
if not longitudinal:
220220
create_template = pe.Node(Function(['in_files', 'out_file'],
221221
['out_file', 'intensity_scales', 'transforms'],
@@ -238,10 +238,10 @@ def createTemplate(in_files, out_file):
238238
if not longitudinal:
239239
conform_template.inputs.conform = True
240240
ar1_wf.connect([(verify_inputs, conform_template, [('cw256', 'cw256'),
241-
('resample_type', 'resample_type')])])
241+
('resample_type', 'resample_type')])])
242242
else:
243243
conform_template.inputs.out_datatype = 'uchar'
244-
244+
245245
ar1_wf.connect([(create_template, conform_template, [('out_file', 'in_file')])])
246246

247247
# Talairach
@@ -258,7 +258,7 @@ def createTemplate(in_files, out_file):
258258
# 3T params from Zheng, Chee, Zagorodnov 2009 NeuroImage paper
259259
# "Improvement of brain segmentation accuracy by optimizing
260260
# non-uniformity correction using N3"
261-
# namely specifying iterations, proto-iters and distance:
261+
# namely specifying iterations, proto-iters and distance:
262262
bias_correction.inputs.distance = 50
263263
else:
264264
# 1.5T default
@@ -294,7 +294,7 @@ def createTemplate(in_files, out_file):
294294
talairach_avi.inputs.out_file = 'talairach.auto.xfm'
295295

296296
ar1_wf.connect([(inputspec, talairach_avi, [('template_talairach_xfm', 'in_file')])])
297-
297+
298298
copy_transform = pe.Node(Function(['in_file', 'out_file'],
299299
['out_file'],
300300
copy_file),
@@ -328,7 +328,7 @@ def createTemplate(in_files, out_file):
328328
(copy_transform, add_xform_to_orig_nu, [('out_file', 'transform')])])
329329

330330

331-
331+
332332
# check the alignment of the talairach
333333
# TODO: Figure out how to read output from this node.
334334
check_alignment = pe.Node(CheckTalairachAlignment(),
@@ -356,7 +356,7 @@ def awkfile(in_file, log_file):
356356
awkfile),
357357
name='Awk')
358358
awk_logfile.inputs.in_file = awk_file
359-
359+
360360
ar1_wf.connect([(talairach_avi, awk_logfile, [('out_log', 'log_file')])])
361361

362362
# TODO datasink the output from TalirachQC...not sure how to do this
@@ -376,19 +376,19 @@ def awkfile(in_file, log_file):
376376
(copy_transform, mri_normalize,
377377
[('out_file', 'transform')]),
378378
])
379-
379+
380380
# Skull Strip
381381
"""
382-
Removes the skull from mri/T1.mgz and stores the result in
382+
Removes the skull from mri/T1.mgz and stores the result in
383383
mri/brainmask.auto.mgz and mri/brainmask.mgz. Runs the mri_watershed program.
384384
"""
385-
if not longitudinal:
385+
if not longitudinal:
386386
mri_em_register = pe.Node(EMRegister(), name="EM_Register")
387387
mri_em_register.inputs.out_file = 'talairach_with_skull.lta'
388388
mri_em_register.inputs.skull = True
389389
if plugin_args:
390390
mri_em_register.plugin_args = plugin_args
391-
391+
392392
ar1_wf.connect([(add_xform_to_orig_nu, mri_em_register, [('out_file', 'in_file')]),
393393
(inputspec, mri_em_register, [('num_threads', 'num_threads'),
394394
('reg_template_withskull', 'template')])])
@@ -406,13 +406,13 @@ def awkfile(in_file, log_file):
406406
copy_file),
407407
name='Copy_Template_Brainmask')
408408
copy_template_brainmask.inputs.out_file = 'brainmask_{0}.mgz'.format(config['long_template'])
409-
409+
410410
ar1_wf.connect([(inputspec, copy_template_brainmask, [('template_brainmask', 'in_file')])])
411411

412412
mask1 = pe.Node(ApplyMask(), name="ApplyMask1")
413413
mask1.inputs.keep_mask_deletion_edits = True
414414
mask1.inputs.out_file = 'brainmask.auto.mgz'
415-
415+
416416
ar1_wf.connect([(mri_normalize, mask1, [('out_file', 'in_file')]),
417417
(copy_template_brainmask, mask1, [('out_file', 'mask_file')])])
418418

@@ -423,7 +423,7 @@ def awkfile(in_file, log_file):
423423

424424
ar1_wf.connect([(mask1, brainmask, [('out_file', 'in_file')]),
425425
(copy_template_brainmask, brainmask, [('out_file', 'mask_file')])])
426-
426+
427427
copy_brainmask = pe.Node(Function(['in_file', 'out_file'],
428428
['out_file'],
429429
copy_file),
@@ -458,10 +458,10 @@ def awkfile(in_file, log_file):
458458
(copy_transform, outputspec, [('out_file', 'talairach')]),
459459
(mri_normalize, outputspec, [('out_file', 't1')]),
460460
(brainmask, outputspec, [('out_file', 'brainmask_auto')]),
461-
(copy_brainmask, outputspec, [('out_file', 'brainmask')]),
461+
(copy_brainmask, outputspec, [('out_file', 'brainmask')]),
462462
])
463463

464-
464+
465465
if not longitudinal:
466466
ar1_wf.connect([(mri_em_register, outputspec, [('out_file', 'talskull')]),
467467
])

0 commit comments

Comments
 (0)