Analysis of electron energy-loss spectra and images