In a scanning electron microscope the region near the surface can be mapped using an electron beam that is scanned in a grid across the sample. A diffraction pattern can be recorded using electron backscatter diffraction (EBSD), as illustrated in Figure 25, captured with a camera inside the microscope. A depth from a few nanometers to a few microns, depending upon the electron energy used, is penetrated by the electrons, some of which are diffracted backwards and out of the sample. As result of combined inelastic and elastic scattering, typical features in an EBSD image are Kikuchi lines. Since the position of Kikuchi bands is highly sensitive to the crystal orientation, EBSD data can be used to determine the crystal orientation at particular locations of the sample. The data are processed by software yielding two-dimensional orientation maps. As the Kikuchi lines carry information about the interplanar angles and distances and, therefore, about the crystal structure, they can also be used for phase identification or strain analysis.