参数化计算机断层成像模拟器

tomograph的Python项目详细描述


断层摄影-参数化计算机断层摄影模拟器

Build Statuscodecov

tomograph是一个参数化的计算机断层成像模拟器,它可以作为 一个独立的脚本或作为模块包含在python程序中。它 实现radon和reverse radon转换。它目前有两种型号 光束投影类型:圆锥和平行。

依赖关系

当前tomograph需要:

  • 单击(click
  • tqdm(tqdm
  • numpy(numpy
  • 图像处理科学工具包(scikit-image

它们各自所需的版本可以在requirements.txt文件中看到。

安装

只需运行:

pip install tomograph

tomograph支持python 3.5、python3.6和python3.7。

用法

tomograph可以直接通过命令行界面使用,也可以作为python使用 模块:

命令行

使用命令行界面:

tomograph --model cone --detectors 256 --angle 150 --rotations 512 image.jpg

所有命令行参数都可以通过运行:

tomograph --help

模块

使用锥束模型进行radon变换的示例脚本:

from skimage.io import imsave
from tomograph.model import ConeTomograph

# variables
path = 'image.jpg'
detectors = 256
angle = 180
rotations = 512

# one scan per rotation
step = 360 / rotations

# perform Radon transform
tomograph = ConeTomograph(path, detectors, angle)
sinogram = []
for i in range(rotations):
    tomograph.rotate(step)  # rotate tomograph
    scan = tomograph.scan() # do the scan
    sinogram.append(scan)

imsave('radon.bmp', np.array(sinogram).T)

现场演示

Beam linesRadon transformreverse Radon transform
beam linesradon transformreverse radon transform

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java无法启动应用程序:JNLP错误   java根据用户输入在PreparedStatement中使用setTime()或setNull()   java EJB与同步   java以object为键通过hashmap进行搜索   java中的模10^9+7   针对包含其他对象的对象的java OOP最佳实践   如何将字符串作为HTML代码从Java文件读取到JSP页面?   java我的POM怎么了?“解析表达式..检测到递归表达式循环”   用于Hbase的Mapreduce的java NoSuchMethodError   JAVAlang.SecurityException:权限拒绝:启动意图{act=安卓.Intent.action.MAIN cat=[安卓.Intent.category.LAUNCHER]   数组初始化谜语Java   通过arraylist搜索时的java句柄关联