FBP Overview

This example illustrates how to perform filtered back-projection (FBP) image reconstruction in CT using the Julia language.

This entire page was generated using a single Julia file: 1-fbp.jl. In any such Julia documentation, you can access the source code using the "Edit on GitHub" link in the top right.

The corresponding notebook can be viewed in nbviewer here: 1-fbp.ipynb, and opened in binder here: 1-fbp.ipynb,

This is under construction.

First we add the Julia packages that are need for these examples. Change false to true in the following code block if you are using any of the following packages for the first time.

if false
    import Pkg
    Pkg.add([
        "ImagePhantoms"
        "Plots"
        "Unitful"
        "UnitfulRecipes"
        "LaTeXStrings"
        "MIRTjim"
        "MIRT"
        "Sinograms"
        "InteractiveUtils"
    ])
end

Now tell this Julia session to use the following packages for this example. Run Pkg.add() in the preceding code block first, if needed.

using ImagePhantoms: shepplogan, SheppLogan, radon, phantom using Plots; default(label="", markerstrokecolor=:auto) using Unitful: mm using UnitfulRecipes using LaTeXStrings using MIRT: difflmap, ncg using Sinograms: todo

using MIRTjim: jim, prompt
using InteractiveUtils: versioninfo

The following line is helpful when running this jl-file as a script; this way it will prompt user to hit a key after each image is displayed.

isinteractive() && jim(:prompt, true);
isinteractive() && prompt();

Get the ellipse parameters for a CT-suitable version of the Shepp-Logan phantom and calculate (analytically) its sinogram.

if false object = shepplogan(SheppLogan(); fovs=(FOV,FOV)) sino = radon(object).(r,ϕ') data = data / oneunit(eltype(data)) # abandon units at this point jim(kr, kϕ, abs.(data), title="k-space data magnitude", xlabel=L"kr", ylabel=L"k{\phi}", xticks = (-1:1) .* maximum(abs, kr), yticks = (0,π), ylims = (0,π), aspectratio = :none, ) end

Reproducibility

This page was generated with the following version of Julia:

io = IOBuffer()
versioninfo(io)
split(String(take!(io)), '\n')
9-element Vector{SubString{String}}:
 "Julia Version 1.7.1"
 "Commit ac5cc99908 (2021-12-22 19:35 UTC)"
 "Platform Info:"
 "  OS: Linux (x86_64-pc-linux-gnu)"
 "  CPU: Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz"
 "  WORD_SIZE: 64"
 "  LIBM: libopenlibm"
 "  LLVM: libLLVM-12.0.1 (ORCJIT, skylake-avx512)"
 ""

And with the following package versions

import Pkg; Pkg.status()
      Status `~/work/Examples/Examples/docs/Project.toml`
  [e30172f5] Documenter v0.27.10
  [940e8692] Examples v0.0.1 `~/work/Examples/Examples`
  [7a1cc6ca] FFTW v1.4.5
  [9ee76f2b] ImageGeoms v0.4.0
  [71a99df6] ImagePhantoms v0.0.7
  [b964fa9f] LaTeXStrings v1.3.0
  [599c1a8e] LinearMapsAA v0.7.1
  [98b081ad] Literate v2.9.4
  [7035ae7a] MIRT v0.15.0
  [170b2178] MIRTjim v0.15.1
  [efe261a4] NFFT v0.6.2
  [91a5bcdd] Plots v1.25.4
  [2913bbd2] StatsBase v0.33.14
  [1986cc42] Unitful v1.10.0
  [42071c24] UnitfulRecipes v1.5.3
  [b77e0a4c] InteractiveUtils
  [37e2e46d] LinearAlgebra
  [44cfe95a] Pkg
  [9a3f8284] Random

This page was generated using Literate.jl.