Skip to content
Merged
Changes from all commits
Commits
File filter

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: 6 additions & 6 deletions nipype/interfaces/spm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ class ApplyTransform(SPMCommand):

def _make_matlab_command(self, _):
"""checks for SPM, generates script"""
outputs = self._list_outputs()
self.inputs.out_file = outputs['out_file']
script = """
infile = '%s';
outfile = '%s'
Expand All @@ -168,16 +170,14 @@ def _make_matlab_command(self, _):
def _list_outputs(self):
outputs = self.output_spec().get()
if not isdefined(self.inputs.out_file):
_, name, _ = split_filename(self.inputs.in_file)
outputs['out_file'] = os.path.abspath(name + '_trans.nii')
outputs['out_file'] = os.path.abspath(self._gen_outfilename())
else:
outputs['out_file'] = os.path.abspath(self.inputs.out_file)
return outputs

def _gen_filename(self, name):
if name == 'out_file':
return self._list_outputs()[name]
return None
def _gen_outfilename(self):
_, name, _ = split_filename(self.inputs.in_file)
return name + '_trans.nii'

class ResliceInputSpec(SPMCommandInputSpec):
in_file = File( exists = True, mandatory=True,
Expand Down