The sample is scanned with an X-ray beam while the detector records a diffraction pattern for every beam position. The sample is then turned around its axis and scanned again, until a complete set of data is gathered for every angle. A high-resolution three-dimensional image of the sample is then computed from the hundreds of thousands of diffraction patterns by means of specially developed image reconstruction algorithms.