RTK(The Reconstruction ToolKit)在Windows系统下的安装

RTK是基于ITK开发的一款开源包,主要是为了解决CT图像的重建问题,适用于常规CT/ fan-beam CT/ CBCT。

RTK使用C++作为底层语言,尽管现在也已经提供了Python接口,但并没有将所有功能都提供,有时候还是需要完整安装RTK,并以.exe的形式运行。尽管个人觉得RTK在CT重建中很强大,但因为不像numpy那种大众的库,还是花了很多时间看ITK的manual和各种资料,特总结备份 。

RTK在Windows下的安装

准备工作

从Github网站clone ITK源码。
下载CMake
下载Visual Studio
个人目前使用CMake3.18.0和VS2019版本。

一些功能(如rtkextractshroudsignal)需要用到傅里叶变换,因此可能ITK还需要与FFTW共同使用,参考另一篇文章,可以从FFTW官网下载Precompiled DLLs.

开始安装

  1. 如果要使用FFTW:

从FFTW下载压缩包,e.g. 64-bit version: fftw-3.3.5-dll64.zip 之后,解压到任意路径下(不要放在ITK source code下,可能会出一些bug)。从开始菜单打开VS的命令框,

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
Here is an example code of using Reconstruction toolkit (RTK) to perform Monte Carlo simulation for X-ray CT imaging: ```python import rtk # Set up simulation parameters source_position = [0, 0, 1000] # Source position in mm detector_position = [0, 0, -1000] # Detector position in mm detector_size = [512, 512] # Detector size in pixels pixel_size = [0.5, 0.5] # Pixel size in mm projection_number = 360 # Number of projections projection_angles = rtk.linspace(0, 360, projection_number, endpoint=False) # Projection angles in degrees energy_spectrum = rtk.energy_spectrum('120kVp') # X-ray energy spectrum # Set up phantom and attenuation model phantom = rtk.shepp_logan_3d((512, 512, 512), (256, 256, 256)) attenuation_model = rtk.standard_attenuation_model('water', energy_spectrum) # Generate photon transport parameters using Monte Carlo simulation params = rtk.photon_transport_parameters(energy_spectrum, attenuation_model) # Simulate projections projections = rtk.simulate_projections(phantom, source_position, detector_position, detector_size, pixel_size, projection_angles, params) # Reconstruct image using FDK algorithm reconstruction = rtk.fdk(projections, projection_angles, detector_position, detector_size, pixel_size) # Display results rtk.imshow(projections) rtk.imshow(reconstruction) ``` This code simulates X-ray CT projections using a Shepp-Logan phantom and a water attenuation model at 120 kVp X-ray energy. Monte Carlo simulation is used to generate photon transport parameters. The simulated projections are then reconstructed using the FDK algorithm. The results are displayed using RTK's built-in image display functions.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值