Brain-Computer Interface (BCI) systems record, decode, and translate some measurable neurophysiological signal into an effector action or behavior . Therefore, according to this definition BCIs are potentially a powerful tool for being part of a Top-Down approach for neuro-rehabilitation as far as they can record and translate useful properties of brain activity related with the state of recovery of the patients.
BCIs establish a direct link between a brain and a computer without any use of peripheral nerves or muscles , thereby enabling communication and control without any motor output by the user [134, 135]. In a BCI system, suitable neurophysiological signals from the brain are transformed into computer commands in real-time. Depending on the nature of these signals, different recording techniques serve as input for the BCI [136–138]. Volitional control of brain activity allows for the interaction between the BCI user and the outside world.
There are several methods available to detect and measure brain signals: systems for recording electric fields (electroencephalography, EEG, electrocorticography, ECoG and intracortical recordings using single electrodes or an electrode array) or magnetic fields (magnetoencephalography, MEG), functional magnetic resonance imaging (fMRI), positron emission tomography (PET), and functional near-infrared spectroscopy (fNIRS) [139, 140]. Although all these methods have already been used to develop BCIs, in this paper we focus only on the non-invasive technologies that are portable and relatively inexpensive: EEG and fNIRS. Furthermore, we review publications that envisioned the inclusion of BCI for stroke rehabilitation and the first reports on its inclusion.
In the last decades, an increasing number of BCI research groups have focused on the development of augmentative communication and control technology for people with severe neuromuscular disorders, including those neurologically impaired due to stroke [132, 141, 142].
Daly et al.  explained this expansion of the BCI research field through four factors:
Better understanding of the characteristics and possible uses of brain signals.
The widely recognition of activity-dependent plasticity throughout the CNS and its influence on functional outcomes of the patient.
The growth of a wide range of powerful low-cost hardware and software programs for recording and analyzing brain signals during real-time activities.
The enhancement of the incidence and consideration of the people with severe motor disabilities.
One of the most popular neurophysiological phenomena used in BCI research is modulation of sensorimotor rhythms through motor imagery (MI) . Imagination of limb movement produces a distinctive pattern on the motor cortex that can be detected online from the EEG [144–146], MEG , ECoG [148–150], fMRI  and fNIRS [152, 153].
Mental simulation of movement, engages the primary motor cortex in a similar way that motor execution does . Motor imagery (MI) patterns have been found in healthy people [155–157], ALS patients , SCI patients [159, 160], and in stroke patients . Since MI does not require motor output, it can be used to "cognitively rehearse physical skills in a safe, repetitive manner" , even in patients with no residual motor function.
In particular, for motor recovery after stroke, MI has been extensively exploited to promote neuroplasticity in combination with traditional physiotherapy and robot-aided therapy . For example, Page et al.  showed that including a session of MI (30 minutes) after the usual physiotherapy (twice a week during six weeks) led to a significant reduction in affected arm impairment and significant increase in daily arm function, compared to a control group with physiotherapy but without MI sessions. MI sessions were guided by an audio tape describing the movements in both visual and kinesthetic ways. It can be seen that supporting MI with a BCI, would provide an objective measure of cortical activation during the MI therapy sessions.
In an early report on BCI control by stroke patients, Birbaumer et al.  reported on a MEG-based BCI. Chronic stroke patients with no residual hand function were trained to produce reliable MI patterns (volitional modulations of the sensorimotor rhythms around 8--12 Hz, through imagery of hand movements) to open and close a hand orthosis. To this end, between ten and twenty training sessions were required. Once the patients were able to control the device, further therapy sessions were carried out with a portable EEG-based BCI. It was mentioned that, as a side effect, the patients experienced "complete relief of hand spasticity" but not details were provided.
After this report, other research groups presented reports on future prospects of BCIs and the role of BCIs in neurological rehabilitation.
Buch et al.  reported that six out of eight patients with chronic hand plegia resulting from stroke could control the MEG-BCI after 13 to 22 sessions. Their performance ranged between 65% and 90% (classification accuracy), however, none of the patients showed significant improvement in their hand function after the BCI training.
Recently, Broetz et al. [164, 165] reported the case of one chronic stroke patient trained over one year with a combination of goal-directed physical therapy and the MEG/EEG-BCI reported in [132, 140]. After therapy, hand and arm movement ability as well as speed and safety of gait improved significantly. Moreover, the improvement in motor function was associated with an increased MI pattern (mu oscillations)from the ipsilesional motor cortex.
According to the literature, MEG and fMRI are better at locating stroke lesions and the neural networks involved in MI, thus, making those techniques the best choice for assessing changes in the motor activity that could foster and improve motor function [133, 145, 140, 166–169]. However, due to better portability and lower cost, EEG is a better choice for clinical setups, real time systems, and MI-based therapy, while functional methods like fNIRS are still an option. The next sections present the current approaches and the latest development in motor function recovery after stroke, using EEG-based and fNIRS-based BCIs.
Nowadays, there are only a few reports of Electroencephalograpy (EEG)-based BCIs for rehabilitation in stroke patients. The major part of these reports for stroke recovery focus on the rehabilitation of upper limbs, specifically of hand movements. Moreover, most of these reports focus on BCI performance of stroke patients and only a few of them have shown a real effect of BCI usage on motor recovery. Ang et al.  presented a study where a group of eight hemiparetic stroke patients received twelve sessions (one hour each, three times a week during four weeks) of robotic rehabilitation guided by an EEG-BCI. If the BCI detected the patient's intention to move, a robotic device (MIT-Manus) guided the movement of the patient's hand. A control group (ten patients) received the same number of standard robotic rehabilitation sessions (passive hand movements), without BCI control. Post-treatment evaluation of hand function (Fugl Meyer scale, relative to the pre-treatment evaluation) showed a significant improvement in both groups, but no differences between them. Between subsets of participants with function improvements (six in the experimental and seven in the control group), the experimental group presented a significantly greater improvement of hand motor function after adjustment of age and gender. Based on their own previous results, Ang et al.  reported that 89% of chronic stroke patients (from a total sample of 54 patients) can operate an EEG-BCI with a performance greater than chance level, and that the performance is not correlated with their motor function (Fugl Meyer scale, Pearson's correlation r = 0.36).
In contrast, Platz et al.  found a correlation between the ability to produce a desynchronization of the sensorimotor rhythms (associated with cortical activation) and the clinical motor outcome of acute and sub-acute stroke patients.
Daly et al.  presented a case study where one stroke patient (ten months after stroke) was able to perform isolated index finger extension after nine sessions (45 minutes, three times a week during three weeks) of training with FES controlled by an EEG-based BCI. Before treatment, the patient was unable to produce isolated movement of any digit of her affected hand. The BCI differentiated between movement attempts and a relaxation state. The authors reported that the patient was able to modulate sensorimotor rhythms (mu band) of her ipsilesional hemisphere for attempted and imagined movement after the first session; BCI control for relaxation was achieved until the fifth session. Both control and relaxation are desirable functions of the central nervous system (CNS) that allow to improve motor function and to reduce spasms. Prior to this work, Daly et al. , showed post-treatment changes in the EEG of people with stroke (reduction of abnormal cognitive planning time and cognitive effort) that occurred in parallel with improvement in motor function.
Prasad et al. [174, 175] presented a pilot study with five chronic stroke patients, based on the findings of Page et al. . In the study, the patients completed twelve sessions of BCI training (twice a week during six weeks). The BCI detected imagery of left vs. right hand movements in real time, and translated the cortical activity into the direction of a falling ball (presented at the top of the screen). The participants could control the ball by modulating their sensorimotor rhythms to hit a target at the bottom of the screen at the left or right side. After the training, the patients' average performance ranged between 60% and 75%, but did not show any significant improvements in their motor function. These results are in line with the report of Buch et al.  with the combined MEG/EEG BCI training (previously described).
Tan et al.  reported that four out of six post-acute stroke patients (less than three months after lesion) could modulate their sensorimotor rhythms to activate FES of the wrist muscles. Such findings are important since most of the post-stroke recovery occurs during the six months following the lesion, thus traditional and robotic-aided therapy could start as early as three months, with the possible inclusion of a BCI.
There is enough evidence to support the assumption that BCIs could improve motor recovery, but there are no long term and group studies that show a clear clinical relevance.
There is also evidence that MI of lower limbs, e.g. dancing or foot sequences, helps to improve gait [177, 178] and coordination of lower limb movements . Moreover, Malouin et al  showed differences between hand and foot MI after stroke. On the other hand, some studies suggest that there is a common mechanism influencing upper and lower limb recovery simultaneously, independently of the limb chosen for the rehabilitation therapy [181, 182]. While upper limb recovery is the focus of attention, lower limb and gait function have not been studied in combination with BCIs yet. Recent reports on EEG analysis during gait, suggest that it is possible to find neural correlates of gait  and to decode leg movement . Whether EEG-BCIs, or any BCI at all, are helpful for gait rehabilitation, is still an interesting question that remains open.
Functional near infrared spectroscopy-based BCIs
Functional near infrared spectroscopy (fNIRS) is a non-invasive psycho-physiological technique that utilizes light in the near infrared range (700 to 1000 nm) to determine cerebral oxygenation, blood flow, and metabolic status of localized regions of the brain. The degree of increase in regional cerebral blood flow (rCBF) exceeds that of increases in regional cerebral oxygen metabolic rate (rCMRO2) resulting in a decrease in deoxygenated haemoglobin (deoxyHb) in venous blood. Thus, increase in total haemoglobin and oxygenated haemoglobin (oxyHb) with a decrease in deoxygenated haemoglobin is expected to be observed in activated brain areas during fNIRS measurement. fNIRS uses multiple pairs or channels of light sources and light detectors operating at two or more discrete wavelengths. The light source is usually a light emitting diode. Three techniques are available for NIRS signal acquisition, continuous-wave spectroscopy, time-resolved spectroscopy and frequency-domain techniques . Continuous-wave spectroscopy is the approach used in the majority of the neuroimaging as well as brain-computer interface (BCI) studies. In this technique, the optical parameter measured is attenuation of light intensity due to absorption by the intermediate tissue. The source and the detector are separated by a distance of 2-7 cm to allow light to pass through the intermediate layers of scalp, skull and tissue to reach the surface of the brain again. The greater the distance between the source and the detector, the greater is the chance that the near-infrared light reaches the cortical surface. However, the attenuation of light due to absorption and scattering increases with the source-detector distance. The changes in the concentration of oxyHb and deoxyHb are computed from the changes in the light intensity at different wavelengths, using the modified Beer-Lambert equation .
The favorable properties of the fNIRS approach are its simplicity, flexibility and high signal to noise ratio. fNIRS provides spatially specific signals at high temporal resolution and it is portable and less expensive than fMRI. Human participants can be examined under normal conditions such as sitting in a chair, without their motion being severely restricted. However, the depth of brain tissue which can be measured is only 1-3 cm, restricting its applications to the cerebral cortex. With exciting developments in portable fNIRS instruments incorporating wireless telemetry , it is now possible to monitor brain activity from freely moving subjects [186, 187] thus enabling more dynamic experimental paradigms, clinical applications and making it suitable for implementation on BCIs.
As this paper focuses on rehabilitation of gait after stroke, the next sections will analyze the literature regarding gait performance using fNIRS and its application in stroke rehabilitation.
Assessment of gait with fNIRS
Increasing evidence indicates that fNIRS is a valuable tool for monitoring motor brain functions in healthy subjects and patients. Less sensitivity of fNIRS to motion artifacts allows the experimenters to measure cortical hemodynamic activity in humans during dynamic tasks such as gait.
Miyai and colleagues  recorded cortical activation in healthy participants associated with bipedal walking on a treadmill. They reported that walking was bilaterally associated with increased levels of oxygenated and total hemoglobin in the medial primary sensorimotor cortex (SMC) and the supplementary motor area (SMA). Alternating foot movements activated similar but less broad regions. Gait imagery increased activities caudally located in the SMA.
A study from Suzuki et al  explored the involvement of the prefrontal cortex (PFC) and premotor cortex (PMC) in the control of human walking and running by asking participants to perform three types of locomotor tasks at different speeds using a treadmill. During the acceleration periods immediately preceded reaching the steady walking or running speed, the levels of oxyHb increased, but those of deoxyHb did not in the frontal cortices. The changes were greater at the higher locomotor speed in the bilateral PFC and the PMC, but there were less speed-associated changes in the SMC. The medial prefrontal activation was most prominent during the running task.
Similarly, Mihara and colleagues  reported the involvement of the PMC and PFC in adapting to increasing locomotor speed.
A recent fNIRS study  showed that preparation for walking cued by a verbal instruction enhanced frontal activation both during the preparation and execution of walking as well as walking performance.
Altogether the studies on healthy participants reported an association between the PFC, SMA and SMC and control of gait speed. Moreover, the involvement of the left PFC might depend on an age-related decline in gait capacity in the elderly .
Thus far, few studies utilized fNIRS to assess cortical activation patterns in stroke patients. Cortical activation during hemiplegic gait was assessed in six non-ambulatory patients with severe stroke, using an fNIRS imaging system . Patients performed tasks of treadmill walking under partial BWS, either with mechanical assistance in swinging the paretic leg control (CON) or with a facilitation technique that enhanced swinging of the paretic leg (FT), provided by physical therapists. Gait performance was associated with increased oxyHb levels in the medial primary sensorimotor cortex in the unaffected hemisphere greater than in the affected hemisphere. Both cortical mappings and quantitative data showed that the PMC activation in the affected hemisphere was enhanced during hemiplegic gait. Moreover, cortical activations and gait performance were greater in walking with FT than with CON. In a follow-up study the same authors investigated cerebral mechanisms underlying locomotor recovery after stroke . Locomotor recovery after stroke seems to be associated with improvement of asymmetry in SMC activation and enhanced PMC activation in the affected hemisphere. In particular a correlation between improvement of the asymmetrical SMC activation and improvement of gait parameters were measured.
Furthermore, Mihara and colleagues  compared cortical activity in patients with ataxia during gait on a treadmill after infratentorial stroke with those in healthy control subjects observed a likely compensatory sustained prefrontal activation during ataxic gait.
Overall, these studies demonstrate the suitability of fNIRS for detecting brain activity during normal and impaired locomotion and subsequently as being part of a top-down strategy for rehabilitation.
fNIRS-BCI in stroke rehabilitation
Coyle et al.  and Sitaram and Hoshi et al.  were the first to conduct experiments to investigate the use of fNIRS for developing BCIs.
Sitaram et al  reported that MI produced similar but reduced activations in comparison to motor execution when participants used overt and covert finger tapping of left and right hands.
In the study by Coyle and Ward et al.  a BCI system provided visual feedback by means of a circle on the screen that shrunk and expanded with changes in hemoglobin concentration while participants imagined continually clenching and releasing a ball. An intensity threshold of the hemoglobin concentration from the contralateral optodes on the motor cortex was used to determine the actual brain state [196, 197]. In a follow-up experiment, Coyle et al.  used their custom-built fNIRS instrument to demonstrate a binary switching control called the Mindswitch with the objective of establishing a binary yes or no signal for communication. The fNIRS signal used for this purpose was derived from a single channel on the left motor cortex elicited by imagined movement of the right hand. The fNRIS based Mindswitch system tested on healthy participants showed that the number of correct classifications to the total number of trials was on the average more than 80%.
Recently, several studies reported fNIRS based BCI implementations [197–201]. Sitaram et al [198, 202] published the first controlled evaluation of an fNIRS-BCI. They used a continuous wave multichannel NIRS system (OMM-1000 from Shimadzu Corporation, Japan) over the motor cortex on healthy volunteers, to measure oxyHb and deoxyHb changes during left hand and right hand motor execution and imagery. The results of signal analysis indicated distinct patterns of hemodynamic responses which could be utilized in a pattern classifier towards developing a BCI. Two different pattern recognition techniques, Support Vector Machines (SVM) and Hidden Markov Model (HMM) were applied for implementing the automatic pattern classifier. SVMs are learning systems developed by Vapnik and his co-workers . SVM has been demonstrated to work well in a number of real-world applications including BCI . A Markov model is a finite state machine which can be used to model a time series. HMMs were first successfully applied for speech recognition, and later in molecular biology for modelling the probabilistic profile of protein families . This was the first time that SVM and HMM techniques were used to classify NIRS signals for the development of a BCI. Data for finger tapping and imagery were collected in two separate sessions for all participants. The analysis showed that, typically, concentration of oxyHb increased and concentration of deoxyHb decreased during both finger tapping and motor imagery tasks. However, changes in concentration, both for oxyHb and deoxyHb, for finger tapping were greater than those for motor imagery. Furthermore, channels on the motor cortex of the contralateral hemisphere showed activation by an increase in oxyHb and decrease in deoxyHb, while the channels on the ipsilateral hemisphere either showed similar response but to a smaller extent, or in a reversed manner potentially indicating inhibition. Reconstruction of topographic images of activation showed that there exist distinct patterns of hemodynamic responses as measured by fNIRS to left hand and right hand motor imagery tasks which could be utilized in a pattern classifier towards developing a BCI. Finger tapping data were classified with better accuracy compared to motor imagery data, by both classification techniques for all the subjects. Between the two pattern classification techniques, HMM performed better than SVM, for both finger tapping and motor imagery tasks. The results of high accuracy of offline pattern classification of NIRS signals during motor imagery tasks (SVM: 87.5%, HMM: 93.4%) indicated the potential use of such techniques to the further development of BCI systems. Towards this end, it was implemented a NIRS-BCI system incorporating a word speller as a language support system for people with disabilities. The authors concluded that NIRS provides an excellent opportunity to use a variety of motor and cognitive activities to detect signals from specific regions of the cortex.
With the objective of developing a specific fNIRS-BCI for rehabilitation of patients with lower limbs impairment, Rea and colleagues  assessed fNIRS capability to capture specific brain activity related to motor preparation of lower limb movements. Preliminary results showed an increase of oxyHb in the parietal cortex 9 to 11 s before legs' movement onset.
Overall these findings indicate that despite the inherent latency of the hemodynamic response fNIRS provides researchers with an excellent opportunity to use motor activities to detect signals from specific regions of the cortex for the development of future BCIs.