The diffraction pattern is characteristic of the crystal structure and orientation in the sample region where it was generated. Hence the diffraction pattern can be used to determine the crystal orientation, discriminate between crystallographically different phases, characterise grain boundaries, and provide information about the local crystalline perfection.