Functional near-infrared spectroscopy (fNIRS) measures brain activity optically based on changes in cortical blood flow.