Functional near-infrared spectroscopy ( fNIRS ) is an emerging technique for the in vivo assessment of functional activity of the cerebral cortex as well as in the field of brain-computer interface ( BCI ) research .