using Plots: plot, gui # these 2 must precede Sinograms for Requires to work! using Unitful: mm using Sinograms: SinoFanArc, rays, plan_fbp, fbp, sino_geom_plot! using ImageGeoms: ImageGeom, fovs, MaskCircle using ImagePhantoms: SheppLogan, shepp_logan, radon, phantom using MIRTjim: jim, prompt isinteractive() ? jim(:prompt, true) : prompt(:draw); ig = ImageGeom(MaskCircle(); dims=(128,126), deltas = (2mm,2mm) ) sg = SinoFanArc( :short, ; nb = 130, d = 3.2mm, na = 100, dsd = 400mm, dod = 140mm, ) jim(axes(ig), ig.mask; prompt=false) sino_geom_plot!(sg, ig) prompt() μ = 0.01 / mm # typical linear attenuation coefficient ob = shepp_logan(SheppLogan(); fovs = fovs(ig), u = (1, 1, μ)) sino = radon(rays(sg), ob) jim(axes(sg), sino; title="Shepp-Logan 'short' sinogram", xlabel="r", ylabel="ϕ") plan = plan_fbp(sg, ig) jim(axes(sg), plan.parker_weight; title = "Parker weights", xlabel="r", ylabel="ϕ") fbp_image, sino_filt = fbp(plan, sino); clim = (0.9, 1.1) .* μ jim(axes(ig), fbp_image, "FBP image for 'short' arc case"; clim) true_image = phantom(axes(ig)..., ob, 2) jim(axes(ig)..., true_image, "True phantom image"; clim) jim(axes(ig)..., fbp_image - true_image, "Error image")