Field inhomogeneity correction and data processing for spectroscopic imaging