a. Top: heatmap of average GCaMP6s responses to footshocks from individual halorhodopsin-expressing subjects. Bottom left: average GCaMP6s response from ILPVT neurons in halorhodopsin-expressing animals subjected to footshocks in the presence (red) and absence (black) of light stimulation (561 nm at 20 Hz). Footshock duration is depicted by the blue line above the trace, n = 7 mice. Bottom right: quantification of footshock-evoked changes in GCaMP6s fluorescence in ILPVT neurons in the presence and absence of light stimulation. AUC, Off_Before, −0.05 ± 0.03; Off_After, −52.11 ± 16.54; On_Before, 0.02 ± 0.02; On_After, −67.56 ± 20.74, n = 7 mice; F(3,22) = 6.84, two-way ANOVA followed by Tukey’s test. Group comparisons: Off_Before vs Off_After, P=0.07; On_Before vs On_After, **P=0.007; Off_After vs On_After, P=0.85. b. Top: heatmap of average GCaMP6s responses to social interaction from individual halorhodopsin-expressing subjects. Bottom left: average GCaMP6s response from ILPVT neurons in halorhodopsin-expressing animals subjected to social interaction in the presence (red) and absence (black) of light stimulation. The duration of the interaction bouts is depicted by the blue line above the trace, n = 5 mice. Bottom right: quantification of social interaction-evoked changes in GCaMP6s fluorescence in ILPVT neurons in the presence and absence of light stimulation. AUC, Off_Before, −0.71 ± 13.35; Off_After, −184.78 ± 47.13; On_Before, 15.42 ± 17.02; On_After, −149.26 ± 55.37, n = 5 mice; F(3,16) = 7.22, two-way ANOVA followed by Tukey’s test. Group comparisons: Off_Before vs Off_After, *P=0.02; On_Before vs On_After, *P=0.03; Off_After vs On_After, P=0.92. Box chart legend: box is defined by 25th, 75th percentiles, whiskers are determined by 5th and 95th percentiles, and mean is depicted by the square symbol. Data shown as mean ± s.e.m.