Skip to main content

CT scan and Radon transform

Project description

FastCT: CT scan and Radon transform

scan(A):
  fast Radon transform
  A = image data (shape(n,n,...))
  return scanned image (shape(2n,n,4,...))
  n must be power of 2

BackScan(A):
  inverse fast Radon transform
  A = scanned and filtered data (shape(2n,n,4,...))
  return image restored from A (shape(n,n,...))
  n must be power of 2

filtering(A):
  apply high-pass filter along first axis
  A = scanned image (shape(:,:,...))
  return filtered image (same shape as A)

reconstruct(A):
  return BackScan(filtering(A))

stitch(A):
  stitch four quadrants of scanned data
  A = scanned image (shape(2n,n,4,...))
  return scanned image (shape(2n,4n,...))

RadonFromSinogram(A, n=None):
  A = scanned image (shape(N,M,...))
      first and second axis of A corresponds to r and
      theta coordinate of Radon Transform, respectively
      assume r uniformly increases in [0, sqrt(M*M+N*N)/2)
         theta uniformly increases in [0, pi)
  n = image size
  if n is None, n is set to N/2
  return scanned image (shape(2n,n,4,...))
         to be input to BackScan()

SinogramFromRadon(A, N=None, M=None):
  inverse of RadonFromSinogram
  if N is None, N is set to A.shape[1]*2
  if M is None, M is set to A.shape[1]*4

-------------------------------------------------------------
referece:
  M. L. Brady, "A Fast Discrete Approximation Algorithm for the
    Radon Transform" SIAM Journal on Computing 27 (1998) 107
  W. H. Press, "Dicrete Radon Transform has an Exact, Fast Inverse..."
    Proceedings of the National Academy of Sciences 103 (2006) 19249

example code:

import numpy as np
import matplotlib.pyplot as plt
from FastCT import scan,stitch,reconstruct

A = plt.imread('image.png')[:,:,0]
A = scan(A)
plt.imsave('scan.png', stitch(A), cmap='gray')
A = reconstruct(A)
plt.imsave('recon.png', A, cmap='gray')

Project details


Download files

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

Source Distribution

FastCT-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

FastCT-0.0.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file FastCT-0.0.1.tar.gz.

File metadata

  • Download URL: FastCT-0.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.3

File hashes

Hashes for FastCT-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3a1d7032ecc71f2adfdad6281f1ed759324c58b2a8aa75c7a18547482a1ffcda
MD5 c80fbe854821f7c1dff0fdcd0d135a8f
BLAKE2b-256 7ee81e09d1aa7dd813f06649aead37e8a1bdf2f94719b0773cb69dff697aad52

See more details on using hashes here.

File details

Details for the file FastCT-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: FastCT-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.3

File hashes

Hashes for FastCT-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0adccb4ee049c4967e1fe698c9fed79b6e528a9c32fa0fdd9c5e415aa7a9958b
MD5 5c6eb76c8086355539053cd7c659aa3e
BLAKE2b-256 750a40d0fdd5140bf8dc1ed88dd4c5833f52ee3497e4c7dae9df792f763e68f2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page