Skip to content

FIX: some fixes to afni.Deconvolve #2334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jan 20, 2018
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,11 @@
{
"name": "Flandin, Guillaume"
},
{
"affiliation": "Dartmouth College",
"name": "Visconti di Oleggio Castello, Matteo",
"orcid": "0000-0001-7931-5272"
},
{
"affiliation": "CEA",
"name": "Papadopoulos Orfanos, Dimitri",
Expand Down
15 changes: 10 additions & 5 deletions nipype/interfaces/afni/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
argstr='-input %s',
copyfile=False,
sep=" ",
position=0)
position=1)
sat = traits.Bool(
desc='check the dataset time series for initial saturation transients,'
' which should normally have been excised before data analysis.',
Expand All @@ -57,10 +57,11 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
'* If the auto-catenation feature isn\'t used, then this option '
'has no effect, no how, no way.',
argstr='-noblock')
force_TR = traits.Int(
force_TR = traits.Float(
desc='use this value instead of the TR in the \'input\' '
'dataset. (It\'s better to fix the input using Refit.)',
argstr='-force_TR %d')
'dataset. (It\'s better to fix the input using Refit.)',
argstr='-force_TR %f',
position=0)
input1D = File(
desc='filename of single (fMRI) .1D time series where time runs down '
'the column.',
Expand Down Expand Up @@ -294,7 +295,11 @@ def _list_outputs(self):

outputs['reml_script'] = self._gen_fname(
suffix='.REML_cmd', **_gen_fname_opts)
outputs['out_file'] = os.path.abspath(self.inputs.out_file)
# remove out_file from outputs if x1d_stop set to True
if self.inputs.x1D_stop:
del outputs['out_file']
else:
outputs['out_file'] = os.path.abspath(self.inputs.out_file)

return outputs

Expand Down
7 changes: 5 additions & 2 deletions nipype/interfaces/afni/tests/test_auto_Deconvolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ def test_Deconvolve_inputs():
nohash=True,
usedefault=True,
),
force_TR=dict(argstr='-force_TR %d', ),
force_TR=dict(
argstr='-force_TR %f',
position=0,
),
fout=dict(argstr='-fout', ),
global_times=dict(
argstr='-global_times',
Expand All @@ -42,7 +45,7 @@ def test_Deconvolve_inputs():
in_files=dict(
argstr='-input %s',
copyfile=False,
position=0,
position=1,
sep=' ',
),
input1D=dict(argstr='-input1D %s', ),
Expand Down
10 changes: 10 additions & 0 deletions nipype/interfaces/afni/tests/test_extra_Deconvolve.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Test afni deconvolve"""

from ..model import Deconvolve

def test_x1dstop():
deconv = Deconvolve()
deconv.inputs.out_file = 'file.nii'
assert 'out_file' in deconv._list_outputs()
deconv.inputs.x1D_stop = True
assert not 'out_file' in deconv._list_outputs()