ASTRA Toolbox 代码问题

在尝试使用astra库进行图像重建过程中,创建算法对象时发生错误。代码包括创建几何对象、投影几何以及数据对象,然后配置并尝试创建FP算法,但遇到了UnabletoinitializeAlgorithm的问题。
摘要由CSDN通过智能技术生成

# 创建一个几何对象
vol_geom=astra.create_vol_geom(128,128)

# 创建一个投影几何
angles=np.linspace(0,2*np.pi,360,endpoint=False)

det_width=200

det_count=200

source_origin=200

origin_det=200


proj_geom=astra.create_proj_geom('fanflat',det_width,det_count,angles,source_origin,origin_det)

# 创建一个投影数据对象
proj_id=astra.data2d.create('-sino',proj_geom)

# 计算投影数据
vol_id=astra.data2d.create('-vol',vol_geom)

#创建算法对象
alg_cfg = astra.astra_dict('FP')
alg_cfg['ProjectionDataId'] = proj_id
alg_cfg['VolumeDataId'] = vol_id
alg_id = astra.algorithm.create(alg_cfg)
astra.algorithm.run(alg_id)

在创建算法对象这一步出错,以下是提示的错误信息

---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
Cell In[67], line 4
      2 alg_cfg['ProjectionDataId'] = proj_id
      3 alg_cfg['VolumeDataId'] = vol_id
----> 4 alg_id = astra.algorithm.create(alg_cfg)
      5 astra.algorithm.run(alg_id)

File E:\ProgramData\Anaconda3\envs\test01\lib\site-packages\astra\algorithm.py:36, in create(config)
     28 def create(config):
     29     """Create algorithm object.
     30     
     31     :param config: Algorithm options.
   (...)
     34     
     35     """
---> 36     return a.create(config)

File astra\algorithm_c.pyx:68, in astra.algorithm_c.create()

Exception: Unable to initialize Algorithm.

有没有大神教教我怎么弄

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值