Terahertz spectroscopic imaging