Optimal gradient waveform design for projection imaging and projection reconstruction echoplanar spectroscopic imaging