ImagePhantoms.jl Documentation
Overview
This Julia package ImagePhantoms provides tools for constructing digital software "phantoms" used for testing image reconstruction algorithms. The most famous such phantom is the "Shepp Logan" phantom from this 1974 paper. (A variant of that phantom serves as the logo for the JuliaImageRecon suite of tools.)
A phantom is a collection (iterable) of shapes (e.g., ellipses, rectangles). One purpose of this package is to avoid the inverse crime of using a discretized or sampled image to generate sinograms or spectra.
The shapes in this package have methods useful for simulating data:
phantomreturns a function of(x,y)or(x,y,z)that one can evaluate on a grid to make a pixelated or voxelized phantom.radonreturns a function of(r,ϕ)that one can evaluate on a grid to make a sampled 2D parallel-beam sinogram, or evaluate appropriately to make a sampled fan-beam sinogram. For 3D objects,radonreturns a function of(u,v,ϕ,θ)that one can evaluate to compute projection views. See the "3D geometry" example for description of the coordinate system.spectrumreturns a function of spatial frequencies that one can sample to simulate k-space data (e.g., in MRI).
See the Examples tab for details.
The Michigan Image Reconstruction Toolbox (MIRT) currently has an older interface ellipse_im, rect_im, etc., similar to the functions of the same name in the Matlab version of MIRT provided for backward compatibility. Using ImagePhantoms is recommended for Julia work.
Units
This package allows the shapes to be described with physical units, e.g., using Unitful.jl. Using units is recommended but not required. If units are not used explicitly, then the user must be especially careful to use values corresponding to consistent units. For example, if the shape sizes are in cm, then
- the arguments to
phantommust also be in cm units, - the first (
r) argument toradonmust also be in cm and theϕargument must be in radians, - the spatial frequency arguments to
spectrummust be in cycles/cm units.