Digitally reconstructed radiographs (DRR) are simulated projectional radiographs generated from volumetric CT imaging data. This package provides parallelized, GPU-accelerated, and differentiable DRR generators in Julia.
Read the CT volume data and define the camera/detector geometry:
# Read the DICOM file
volume, ΔX, ΔY, ΔZ = read_dicom("../data/cxr"; pad=true)
grid = volume2grid(volume, ΔX, ΔY, ΔZ) # The bottom-left corner of the CT is placed at (0,0,0)
# Define the camera
center = Vec3(180., 180., -100)
camera = Camera(center)
# Define the detector plane
center = Vec3(180., 180., 500.)
normal = Vec3(0., 0., -1.)
height, width = 601, 601
Δx, Δy = 2., 2.
detector = Detector(center, normal, height, width, Δx, Δy)
To generate a DRR using this setup, run
julia> spacing = 0.5
julia> drr = make_drr(grid, volume, camera, detector, spacing)
julia> heatmap(drr, c=:grays)
which generates the following projection: