Pain and temperature in the thalamus is controlled by the nucleus
Ventroposterior medial nuclei receive trigeminothalamic afferents and relay to postcentral gyrus. 
Ventroposterior lateral nuclei receive spinothalamic (Pain and temperature) and medial lemniscus afferents and relays to the cerebral cortex.
Ventroposterior Medial
Ventroposterior lateral
Ventral anterior
Ventral lateral