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

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如何抑制JDBC SQLWarnings?   swing如何在Java中定位两个对角的JPanel?   java有一个好的设计模式:common方法有一个超类param,但包含对子类中可用方法的调用(因此需要强制转换)   java使用OAuth 2.0 for Google从电子表格中获取数据   java如何设置自定义按钮的单击侦听器?   eclipse为了使结果正确,我需要使用double而不是int。为什么?(爪哇)   房间数据库的java删除方法不起作用   java加速输出图像   java Appium IOS测试在手动启动服务器时运行,但在通过AppiumDriverLocalService启动服务器时不运行   动态加载的JDBC驱动程序的java提取版本   java spring mvc占位符未使用<spring:input>标记打印   java的主要活动。xml内容显示NavigationDrawer的前面   java从Web服务下载的音频质量不够好   java创建文件的最简单方法是什么?   c#在Xamarin上使用此java代码   java Unicenta密码加密   Java语言中的python元组   Java在进入数据库之前缓存数据   使用另一个类在ArrayList中存储java对象