Monday, January 7, 2013

Learning Tomography: Zero Padding



In the last post [Link], we were able to reconstruct our image. However, the result was encouraging but a little bit disappointing. Fortunately, this can be improved by allowing the computation of Fourier transforms with higher precision.

According to the formula [Wikipedia], the 1D Discrete Fourier transform of a signal composed of N points is calculated with a spectral precision δF = ƒs / N with frequencies in the range of [-ƒs/2;+ƒs/2] where ƒs is the sampling frequency.
One way to compute the Fourier transform with a higher precision (a.k.a involving more frequencies) is to add zero values to the input data. This technique is called zero padding.

In ImageJ, the zero padding is simply done by using the Image > Adjust > Canvas Size... command and by modifying the width (choose a power of 2).
Note: Be sure to check the 'Zero Fill' checkbox.
In our test image, the sinogram has a width of 256, then the next power of 2 is 512. Thus, I pad it into a larger image of size 512x180 as shown in Fig. 1. Thus, the Fourier transforms are now computed with 512 values.
Fig. 1: Padding of the sinogram
Recompute the Fourier Transform of the sinogram [Link] with the script fourierRecSinogram.js and then rerun the script FourierRecBasic.js to compute the 2D reconstruction. A 512x512 image is calculated where only the central part corresponds to our data.

Fig.2: 2D reconstruction from sinogram of Fig.1. The image must be cropped to its original size (here, 256 x 256).
After cropping to its original size (the width of the original sinogram is 256, yielding a final image of 256x256), the final 2D-reconstruction is presented in Fig. 3.
Fig. 3: Final 2D reconstruction
The reconstruction quality is now much better than our previous try.

<< Previous: Part II - 2D reconstruction

Other crazybiocomputing posts

Further readings are available in ...
  • Learning Tomography Series  [Link]
  • Image Processing TOC [Link]



No comments:

Post a Comment