Algorithms for Crystallography in the Scanning Electron Microscope