Purcell enhancement of spontaneous emission from quantum cascades inside mirror-grating metal cavities at THz frequencies.