From 2406b4b82e679ff99880a2ba69a7d7af23cb70ae Mon Sep 17 00:00:00 2001 From: Erik Strand <erik.strand@cba.mit.edu> Date: Tue, 21 May 2019 23:26:33 -0400 Subject: [PATCH] Talk about filtered back projection --- project.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 86 insertions(+), 5 deletions(-) diff --git a/project.md b/project.md index 3619f09..e77cf28 100644 --- a/project.md +++ b/project.md @@ -65,11 +65,19 @@ $$ $$ So the Fourier transform of the 1d projection is a 1d slice through the 2d Fourier transform of the -image. Since the x axis is arbitrary (we can rotate the image however we want), this works for other -angles as well. That is, if you project $$f$$ onto the line that makes an angle $$\theta$$ with the -x axis, its Fourier transform is equal to the slice along the corresponding line in frequency space. -This result is known as the Fourier Slice Theorem, and is the foundation of most reconstruction -techniques. +image. This result is known as the Fourier Slice Theorem, and is the foundation of most +reconstruction techniques. + +Since the x axis is arbitrary (we can rotate the image however we want), this works for other +angles as well: + +$$ +\hat{p}_\theta (\omega) = \hat{f} (\omega \cos \theta, \omega \sin \theta) +$$ + +where $$p_\theta (r)$$ is the projection of $$f$$ onto the line that forms an angle $$\theta$$ with +the x axis. In other words, the Fourier transform of the 1D x-ray projection at angle $$\theta$$ is +the slice through the 2D Fourier transform of the image at angle $$\theta$$. Conceptually this tells us everything we need to know about the reconstruction. First we take the 1D Fourier transform of each projection. Then we combine them by arranging them radially. Finally we @@ -102,3 +110,76 @@ interpolate. This step is tricky and tends to introduce a lot of error. I'll rat algorithms out there that come closer to the theoretically ideal [sinc interpolation](https://en.wikipedia.org/wiki/Whittaker%E2%80%93Shannon_interpolation_formula). The popular [gridrec](https://www.ncbi.nlm.nih.gov/pubmed/23093766) method is one. + + +## Filtered Back Projection + +It would be nice if we could avoid the interpolation required for Fourier reconstruction. The +simplest way of doing so, and still the most popular method of performing image reconstruction, is +called filtered back projection. + +### Theory + +Let's hop back to the continuous theory for a moment. The Fourier reconstruction technique is based +on the fact that $$f$$ can be represented in terms of its projections $$p_\theta$$ in polar +coordinates. + +$$ +\begin{align*} +f(x, y) +&= \int_\mathbb{R} \int_\mathbb{R} \hat{f}(u, v) e^{2 \pi i (ux + vy)} \mathrm{d}u \mathrm{d}v \\ +&= \int_0^\pi \int_\mathbb{R} \hat{f}(\omega \cos \theta, \omega \sin \theta) + e^{2 \pi i \omega (x \cos \theta + y \sin \theta)} + \vert \omega \vert \mathrm{d} \omega \mathrm{d} \theta \\ +&= \int_0^\pi \int_\mathbb{R} \hat{p}_\theta(\omega) + e^{2 \pi i \omega (x \cos \theta + y \sin \theta)} + \vert \omega \vert \mathrm{d} \omega \mathrm{d} \theta \\ +\end{align*} +$$ + +Instead of using interpolation to transform the problem back to cartesian coordinates where we can +apply the usual (inverse) DFT, we can directly evaluate the above integral. + +To simplify things a bit, note that the integral over $$\omega$$ is itself a one dimensional inverse +Fourier transform. In particular if we define + +$$ +q_\theta(\omega) = \hat{p}_\theta(\omega) \vert \omega \vert +$$ + +then the inner integral is just + +$$ +\mathcal{F}^{-1}[q_\theta](x \cos \theta + y \sin \theta) +$$ + +So overall + +$$ +f(x, y) = \int_0^\pi \mathcal{F}^{-1}[q_\theta](x \cos \theta + y \sin \theta) \mathrm{d} \theta +$$ + +### Discretization + +We'll replace the continuous Fourier transforms with DFTs as before. + +The only remaining integral (i.e. that's not stuffed inside a Fourier transform) is over $$\theta$$, +so most quadrature techniques will want samples of the integrand that are evenly spaced in +$$\theta$$. We want the pixels in our resulting image to lie on a cartesian grid, so our integrand +samples should be evenly spaced in $$x$$ and $$y$$ as well. + +How do we compute $$\mathcal{F}^{-1}[q_\theta]$$? We are given samples of $$p_\theta(r)$$ on a polar +grid. Using the DFT, we can get samples of $$\hat{p}_\theta(\omega)$$. They will be for the same +$$\theta$$ values, and evenly spaced frequency values $$\omega$$. So if we just multiply by $$\vert +\omega \vert$$, we get the corresponding samples of $$q_\theta(\omega)$$. Finally we just take the +inverse DFT and we have samples of $$\mathcal{F}^{-1}[q_\theta]$$ on a polar grid -- namely at the +same $$(r, \theta)$$ points we started out with. + +This works out perfectly for $$\theta$$: we can take the samples we naturally end up with and use +them directly for quadrature. For $$r$$, on the other hand, the regular samples we end up with won't +line up with the values $$x \cos \theta + y \sin \theta$$ that we want. So we'll still have to do +some interpolation. But now it's a simple 1D interpolation problem that's much easier to do without +introducing as much error. In particular, we only have to do interpolation in the spatial domain, so +errors will only accumulate locally. [Lanczos +resampling](https://en.wikipedia.org/wiki/Lanczos_resampling) would probably be the best, but I'll +just use Catmull-Rom again since I already have it implemented. -- GitLab