Description
Summary
When running freesurfer's MNIBiasCorrection in a workflow, it rasies an error if out_file is undefined. I believe if out_file is undefined, the output filename should have been something like 'subject_id_nucorrect.nii.gz' rather than raising an error.
Actual behavior
Node inputs:
args =
distance =
environ = {u'SUBJECTS_DIR': '/Applications/freesurfer/subjects'}
ignore_exception = False
in_file = /Users/xxx/Documents/xxx/xxx_1.nii.gz
iterations = 1
mask =
no_rescale =
out_file =
protocol_iterations =
shrink =
stop =
subjects_dir = /Applications/freesurfer/subjects
terminal_output = stream
transform =
Traceback:
Traceback (most recent call last):
File "/Users/xxx/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 52, in run_node
result['result'] = node.run(updatehash=updatehash)
File "/Users/xxx/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 366, in run
self._run_interface()
File "/Users/xxx/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 476, in _run_interface
self._result = self._run_command(execute)
File "/Users/xxx/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 607, in _run_command
result = self._interface.run()
File "/Users/xxx/anaconda/lib/python2.7/site-packages/nipype/interfaces/freesurfer/base.py", line 126, in run
return super(FSCommand, self).run(**inputs)
File "/Users/xxx/anaconda/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1086, in run
outputs = self.aggregate_outputs(runtime)
File "/Users/xxx/anaconda/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1157, in aggregate_outputs
predicted_outputs = self._list_outputs()
File "/Users/xxx/anaconda/lib/python2.7/site-packages/nipype/interfaces/freesurfer/preprocess.py", line 1437, in _list_outputs
outputs["out_file"] = os.path.abspath(self.inputs.out_file)
File "/Users/xxx/anaconda/lib/python2.7/posixpath.py", line 360, in abspath
if not isabs(path):
File "/Users/xxx/anaconda/lib/python2.7/posixpath.py", line 54, in isabs
return s.startswith('/')
AttributeError: '_Undefined' object has no attribute 'startswith'
Interface MNIBiasCorrection failed to run.
Temporary Solution
Defining out_file = 'corrected.nii.gz' solved the problem, at the cost of losing identity information supplied from the input filename.
This problem occurs in other freesurfer interface in nipype as well, e.g. freesurfer.Normalize().
I think this is the same issue as #383. Would it be possible to fix it and check if this is some thing common in the freesurfer interfaces? Thanks very much!