CDI reconstruction program using GPU

imaging / laser / optics / software / matlab

One of the drawbacks of the Coherent Diffractive Imaging technique is the heavy post-processing stages, including the reconstruction process, which deals with a large amount of data and computation steps. The most time consuming calculation is the fast Fourier transform (FFT) operator with the matrix which the size is up to 2048×2048 elements.   

Usually a construction process requires thousands of iterations, which each iteration consists of one FFT and one inverse FFT operators. Traditionally a reconstruction program which runs on a single CPU computer is a time consuming process. By implementing the reconstruction algorithm on a graphical processing unit (GPU), the calculation is spread out to a massive number of parallel computational units, thus the reconstruction time is dramatically reduced. The reconstruction process is perform on a desktop computer, which a Tesla K20c GPU is installed. Features 2496 computational units, the GPU is capable to process 1.17×1012 double-precision floating-point operations per second (flops), which is about 10 times better than a typical Intel Core i7 CPU. The reconstruction program is written in MATLAB, which uses the Parallel Computing Toolbox to utilize the GPU functionality. To compare the performance, the reconstruction is performed using the data size of 512×512, 1024×1024 and 2048×2048 elements with the Intel core i7 CPU alone and with the GPU, as shown:

Nvidia Tesla K20 Intel Core i7

CPU vs GPU comparision

 

As clearly seen, the reconstructions with the GPU perform around 15 times faster than with the CPU alone, which it takes only ~40 seconds for the 2048×2048 data while the CPU needs nearly 10 minutes to reconstruct the same image. To effectively perform the reconstruction process, an user interface is built from the MATLAB software, as shown:

Matlab Parallel Computing Toolbox

CDI reconstruction program

 

With the interface, the user can select the data file and background file, adjust the reconstruction parameters and watch the result in just a few seconds. This allows the user to reconstruct the image as soon as the diffraction data is available, which makes CDI one step closer to live imaging, similar to the optical microscope and the electron microscope.