From 2b33d79e1a0921ebdac73046badd7d72825f5ca2 Mon Sep 17 00:00:00 2001 From: Elizabeth DuPre Date: Tue, 23 Jan 2018 11:52:31 -0500 Subject: [PATCH 1/2] Bug fixes for afni.model Patches cbucket output for 3dDeconvolve, correctly parses output of 3dSynthesize. --- nipype/interfaces/afni/model.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nipype/interfaces/afni/model.py b/nipype/interfaces/afni/model.py index 0d56f2dbb5..c17a50c51d 100644 --- a/nipype/interfaces/afni/model.py +++ b/nipype/interfaces/afni/model.py @@ -293,11 +293,14 @@ def _list_outputs(self): outputs['x1D'] = self._gen_fname( suffix='.xmat.1D', **_gen_fname_opts) + if isdefined(self.inputs.cbucket): + outputs['cbucket'] = os.path.abspath(self.inputs.cbucket) + outputs['reml_script'] = self._gen_fname( suffix='.REML_cmd', **_gen_fname_opts) # remove out_file from outputs if x1d_stop set to True if self.inputs.x1D_stop: - del outputs['out_file'] + del outputs['out_file'], outputs['cbucket'] else: outputs['out_file'] = os.path.abspath(self.inputs.out_file) @@ -652,3 +655,12 @@ class Synthesize(AFNICommand): _cmd = '3dSynthesize' input_spec = SynthesizeInputSpec output_spec = AFNICommandOutputSpec + + def _list_outputs(self): + outputs = self.output_spec().get() + + for key in outputs.keys(): + if isdefined(self.inputs.get()[key]): + outputs[key] = os.path.abspath(self.inputs.get()[key]) + + return outputs From dffae4fb8a6acb6d6bda52aa2a992fa5259e155b Mon Sep 17 00:00:00 2001 From: Elizabeth DuPre Date: Tue, 23 Jan 2018 18:55:22 -0500 Subject: [PATCH 2/2] Extend extra Deconvolve test --- nipype/interfaces/afni/tests/test_extra_Deconvolve.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nipype/interfaces/afni/tests/test_extra_Deconvolve.py b/nipype/interfaces/afni/tests/test_extra_Deconvolve.py index b80af90cf5..93adc3b748 100644 --- a/nipype/interfaces/afni/tests/test_extra_Deconvolve.py +++ b/nipype/interfaces/afni/tests/test_extra_Deconvolve.py @@ -7,4 +7,5 @@ def test_x1dstop(): 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() \ No newline at end of file + assert 'out_file' not in deconv._list_outputs() + assert 'cbucket' not in deconv._list_outputs()