Skip to content

Commit 9e3ee31

Browse files
committed
[WIP] Revise terminal_output
This PR revises the terminal_output feature, making it a class attribute and deprecating the old InputSpec trait. It also implements new ways of storing the output of a CommandLine, as discussed in #1407. Thus, closes #1407.
1 parent 6e95b3c commit 9e3ee31

File tree

10 files changed

+137
-125
lines changed

10 files changed

+137
-125
lines changed

examples/fmri_ants_openfmri.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def create_reg_workflow(name='registration'):
218218
warpmean.inputs.input_image_type = 0
219219
warpmean.inputs.interpolation = 'Linear'
220220
warpmean.inputs.invert_transform_flags = [False, False]
221-
warpmean.inputs.terminal_output = 'file'
221+
warpmean.terminal_output = 'file'
222222

223223
register.connect(inputnode, 'target_image_brain', warpmean, 'reference_image')
224224
register.connect(inputnode, 'mean_image', warpmean, 'input_image')
@@ -234,7 +234,7 @@ def create_reg_workflow(name='registration'):
234234
warpall.inputs.input_image_type = 0
235235
warpall.inputs.interpolation = 'Linear'
236236
warpall.inputs.invert_transform_flags = [False, False]
237-
warpall.inputs.terminal_output = 'file'
237+
warpall.terminal_output = 'file'
238238

239239
register.connect(inputnode, 'target_image_brain', warpall, 'reference_image')
240240
register.connect(inputnode, 'source_files', warpall, 'input_image')
@@ -428,7 +428,7 @@ def create_fs_reg_workflow(name='registration'):
428428
warpmean.inputs.input_image_type = 0
429429
warpmean.inputs.interpolation = 'Linear'
430430
warpmean.inputs.invert_transform_flags = [False, False]
431-
warpmean.inputs.terminal_output = 'file'
431+
warpmean.terminal_output = 'file'
432432
warpmean.inputs.args = '--float'
433433
# warpmean.inputs.num_threads = 4
434434
# warpmean.plugin_args = {'sbatch_args': '--mem=4G -c 4'}
@@ -443,7 +443,7 @@ def create_fs_reg_workflow(name='registration'):
443443
warpall.inputs.input_image_type = 0
444444
warpall.inputs.interpolation = 'Linear'
445445
warpall.inputs.invert_transform_flags = [False, False]
446-
warpall.inputs.terminal_output = 'file'
446+
warpall.terminal_output = 'file'
447447
warpall.inputs.args = '--float'
448448
warpall.inputs.num_threads = 2
449449
warpall.plugin_args = {'sbatch_args': '--mem=6G -c 2'}

examples/rsfmri_vol_surface_preprocessing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ def create_reg_workflow(name='registration'):
547547
warpmean.inputs.input_image_type = 3
548548
warpmean.inputs.interpolation = 'Linear'
549549
warpmean.inputs.invert_transform_flags = [False, False]
550-
warpmean.inputs.terminal_output = 'file'
550+
warpmean.terminal_output = 'file'
551551
warpmean.inputs.args = '--float'
552552
warpmean.inputs.num_threads = 4
553553

@@ -767,7 +767,7 @@ def merge_files(in1, in2):
767767
warpall.inputs.input_image_type = 3
768768
warpall.inputs.interpolation = 'Linear'
769769
warpall.inputs.invert_transform_flags = [False, False]
770-
warpall.inputs.terminal_output = 'file'
770+
warpall.terminal_output = 'file'
771771
warpall.inputs.reference_image = target_file
772772
warpall.inputs.args = '--float'
773773
warpall.inputs.num_threads = 1

examples/rsfmri_vol_surface_preprocessing_nipy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def create_reg_workflow(name='registration'):
482482
warpmean.inputs.input_image_type = 3
483483
warpmean.inputs.interpolation = 'Linear'
484484
warpmean.inputs.invert_transform_flags = [False, False]
485-
warpmean.inputs.terminal_output = 'file'
485+
warpmean.terminal_output = 'file'
486486
warpmean.inputs.args = '--float'
487487
warpmean.inputs.num_threads = 4
488488
warpmean.plugin_args = {'sbatch_args': '-c%d' % 4}
@@ -704,7 +704,7 @@ def merge_files(in1, in2):
704704
warpall.inputs.input_image_type = 3
705705
warpall.inputs.interpolation = 'Linear'
706706
warpall.inputs.invert_transform_flags = [False, False]
707-
warpall.inputs.terminal_output = 'file'
707+
warpall.terminal_output = 'file'
708708
warpall.inputs.reference_image = target_file
709709
warpall.inputs.args = '--float'
710710
warpall.inputs.num_threads = 2

nipype/interfaces/afni/preprocess.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,13 +1872,10 @@ class ROIStatsInputSpec(CommandLineInputSpec):
18721872
desc='execute quietly',
18731873
argstr='-quiet',
18741874
position=1)
1875-
terminal_output = traits.Enum(
1876-
'allatonce',
1875+
terminal_output = traits.Enum('allatonce', deprecated='1.0.0',
18771876
desc='Control terminal output:`allatonce` - waits till command is '
18781877
'finished to display output',
1879-
nohash=True,
1880-
mandatory=True,
1881-
usedefault=True)
1878+
nohash=True)
18821879

18831880

18841881
class ROIStatsOutputSpec(TraitedSpec):
@@ -1907,6 +1904,7 @@ class ROIStats(AFNICommandBase):
19071904
19081905
"""
19091906
_cmd = '3dROIstats'
1907+
_terminal_output = 'allatonce'
19101908
input_spec = ROIStatsInputSpec
19111909
output_spec = ROIStatsOutputSpec
19121910

0 commit comments

Comments
 (0)