Skip to content

Commit bb68793

Browse files
authored
Merge pull request #2909 from gpiantoni/master
FIX: parsing of filename in AlignEpiAnatPy when filename does not have +
2 parents ba34191 + e384080 commit bb68793

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,17 @@ class AlignEpiAnatPy(AFNIPythonCommand):
168168

169169
def _list_outputs(self):
170170
outputs = self.output_spec().get()
171-
anat_prefix = ''.join(
172-
self._gen_fname(self.inputs.anat).split('+')[:-1])
173-
epi_prefix = ''.join(
174-
self._gen_fname(self.inputs.in_file).split('+')[:-1])
171+
anat_prefix = self._gen_fname(self.inputs.anat)
172+
epi_prefix = self._gen_fname(self.inputs.in_file)
173+
if '+' in anat_prefix:
174+
anat_prefix = ''.join(anat_prefix.split('+')[:-1])
175+
if '+' in epi_prefix:
176+
epi_prefix = ''.join(epi_prefix.split('+')[:-1])
175177
outputtype = self.inputs.outputtype
176178
if outputtype == 'AFNI':
177179
ext = '.HEAD'
178180
else:
179-
Info.output_type_to_ext(outputtype)
181+
ext = Info.output_type_to_ext(outputtype)
180182
matext = '.1D'
181183
suffix = self.inputs.suffix
182184
if self.inputs.anat2epi:

nipype/interfaces/afni/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class AFNItoNIFTI(AFNICommand):
143143
input_spec = AFNItoNIFTIInputSpec
144144
output_spec = AFNICommandOutputSpec
145145

146-
def _overload_extension(self, value):
146+
def _overload_extension(self, value, name=None):
147147
path, base, ext = split_filename(value)
148148
if ext.lower() not in ['.nii', '.nii.gz', '.1d', '.1D']:
149149
ext += '.nii'

0 commit comments

Comments
 (0)