Expand description
tpt-sci-image — 2-D tomographic reconstruction built from scratch.
This crate implements the core of parallel-beam computed tomography on top
of the in-house tpt-math substrate:
radon_transform— the forward Radon transform (a sinogram).filtered_back_projection— the classic ram-lak filtered back projection (FBP) inverse.
The same machinery is extended to volumes in the volume module:
volume::radon_transform_3d and volume::filtered_back_projection_3d
reconstruct a volume::Volume (a n_x × n_y × n_z scalar field) under a
parallel-beam geometry that rotates about the z axis.
Everything is hand-rolled: rotations/interpolation are done by coordinate
remapping with bilinear sampling, and the ramp filter lives in the Fourier
domain via tpt_math_signal_fft. There are no external image or
tomography dependencies.
§Examples
use tpt_sci_image::{linspace, radon_transform};
use tpt_math_linalg::tpt_math_linalg_dense::DMatrix;
// A 4x4 image with a single bright pixel at the centre.
let image = DMatrix::from_fn(4, 4, |i, j| if i == 1 && j == 1 { 1.0 } else { 0.0 });
let angles = linspace(0.0, std::f64::consts::PI, 8);
let sinogram = radon_transform(&image, &angles).unwrap();
// The sinogram has one row per angle and one column per detector bin.
assert_eq!(sinogram.nrows(), 8);
assert_eq!(sinogram.ncols(), 4);Re-exports§
pub use error::ImageError;pub use volume::Volume;pub use volume::filtered_back_projection_3d;pub use volume::radon_transform_3d;pub use cone_beam::ConeBeamGeometry;pub use cone_beam::cone_beam_forward_projection;pub use cone_beam::fdk_reconstruction;
Modules§
- cone_
beam - General cone-beam (divergent source) forward/back-projection geometry and
the Feldkamp-Davis-Kress (FDK) reconstruction, alongside (not replacing)
the parallel-beam
volumemodule. General cone-beam (divergent point-source) acquisition geometry and the Feldkamp-Davis-Kress (FDK) reconstruction. - error
- Errors returned by the image reconstruction API.
Errors for the
tpt-sci-imagecrate. - volume
- 3-D tomographic reconstruction (parallel-beam volume CT). 3-D tomographic reconstruction: parallel-beam computed tomography of a volume.
Functions§
- filtered_
back_ projection - Filtered back-projection (FBP) reconstruction from a sinogram.
- linspace
- Build an inclusive linearly-spaced vector of
npoints fromstarttoend. - naive_
back_ projection - Unfiltered (naive) back-projection of a sinogram.
- radon_
transform - Forward Radon transform (parallel beam) of
imageoverangles.