1. A method of accelerated 3D multispectral imaging (MSI) based on phase-encoding in two dimensions and frequency-encoding in the third, implemented on a magnetic resonance imaging (MRI) system, the method comprising: generating randomized k-space undersampling patterns to determine k-space samples to be acquired in each spectral bin; ordering k-space samples into echo trains that determine gradient waveforms; initializing the gradient waveforms, RF waveforms, and timing information; playing the gradient and RF waveforms using the timing information to excite and refocus different spatial and spectral bin regions; acquiring undersampled MRI signal data on the MRI system from the spatial and spectral bin regions; reconstructing on-resonance images and off-resonance images represented as sets of low rank and sparse matrices from the undersampled MRI signal data, wherein the reconstructing uses a robust-principal-component-analysis-based algorithm implemented on a CPU or GPU; combining the on-resonance images and off-resonance images on the CPU or GPU to yield a final image; presenting the final image on a display.