Modification to automatically extract from the spectral regions