首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过Python3.5在Windows 10上使用BET时,“在主机上找不到命令‘打赌’”错误

通过Python3.5在Windows 10上使用BET时,“在主机上找不到命令‘打赌’”错误
EN

Stack Overflow用户
提问于 2017-11-22 21:40:47
回答 1查看 777关注 0票数 0

我需要在.nii图像上做大脑提取。我在Windows 10上使用Anaconda,并且有一个基于Python3.5.4的环境。在Nipype上,我从FSL中找到了BET,我遵循了代码:

代码语言:javascript
复制
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的操作系统上安装FSL,这在Windows中没有虚拟机是不可能的。嗯,这是我得到的输出:

代码语言:javascript
复制
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()

~\Anaconda3\envs\tensorflow\lib\site-packages\nipype\interfaces\base.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())

~\Anaconda3\envs\tensorflow\lib\site-packages\nipype\interfaces\base.py in _run_wrapper(self, runtime)
   1722 
   1723     def _run_wrapper(self, runtime):
-> 1724         runtime = self._run_interface(runtime)
   1725         return runtime
   1726 

~\Anaconda3\envs\tensorflow\lib\site-packages\nipype\interfaces\fsl\preprocess.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)

~\Anaconda3\envs\tensorflow\lib\site-packages\nipype\interfaces\base.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,还是有办法绕过它?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-11-23 01:31:32

您只能通过Docker虚拟机Linux下的Windows子系统在Windows上使用FSL。天真地运行是不可能的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47444272

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档