Open
Description
fsl.MotionOutliers throws a FileNotFoundError regarding a file in a temporary directory when inputs.threshold is set to a specific value. When inputs.threshold is not set, it runs just fine. This behavior persists for different values of inputs.metric.
Simple example:
from nipype.interfaces import fsl
from nipype import Node
import os
# Works
epi_path = 'my_epi.nii'
motion_assess = Node(fsl.MotionOutliers(), name='motion_assess')
motion_assess.inputs.in_file = os.path.abspath(epi_path)
motion_assess.inputs.metric = 'fd'
#motion_assess.inputs.threshold = 0.9
motion_assess.run()
# Doesn't work
epi_path = 'my_epi.nii'
motion_assess = Node(fsl.MotionOutliers(), name='motion_assess')
motion_assess.inputs.in_file = os.path.abspath(epi_path)
motion_assess.inputs.metric = 'fd'
motion_assess.inputs.threshold = 0.9
motion_assess.run()
Here is the traceback:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-56-1bab1371cb85> in <module>()
6 motion_assess.inputs.metric = 'fd'
7 motion_assess.inputs.threshold = 0.9
----> 8 motion_assess.run()
/usr/local/lib/python2.7/site-packages/nipype/pipeline/engine.pyc in run(self, updatehash)
1426 self.inputs.get_traitsfree())
1427 try:
-> 1428 self._run_interface()
1429 except:
1430 os.remove(hashfile_unfinished)
/usr/local/lib/python2.7/site-packages/nipype/pipeline/engine.pyc in _run_interface(self, execute, updatehash)
1536 old_cwd = os.getcwd()
1537 os.chdir(self.output_dir())
-> 1538 self._result = self._run_command(execute)
1539 os.chdir(old_cwd)
1540
/usr/local/lib/python2.7/site-packages/nipype/pipeline/engine.pyc in _run_command(self, execute, copyfiles)
1662 logger.info('Running: %s' % cmd)
1663 try:
-> 1664 result = self._interface.run()
1665 except Exception, msg:
1666 self._result.runtime.stderr = msg
/usr/local/lib/python2.7/site-packages/nipype/interfaces/base.pyc in run(self, **inputs)
1032 try:
1033 runtime = self._run_wrapper(runtime)
-> 1034 outputs = self.aggregate_outputs(runtime)
1035 runtime.endTime = dt.isoformat(dt.utcnow())
1036 timediff = parseutc(runtime.endTime) - parseutc(runtime.startTime)
/usr/local/lib/python2.7/site-packages/nipype/interfaces/base.pyc in aggregate_outputs(self, runtime, needed_outputs)
1126 msg = ("File/Directory '%s' not found for %s output "
1127 "'%s'." % (val, self.__class__.__name__, key))
-> 1128 raise FileNotFoundError(msg)
1129 else:
1130 raise error
FileNotFoundError: File/Directory '/private/var/folders/q4/_36dqfr17d92b3hxw01gbphm0000gn/T/tmpySfAEO/motion_assess/my_epi_outliers.txt' not found for MotionOutliers output 'out_file'.
Interface MotionOutliers failed to run.
I'm running Mac OS 10.9.5, with FSL version 5.0.9.
nipype.get_info() output:
{'commit_hash': '7c7b0a7',
'commit_source': 'repository',
'networkx_version': '1.11',
'nibabel_version': '2.0.2',
'numpy_version': '1.11.0',
'pkg_path': '/usr/local/lib/python2.7/site-packages/nipype',
'scipy_version': '0.17.0',
'sys_executable': '/usr/local/opt/python/bin/python2.7',
'sys_platform': 'darwin',
'sys_version': '2.7.11 (default, Dec 5 2015, 22:44:43) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]',
'traits_version': '4.5.0'}