From db623d6883b87464aae13695ef072ee3f416e19f Mon Sep 17 00:00:00 2001 From: Gio at UMCU Date: Fri, 5 Apr 2019 11:07:39 +0200 Subject: [PATCH 1/2] BUGFIX when filename does not have + --- nipype/interfaces/afni/preprocess.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 0ecbe4b347..91edbc1bfe 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -168,10 +168,12 @@ class AlignEpiAnatPy(AFNIPythonCommand): def _list_outputs(self): outputs = self.output_spec().get() - anat_prefix = ''.join( - self._gen_fname(self.inputs.anat).split('+')[:-1]) - epi_prefix = ''.join( - self._gen_fname(self.inputs.in_file).split('+')[:-1]) + anat_prefix = self._gen_fname(self.inputs.anat) + epi_prefix = self._gen_fname(self.inputs.in_file) + if '+' in anat_prefix: + anat_prefix = ''.join(anat_prefix.split('+')[:-1]) + if '+' in epi_prefix: + epi_prefix = ''.join(epi_prefix.split('+')[:-1]) outputtype = self.inputs.outputtype if outputtype == 'AFNI': ext = '.HEAD' From e3840805ff7d862227293e8fd7fa7e312dddeba4 Mon Sep 17 00:00:00 2001 From: Gio at UMCU Date: Fri, 5 Apr 2019 13:29:22 +0200 Subject: [PATCH 2/2] match _overload_extension in AFNItoNIFTI --- nipype/interfaces/afni/preprocess.py | 2 +- nipype/interfaces/afni/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 91edbc1bfe..c2ccb1988a 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -178,7 +178,7 @@ def _list_outputs(self): if outputtype == 'AFNI': ext = '.HEAD' else: - Info.output_type_to_ext(outputtype) + ext = Info.output_type_to_ext(outputtype) matext = '.1D' suffix = self.inputs.suffix if self.inputs.anat2epi: diff --git a/nipype/interfaces/afni/utils.py b/nipype/interfaces/afni/utils.py index 3cb8d5f69e..5fe3e199ec 100644 --- a/nipype/interfaces/afni/utils.py +++ b/nipype/interfaces/afni/utils.py @@ -143,7 +143,7 @@ class AFNItoNIFTI(AFNICommand): input_spec = AFNItoNIFTIInputSpec output_spec = AFNICommandOutputSpec - def _overload_extension(self, value): + def _overload_extension(self, value, name=None): path, base, ext = split_filename(value) if ext.lower() not in ['.nii', '.nii.gz', '.1d', '.1D']: ext += '.nii'