通过Python 10在Windows 10上的FSL中使用BET时"command 'bet' could not be found on host"错误 3.5



我需要在.nii图像上执行大脑提取。我在Windows 10上使用Anaconda,并具有基于Python 3.5.4的环境。在NIPYPE上,我找到了FSL的赌注,我遵循了代码:

mybet = fsl.BET()
mybet.inputs.in_file = 'example.nii'
mybet.inputs.out_file = 'example_bet.nii' 
result = mybet.run()

请注意,我希望输出文件example_bet.nii由FSL.BET创建,而不是覆盖图像。我只能基于UNIX系统找到解决方案,似乎需要在基于UNIX的OS上安装FSL,这是在Windows中没有虚拟机的情况下,这是不可能的。好吧,这是我得到的输出:

171122-12:02:48,988 interface WARNING:
     FSLOUTPUTTYPE environment variable is not set. Setting FSLOUTPUTTYPE=NIFTI
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-12-5b900fbd5263> in <module>()
      2 mybet.inputs.in_file = 'prova.nii'
      3 mybet.inputs.out_file = 'prova_bet.nii'
----> 4 result = mybet.run()
~Anaconda3envstensorflowlibsite-packagesnipypeinterfacesbase.py in run(self, **inputs)
   1079                         version=self.version)
   1080         try:
-> 1081             runtime = self._run_wrapper(runtime)
   1082             outputs = self.aggregate_outputs(runtime)
   1083             runtime.endTime = dt.isoformat(dt.utcnow())
~Anaconda3envstensorflowlibsite-packagesnipypeinterfacesbase.py in _run_wrapper(self, runtime)
   1722 
   1723     def _run_wrapper(self, runtime):
-> 1724         runtime = self._run_interface(runtime)
   1725         return runtime
   1726 
~Anaconda3envstensorflowlibsite-packagesnipypeinterfacesfslpreprocess.py in _run_interface(self, runtime)
    142         # in stderr and if it's set, then update the returncode
    143         # accordingly.
--> 144         runtime = super(BET, self)._run_interface(runtime)
    145         if runtime.stderr:
    146             self.raise_exception(runtime)
~Anaconda3envstensorflowlibsite-packagesnipypeinterfacesbase.py in _run_interface(self, runtime, correct_return_codes)
   1748         if not exist_val:
   1749             raise IOError("command '%s' could not be found on host %s" %
-> 1750                           (self.cmd.split()[0], runtime.hostname))
   1751         setattr(runtime, 'command_path', cmd_path)
   1752         setattr(runtime, 'dependencies', get_dependencies(executable_name,
OSError: command 'bet' could not be found on host DESKTOP-MYPC
Interface BET failed to run. 

我需要切换到Linux还是有办法解决?

您只能通过Docker,Virtual Machine或Windows子系统在Windows上使用FSL进行Linux。无法天真地运行它。

相关内容

最新更新