Skip to content

Commit 04d8e0e

Browse files
authored
Merge pull request #2334 from mvdoc/afni/deconvolve
FIX: some fixes to afni.Deconvolve
2 parents 46e4009 + 4798ba2 commit 04d8e0e

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

.zenodo.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,11 @@
516516
{
517517
"name": "Flandin, Guillaume"
518518
},
519+
{
520+
"affiliation": "Dartmouth College",
521+
"name": "Visconti di Oleggio Castello, Matteo",
522+
"orcid": "0000-0001-7931-5272"
523+
},
519524
{
520525
"affiliation": "CEA",
521526
"name": "Papadopoulos Orfanos, Dimitri",

nipype/interfaces/afni/model.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
3636
argstr='-input %s',
3737
copyfile=False,
3838
sep=" ",
39-
position=0)
39+
position=1)
4040
sat = traits.Bool(
4141
desc='check the dataset time series for initial saturation transients,'
4242
' which should normally have been excised before data analysis.',
@@ -57,10 +57,11 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
5757
'* If the auto-catenation feature isn\'t used, then this option '
5858
'has no effect, no how, no way.',
5959
argstr='-noblock')
60-
force_TR = traits.Int(
60+
force_TR = traits.Float(
6161
desc='use this value instead of the TR in the \'input\' '
62-
'dataset. (It\'s better to fix the input using Refit.)',
63-
argstr='-force_TR %d')
62+
'dataset. (It\'s better to fix the input using Refit.)',
63+
argstr='-force_TR %f',
64+
position=0)
6465
input1D = File(
6566
desc='filename of single (fMRI) .1D time series where time runs down '
6667
'the column.',
@@ -294,7 +295,11 @@ def _list_outputs(self):
294295

295296
outputs['reml_script'] = self._gen_fname(
296297
suffix='.REML_cmd', **_gen_fname_opts)
297-
outputs['out_file'] = os.path.abspath(self.inputs.out_file)
298+
# remove out_file from outputs if x1d_stop set to True
299+
if self.inputs.x1D_stop:
300+
del outputs['out_file']
301+
else:
302+
outputs['out_file'] = os.path.abspath(self.inputs.out_file)
298303

299304
return outputs
300305

nipype/interfaces/afni/tests/test_auto_Deconvolve.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ def test_Deconvolve_inputs():
1818
nohash=True,
1919
usedefault=True,
2020
),
21-
force_TR=dict(argstr='-force_TR %d', ),
21+
force_TR=dict(
22+
argstr='-force_TR %f',
23+
position=0,
24+
),
2225
fout=dict(argstr='-fout', ),
2326
global_times=dict(
2427
argstr='-global_times',
@@ -42,7 +45,7 @@ def test_Deconvolve_inputs():
4245
in_files=dict(
4346
argstr='-input %s',
4447
copyfile=False,
45-
position=0,
48+
position=1,
4649
sep=' ',
4750
),
4851
input1D=dict(argstr='-input1D %s', ),
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""Test afni deconvolve"""
2+
3+
from ..model import Deconvolve
4+
5+
def test_x1dstop():
6+
deconv = Deconvolve()
7+
deconv.inputs.out_file = 'file.nii'
8+
assert 'out_file' in deconv._list_outputs()
9+
deconv.inputs.x1D_stop = True
10+
assert not 'out_file' in deconv._list_outputs()

0 commit comments

Comments
 (0)