Skip to content

FIX: parsing of filename in AlignEpiAnatPy when filename does not have + #2909

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 2 commits into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions nipype/interfaces/afni/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,17 @@ 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'
else:
Info.output_type_to_ext(outputtype)
ext = Info.output_type_to_ext(outputtype)
matext = '.1D'
suffix = self.inputs.suffix
if self.inputs.anat2epi:
Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/afni/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down