Skip to content

Absolute path for out_file in FSL, etc... #383

Closed
@swederik

Description

@swederik

So I know that forcing the out_file arguments to have an absolute path is a good idea, but I think we need to take care that we aren't running os.path.abspath() on undefined inputs. For example, I get the following error using FSL's FLIRT interface because the out_file argument is left undefined (will push a fix very shortly).

Traceback:
Traceback (most recent call last):
File "/home/admin1/Code/nipype/nipype/pipeline/plugins/multiproc.py", line 15, in run_node
result['result'] = node.run(updatehash=updatehash)
File "/home/admin1/Code/nipype/nipype/pipeline/engine.py", line 1128, in run
self._run_interface()
File "/home/admin1/Code/nipype/nipype/pipeline/engine.py", line 1226, in _run_interface
self._result = self._run_command(execute)
File "/home/admin1/Code/nipype/nipype/pipeline/engine.py", line 1340, in _run_command
cmd = self._interface.cmdline
File "/home/admin1/Code/nipype/nipype/interfaces/base.py", line 1047, in cmdline
allargs = self._parse_inputs()
File "/home/admin1/Code/nipype/nipype/interfaces/base.py", line 1196, in _parse_inputs
value = self._gen_filename(name)
File "/home/admin1/Code/nipype/nipype/interfaces/fsl/preprocess.py", line 489, in _gen_filename
return self._list_outputs()[name]
File "/home/admin1/Code/nipype/nipype/interfaces/fsl/preprocess.py", line 477, in _list_outputs
outputs['out_file'] = os.path.abspath(self.inputs.out_file)
File "/software/python/lib/python2.7/posixpath.py", line 343, in abspath
if not isabs(path):
File "/software/python/lib/python2.7/posixpath.py", line 53, in isabs
return s.startswith('/')
AttributeError: '_Undefined' object has no attribute 'startswith'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions