Skip to main content

Parametrized computer tomography simulator

Project description

tomograph - paramterized computer tomography simulator

Build Status codecov

tomograph is a parametrized computer tomography simulator, which can be run as a standalone script or included as a module in your Python programs. It implements both Radon and reverse Radon transforms. It currently models two types of beam projections: cone and parallel.

Dependencies

Currently tomograph requires:

  • Click (click)
  • tqdm (tqdm)
  • NumPy (numpy)
  • Image Processing SciKit (scikit-image)

Their respective required versions can be seen in requirements.txt file.

Installation

Simply run:

pip install tomograph

Tomograph supports Python 3.5, Python 3.6 and Python 3.7.

Usage

tomograph can be used directly through command-line interface or as a Python module:

Commandline

Using command-line interface:

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

All command-line arguments can be seen by running:

tomograph --help

Module

Example script that does Radon transform using cone beam model:

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)

Live demonstration

Beam lines Radon transform reverse Radon transform
beam lines radon transform reverse radon transform

Project details


Release history Release notifications

This version
History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
tomograph-0.1.tar.gz (4.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page