Compressed Ultrafast Electron Diffraction Imaging Through Electronic Encoding