Hebbian plasticity induced by temporally coincident BCI enhances post-stroke motor recovery

Functional electrical stimulation (FES) can support functional restoration of a paretic limb post-stroke. Hebbian plasticity depends on temporally coinciding pre- and post-synaptic activity. A tight temporal relationship between motor cortical (MC) activity associated with attempted movement and FES-generated visuo-proprioceptive feedback is hypothesized to enhance motor recovery. Using a brain–computer interface (BCI) to classify MC spectral power in electroencephalographic (EEG) signals to trigger FES-delivery with detection of movement attempts improved motor outcomes in chronic stroke patients. We hypothesized that heightened neural plasticity earlier post-stroke would further enhance corticomuscular functional connectivity and motor recovery. We compared subcortical non-dominant hemisphere stroke patients in BCI-FES and Random-FES (FES temporally independent of MC movement attempt detection) groups. The primary outcome measure was the Fugl-Meyer Assessment, Upper Extremity (FMA-UE). We recorded high-density EEG and transcranial magnetic stimulation-induced motor evoked potentials before and after treatment. The BCI group showed greater: FMA-UE improvement; motor evoked potential amplitude; beta oscillatory power and long-range temporal correlation reduction over contralateral MC; and corticomuscular coherence with contralateral MC. These changes are consistent with enhanced post-stroke motor improvement when movement is synchronized with MC activity reflecting attempted movement.


Introduction
Stroke is a leading cause of motor disability 1 , with upper limb impairment occurring in over 75% of patients following acute stroke 2 .Despite the successes of thrombolytic therapy in reducing mortality and morbidity, a third or less of patients meet the criteria for this treatment, and over half of those receiving it are left with functional deficits 3 .Motor recovery depends on neural plasticity and the reorganization of structural and functional motor networks to re-establish corticomuscular connectivity [4][5][6][7][8] .Neural plasticity is task-specific, time-dependent, and environmentally-influenced 9 .Various approaches to re-establishment and reinforcement of connectivity between paretic musculature and residual motor areas are based on targeting Hebbian plasticity by synchronizing movement-associated visuo-proprioceptive feedback and motor cortical electrophysiological correlates of movement within a narrow time window 10,11 .Functional electrical stimulation (FES) is an established therapeutic tool for assisting movement attempts and promoting motor recovery.Studies involving chronic and subacute stroke patients have enhanced motor recovery when FES delivery is temporally coupled to movement attempts detected in brain electrical activity, using a braincomputer interface (BCI) [12][13][14] .Electroencephalographic (EEG) signals recorded over motor cortex provided the input to a classifier, and FES was triggered when features derived from these signals were classified as reflecting attempted movement as opposed to rest.Although starting rehabilitation early post-stroke is associated with better motor outcomes, putatively due to heightened neural plasticity 4,15,16 , the majority of studies implementing BCI-FES-based rehabilitation focus on patients in the chronic phase 17,18 .We hypothesized that earlier initiation of BCI-FES would improve corticomuscular functional connectivity, resulting in greater motor recovery.We also aimed to investigate neural correlates of motor recovery in patients receiving BCI-FES to gain a better understanding of potential mechanisms of action.The early phase post-stroke poses challenges in therapy program completion, and heterogenous patient groups with cortical and subcortical stroke, affecting either hemisphere are commonly included.Here we compared outcomes in a BCI and Sham group in a matched lesion subgroup from the Magdeburg patient cohort (German Clinical Trials Register: DRKS00007832; DRKS00011522).BCI and Sham patients had suffered a subcortical stroke affecting the non-dominant hemisphere, and the tight uniformity of the study group enabled grouplevel comparisons of electrophysiological and behavioral markers over the treatment period.
While clinical outcome is the primary focus in the evaluation of rehabilitation measures, understanding the mechanisms underlying recovery is the key to informing further development.Electrophysiological and functional measures of brain activity can provide potential markers of modulation during therapy, which is an essential component of evaluating the potential of this approach in facilitating motor recovery.Brain oscillatory activity 19 and corticomuscular functional connectivity 20 have been proposed as biomarkers of post-stroke recovery.Here we compared clinical outcome and neural correlates of motor recovery in patients in the acute and subacute phases post-stroke allocated to BCI-FES therapy (BCI group) or FES delivered without a tight temporal relationship with EEG correlates of movement attempts (Sham group).The patients underwent a three-week FES, either BCI-controlled or Sham, rehabilitation program, with transcranial magnetic stimulation (TMS)-induced motor evoked potential (MEP) amplitude measurement, and high-density EEG recordings.The EEG analyses included sensorimotor cortical spectral power, corticomuscular coherence, and long-range temporal correlation (LRTC).
In the BCI group, movement attempts were detected based on the online classification of EEG signals during the therapy.The sensorimotor rhythm refers to oscillations in brain electrical activity over motor cortical regions in the alpha (8-12 Hz) and beta (13-30 Hz) frequency ranges.Event-related desynchronization and synchronization (ERD/ERS) index reduction/increase of the sensorimotor rhythms, detectable as changes in EEG recordings starting before and changing over the course of movement 21,22 .They provide well-established indices of actual movement, as well as of imagined movement 23 and movement attempts 24 and are commonly used in BCI applications 25 .EEG recordings of this rhythm were made from each individual patient during a training session during cued movement attempts and rest periods.The electrode locations and specific frequencies at which oscillatory power differences were greatest between movement and rest were selected as features for training the BCI classifier.EEG data were continuously recorded during the subsequent treatment sessions, with repeated online classification, and when a movement attempt was identified, FES to the paretic limb was triggered.
The Sham group had the same external set-up at the BCI group, to enable blinding to group allocation.Each Sham group patient was assigned the classifier output stimulation timing and frequency from a randomly selected BCI group participant, to ensure that the only difference between the groups was that the timing of FES in the Sham group was independent of the patient's own cortical activity.
Laterality of motor cortical activity plays an important role in post-stroke recovery in two ways.First, handedness has an impact on movement-and imagined-movement-related sensorimotor cortical oscillatory activity as well as fMRI activation in healthy participants [26][27][28] , and activation patterns during post-stroke rehabilitation differ according to whether the dominant or non-dominant hemisphere is affected 29,30 .We therefore focused our analyses on the largest possible uniform patient group: righthanded patients with a non-dominant hemisphere stroke.Second, shifts of abnormal bilateral motor area activation during paretic hand movement in the subacute phase toward a more unilateral activation pattern of ipsilesional motor areas in chronic stroke is associated with better motor outcome 31,32 .On the other hand, while contralesional motor cortical activity is associated with poorer motor outcomes in the chronic phase post-stroke, this activity appears to play an important role early post-stroke 31 .We therefore examined electrophysiological changes over the treatment period both in contralesional and ipsilesional motor cortical regions.The primary outcome measure was change in the Fugl-Meyer Assessment of the Upper Extremity (FMA-UE) score from before to after treatment.We also examined potential neural correlates of a direct effect of BCI-FES on relevant neural processes.The amplitude of TMS-induced MEPs provides an index of the integrity of corticomuscular connectivity, and these were measured before and after the treatment program.Based on delivery of FES in temporal association with movement-associated spectral power changes in the sensorimotor rhythm, we compared spectral power across the alpha and beta frequency ranges after, with that before the treatment program in each group.This included comparison at a group and an individual patient level and evaluating correlation between oscillatory power in the sensorimotor rhythm and the FMA-UE score after treatment.As the aim was reestablishment of corticomuscular functional connectivity, we also assessed change in the EEG-EMG coherence in the same frequency range from before to after treatment in each group, based on the suggestion that this measure could provide a biomarker for motor recovery post-stroke 20 .We also evaluated a potential impact of BCI-FES on LRTC.LRTC provides an index of correlation between different time periods in a time series, providing an index of the extent to which neuronal systems are at a near-critical state permitting rapid changes in functional connectivity as processing demands change over time 33 .LRTC has been postulated to facilitate information transfer in neuronal networks, with physiological memory of a past activity influencing future activity through continuous modification and recurrent interactions between ongoing activity and stimulus-induced changes in activity 33,34 .Cumulative modification in network functional connectivity, resulting from activitydependent plasticity, has been proposed to provide the physiological mechanism underlying the power law correlations in ongoing oscillatory neuronal network activity, thus influencing future recruitment of neurons to engage in particular oscillatory activity 33 .LRTC observed in EEG signals shows power-law behavior, suggesting that the underlying neurodynamic processes are similar on different time scales 34 .The amplitude envelope of alpha and beta oscillations displays intermittent fluctuations and powerlaw decay of the autocorrelation over hundreds of seconds, suggesting a self-organized dynamical critical state 33 .Task-relevant neural assemblies, defined by temporal relationships between activity in different brain areas, form and dissolve over time 35,36 .Sensory stimuli result in reorganization of ongoing endogenous brain dynamics 37 .As activity is propagated through cortical networks, altering functional connectivity, reflected in changes in LRTC, and influencing future neuronal recruitment, somatosensory stimuli disrupt these transient neural assemblies, degrading ongoing LRTC 33 .We hypothesized that tight temporal coupling between motor cortical oscillatory power and the somatosensory stimulus in the BCI group would result in a greater reduction in LRTC than a somatosensory stimulus delivered independently of motor cortical activity corresponding to a movement attempt.

Patients
Of the patients recruited in Magdeburg (N = 32), 62.5 % (n = 20) completed the rehabilitation program.The reasons for discontinuing participation were complete recovery (n = 2), finding the therapy too tiring (n = 1), the sequelae of a previously diagnosed psychiatric (n = 4) or physical illness (n = 4), and the patient leaving the region (n = 1).Ten patients were allocated to the BCI group and 10 patients to the Sham group.The analysis was applied to the largest sub-group of patients with similar lesion location, which was those whose non-dominant hemisphere was affected by a subcortical stroke, resulting in equal BCI (n = 6) and Sham (n = 6) group sizes.

BCI features
The features (electrode locations and spectral power frequencies) that were selected at each retraining of the classifier for the BCI group patients changed over the course of treatment in all patients (Supplementary Fig. 1).Early in the program, bilateral features provided the best classification, with a tendency towards ipsilesional (contralateral) features being selected by the final training of the classifier.While the features included power in both the alpha and beta frequencies throughout, alpha power continued to be relevant by the end of the treatment period.By week 4 or later, all classifiers included an alpha power feature.Only one patient had an ipsilateral beta feature by the end.

Clinical evaluation
Examining the FMA-UE scores before and after the program, an interaction was observed between Time and Group (F(1) = 8.03, p = 0.030) (Fig. 1).No other interactions were significant.A main effect of Time was also observed (F(1,6) = 8.93, p = 0.024).No other within-subject main effects were significant.No between-subject effects were significant.Post hoc pairwise comparisons showed a significant increase in FMA-UE score from pre-to post-treatment in the BCI group (p = 0.004) but not in the Sham group (p = 0.77).The scores did not differ between the groups pre-treatment (p = 0.81), and a trend towards a higher score in the BCI than the Sham group was seen post-treatment (p = 0.062).
Of the secondary clinical outcome measures, a trend towards a Group x Time interaction (F(1) = 4.97, p = 0.056) and a main effect of Time (F(1) = 4.08, p = 0.078) were only observed for the National Institute of Health (NIHSS) upper limb score.
When Therapy start (Acute, Subacute) was included as a between-subject factor, the only significant interaction remained Time x Group (F(1) = 6.66, p = 0.049) (Fig. 2).Post hoc tests showed an increase in FMA-UE score in the BCI group (p = 0.010) but not in the Sham group (p = 0.89).The FMA-UE score increased in the BCI group from pre-to post-treatment when therapy was started in the acute (within one month of stroke: p = 0.016) but not the subacute (one to six months post-stroke: p = 0.21) phase, but the increase was not significant in the Sham group, starting in either the acute (p = 0.94) or the subacute phase (p = 0.78).TMS TMS measurements were available from patients with a subcortical stroke from both groups (BCI: n = 3; Sham: n = 3).An interaction was observed between Group and Time (F(1) =27.69 , p = 0.034) (Fig. 3).There was no main effect of Group (F(1,2) = 9.12, p = 0.094) or Time (F(1,2) = 1.36, p = 0.36).Post hoc revealed a significant amplitude increase from pre-to post-treatment in the BCI group (p = 0.012) only (Sham group: p = 0.50).

High-density EEG
Oscillatory spectral power differed between pre-and post-treatment in the BCI group (p = 0.036), with a reduction in upper beta (15-23 Hz) oscillatory spectral power around 0.5 to 1.5 s following the movement cue over the ipsilesional motor cortex (at electrode C2), which was not seen in the Sham group (Fig. 4).Spectral power was compared before and after treatment for each patient on the contralateral (C2) and ipsilateral (C1) side to movement, at the time post-movement cue, at which the pre-to post-movement change was greatest (1.2 to 1.4 s) (Fig. 4).Beta power reduction over the treatment period was most consistent across individuals in the BCI group over the ipsilesional motor cortex, contralateral to movement (Fig. 5).The contralateral beta power after therapy correlated with the FMA-UE score (r(2) = 0.96, p = 0.044) (Fig. 5).No significant correlation was observed in the Sham group nor in either group before therapy.LRTC, quantified using the Hurst parameter, was lower after than before the treatment program in the BCI group in the beta frequency range according to pairwise T-tests (Fig. 6A, B).Averaging over the beta frequency range at which power changed over time in the BCI group (15-23 Hz) and over time, a reduction in LTRC was seen in the BCI group only (paired T-tests, BCI: T = -3.38,p = 0.043; Sham: T = 0.19, p = 0.86).While LRTC was higher after than before the program in the Sham group in the alpha frequency range (8-12 Hz), averaging over frequency and time, the difference was not significant (paired T-tests, BCI: T = -0.85,p = 0.46; Sham: T = 0.52, p = 0.64).The reduction in beta-LRTC was consistently observed at an individual patient level in the BCI group only, and the increase in alpha-LRTC was consistently seen in the Sham group only (Fig. 6C, D).
We examined EEG-EMG coherence in the time-frequency window in which spectral power changed from pre-to post-treatment in the BCI group (0.5-1.5 s; 15-23 Hz), at the electrode location over the contralateral primary motor cortex at which the power difference was greatest (C2).The EEG-EMG coherence was greater after than before treatment in the BCI group (paired T-test: T = -3.45,p = 0.041) but not in the Sham group (T = -0.073,p = 0.95) (Fig. 7).

Discussion
Greater motor recovery, reflected by improved FMA-UE scores, was seen in the group receiving BCI-FES, with stimulation temporally locked to oscillatory spectral power changes in the sensorimotor rhythm, compared to the Sham group, who received FES at times unrelated to oscillatory correlates of movement attempts.Recovery was greater if the BCI-FES therapy was started in the acute phase poststroke.Neural correlates of improved functional connectivity between contralateral (ipsilesional) motor cortex in the BCI group included greater increases in TMS-induced MEP amplitudes and in corticomuscular coherence in the beta frequency range pre-to post-treatment than in the Sham group.Moreover, movement-associated beta spectral power reduction was more pronounced posttreatment in the BCI than the Sham group, commensurate with a reduction in compensatory activity.Finally, long-range temporal correlation within beta oscillations was also reduced post-treatment in the BCI group, suggesting that a subcritical state could be advantageous to motor recovery.Our findings are consistent with the proposal that FES delivery in a tight temporal window coupled with movement attempts using a BCI could improve post-stroke motor recovery, particularly if started early.Multiple neural correlates of motor recovery were modulated by the treatment program in BCI group, supporting the notion that timing FES delivery according to sensorimotor electrophysiological correlates of movement attempts could have a specific impact on recovery processes.
Few studies have investigated the potential impact of using BCI-FES early post-stroke 13,38,39 .Of the eight patients receiving BCI-FES in a partial crossover design study, four commenced treatment in the subacute phase, from 2-6 months post-stroke, with three in the BCI-FES and one in a control group receiving no FES 39 .Handedness, hemisphere affected, and lesion location varied.All three BCI patients showed improved motor function after treatment, while the control patient, whose impairment was also the most severe, did not.In another study with a partial crossover design, in which five of the 21 patients (mainly with stroke affecting the non-dominant hemisphere, including subcortical and cortical stroke) commenced treatment in the subacute stage, a clinically relevant improvement was seen in three of these patients 13 .A further study, involving seven right-handed patients with mainly subcortical stroke receiving BCI-FES in the acute/subacute phase, also showed greater motor recovery and enhanced sensorimotor rhythm desynchronization on the affected side after BCI-FES, which was not observed in the control group receiving FES unrelated to EEG features 38 .The improvements following BCI-FES in patients early post-stroke in these studies are consistent with our findings.Moreover, our preliminary analyses indicated that the increases in FMA and in beta desynchronization, as well as the reduction in beta LRTC, were observable in all four BCI group patients individually 40 .The small numbers of patients included at an early stage post-stroke highlights the importance of meta-analyses combining the findings from different studies.
Comparing alpha and beta oscillatory power pre-and post-treatment showed an increase in ipsilesional beta desynchronization in the BCI group.On the other hand, alpha power provided more ipsilesional classification features by the end than at the start of the treatment program.Enhanced ipsilateral beta and also alpha desynchronization on motor imagery have been reported following BCIbased neurofeedback training in subacute stroke patients 41 .Modulations of alpha and beta power have been postulated to enable selection of task-relevant neural assemblies, with separate roles proposed for alpha and beta oscillations during goal-directed actions 42 .A decrease in contralateral sensorimotor beta power in healthy participants on increasing action selection difficulty was suggested to reflect disinhibition of cortical regions engaged in determining movement parameters, while increased ipsilateral alpha power was proposed to facilitate disengagement of task-unrelated neuronal populations 42 .Reinforcing alpha modulation associated with movement attempts, through providing visual and proprioceptive feedback generated by BCI-FES-induced movement using alpha power as a classifier feature, could have facilitated synaptic strengthening or maintenance of neuronal networks oscillating in the alpha frequency range involved in movement generation.Reducing the selection of beta power features for classification could have reduced the integrity of networks oscillating in the beta range.We note that greater pre-treatment ipsilesional alpha desynchronization has been associated with better outcome in chronic stroke patients, with increased desynchronization over a BCI-training program correlating with greater motor recovery 19 .A pre-to post-treatment change in movement-related sensorimotor oscillations in the BCI group here is consistent with a modulatory effect of BCI-FES on the sensorimotor rhythm.
We observed a reduction in LRTC in beta oscillations in the BCI group post-compared with pretreatment.LRTC has been proposed to reflect neuronal systems close to a critical state, allowing fast reorganization of functional neural networks in response to changing demands.Better performance in an attentional task has been found to be associated with lower beta LRTC than at rest, and it was postulated that performance in tasks requiring sustained attention benefits from a sub-critical state 43 .LRTC in alpha band oscillations is also reduced following perturbation by a stimulus and on movement 33,44 .LRTC was not examined in the beta band in these studies, however.Our finding of reduced LRTC post-treatment in the BCI group, who had shown better motor recovery than the Sham group, suggests moving to a sub-critical state is associated with improved motor function and could be induced by BCI-FES trained using the sensorimotor rhythm.
Pre-with post-treatment comparison of electrophysiological markers differed on the contralateral (ipsilesional) side.An fMRI meta-analysis found that while contralesional motor cortical involvement is common, an eventual predominance of ipsilesional activity is associated with better motor outcome 32 .While lateralization of sensorimotor activity during post-stroke recovery to the contralesional hemisphere has been associated with better motor outcomes in a cohort including subcortical and cortical stroke patients 45 , better recovery has been reported with ipsilesional lateralization following subcortical stroke 11,32,46 .
The main limitations of this study are associated with the early timing of the intervention and its impact on patient numbers.The most significant recovery post-stroke is seen in the first few weeks 3 , suggesting that intervention at this time may offer a window period with heightened neural plasticity, potentially enhancing facilitation of motor recovery.However, multiple factors contribute to the limited patient numbers included in BCI studies in early post-stroke patients 13,38,39 .Extensive investigations and treatments are frequently required on hospital admission, presenting a challenge to study recruitment.Moreover, co-existing medical conditions, often associated with the stroke, in this patient group can impede treatment program completion.Finally, spontaneous post-stroke recovery is most common in the acute phase, in the first days to weeks post-stroke 13 .These limitations are common across centers, underlining the need for multi-center studies and meta-analyses to address the efficacy of rehabilitation approaches in this group.
The non-dominant hemisphere was affected in the majority of patients able to participate, due to aphasia being an exclusion criterion.The laterality of brain activity associated with movement depends on whether the dominant or non-dominant side is affected and the handedness of the patient.Group level statistical analyses comparing pre-and post-treatment activity required these factors to be uniform across patients.A tendency to use the non-dominant hand less may impede use-related spontaneous recovery, which could play a role in the benefits seen following BCI-FES in this patient group.Further studies directly comparing groups in whom the non-dominant and dominant hemispheres affected are needed, but again, the group sizes required will necessitate large-scale multicenter patient recruitment to reach the necessary patient numbers in each group.
Our findings support the proposal that using a BCI to trigger FES temporally coupled with movement attempts detected in motor cortical oscillations enhances post-stroke motor recovery, especially starting early after stroke.The electrophysiological findings suggest BCI-driven FES supports reestablishment of movement-associated processing on the ipsilesional side and a transition towards a subcritical state as contributing to the mechanism of Hebbian facilitation.

Patients
The patients were a subgroup of the Magdeburg patient cohort in an international, multi-center double-blind, randomized controlled study, which comprised two registered trials with the same study protocol but differing target patient populations.The first trial targeted patients in the acute phase post-stroke (German Clinical Trials Register: DRKS00007832) and the second included patients in the subacute phase (DRKS00011522).Patients were recruited following acute hospital admission poststroke or on transfer to the rehabilitation center, from the University Hospital Magdeburg stroke ward and the Neurorehabilitation Centre, Median Hospital Magdeburg, Germany, respectively.The study protocol was approved by the Local Ethics Committee of the University Hospital, Magdeburg, Germany and performed in accordance with the principles of the Declaration of Helsinki.All patients discussed study participation and the possibility of withdrawing from the study at any time, without a need to provide a reason, with CMSR, and subsequently provided informed, written consent to participation.

Inclusion criteria
The primary inclusion criterion was upper limb paresis following stroke affecting wrist extension, with a Medical Research Council Power Test score < 3, persisting >24 hours, and still present on recruitment.The acute group was recruited less than 1 month and the subacute group 1-6 months after stroke onset.Patients were required to be a minimum of 18 years of age, with no upper age limit.Diagnosis was confirmed using magnetic resonance imaging (MRI) or computerized tomography (CT), and patients with thrombotic or haemorrhagic stroke were included.

Exclusion criteria
The ability to understand the therapy instructions was a prerequisite, both to fulfill the requirement of provision of informed, written consent, and to enable active participation.Exclusion criteria were therefore a score <25 on the Montreal Cognitive Assessment 47 or severe aphasia, precluding active discussion of the instructions.Further exclusion criteria were severe hemi-neglect, depression (Hospital Anxiety and Depression Scale: HADS-total >15/21) 48 , fatigue (Fatigue Severity Scale > 36/63, i.e., > 4/7 on 9 items) 49 , pain in the neck/shoulder/arm (Pain Scale > 5/10) 50 , or a history of epilepsy.Other exclusion criteria were medical instability (orthostatic hypotension, sepsis, end-stage renal failure, severe visual impairment, fixed joint contractures, a skin condition that could be worsened through electrode placement), and taking certain regular medication (L-dopa, amantadine).

BCI-FES
On recruitment, patients were pseudorandomly allocated to the BCI or Sham group.The groups were counterbalanced according to the following factors: Age, Sex, Lesion Side, Lesion Site (subcortical, cortical), Lesion Type (ischaemic, haemorrhagic), and Pre-treatment FMA, to control for potential confounding factors.Patients were added sequentially to the database containing these factors and also the factor Group Allocation.The first four patients were allocated to the BCI group, so that FES delivery parameters would be available for generating comparable parameters for the Sham group.Frane's algorithm was then applied to the database to determine group allocation.An index of imbalance of each factor among patients so far recruited was calculated, based on each possible group allocation for the next patient.The index was a p-value from testing the hypothesis that the factor did not differ between groups.The Chi-square-goodness-of-fit test was used for Group Allocation, the Wilcoxon rank sum test for Age and Pre-treatment FMA, and the chi-square test for the remaining factors.For each possible group allocation, the largest imbalance was selected and converted to a probability of Group Allocation to each group by normalization.With each patient allocation, the most unbalanced factor at that time point was thus considered.The patients, therapists, and evaluating clinicians were blinded to group allocation.
Sixteen EEG electrodes were placed bilaterally over motor cortical regions using a customized electrode cap, with electrode positions based on the 10-20 international system as follows: Fz, FC3, FC1, FCz, FC2, FC4, C3, C1, Cz, C2, C4, CP3, CP1, CPz, CP2, and CP4.The reference electrode location was the right mastoid, and the ground electrode was at AFz. Selective electrode coverage was used, as our aim was to base FES timing on motor cortical activity, and the reduced electrode number enabled rapid application, which was important for daily electrode application, to minimize therapist time and maximize compliance.EEG signals were recorded at a sampling rate of 512 Hz using a g.USBamp V2.14.07 amplifier (g.tec, Austria).
Patients received a maximum of five sessions per week, with sessions occurring on different days.The total number of possible sessions depended on the length of the patients' stay at the rehabilitation center.All patients received a minimum of three weeks of rehabilitation, and a two-week extension was granted in certain cases by the individual state or private health insurance company.A mean of 18.8 [SD 5.7] treatment sessions were performed.Due to the variation, analyses of clinical outcomes were corrected for the number of sessions received.
An initial training session was carried out to record EEG data during attempted movement and at rest, which were used to train the classifier.Patients were seated comfortably in front of a computer screen, with a table in front of them on which to rest their forearms, palms down, with flexed elbows.When a green up-arrow was presented, patients were instructed to attempt to extend the wrist of the paretic limb.To provide analogous visual stimulation for both trial types, a red down-arrow was presented when patients were to remain at rest.An upwardly moving bar was presented as visual feedback during movement attempts, and a downwardly moving bar was present during rest.The cue to begin each trial was presented at 0 s.Four to six five-minute blocks were performed.Feature and selection and classification were performed in accordance with the previously reported chronic stroke study 12 .Following Laplacian-based spatial filtering, the Welch periodogram was applied to calculate the power spectral density at each electrode in 2 Hz bands from 8-30 Hz in 1 s sliding windows, shifting at 62.5 ms intervals (i.e., 16 times per second).Canonical variates analysis was used to identify up to 10 features for initial classifier training 51 .The trials were labelled as movement attempt or rest to provide input to train the Gaussian classifier using gradient-descent supervised learning.During the therapy, the probability was determined that a particular power spectral density value belonged to the movement attempt or rest trial class.When the classification threshold was not exceeded, a leaky integrator was used to smooth the ongoing output of the classifier.FES was triggered at the time point at which the probabilities integrated over time reached a threshold.If neither class was determined over a maximum 7 s trial, the trial was terminated, and the next one started.EEG data recorded during the therapy sessions were used to retrain the classifier each week, to account for changes over the course of the treatment.
Each subsequent therapy session comprised 3-7 blocks, according to fatigue levels, and lasted 10-25 minutes, including breaks.Fifteen movement attempts were made per block.For each therapy session, the EEG electrode cap was again applied, and two stimulating electrodes were placed over the extensor digitorum communis of the paretic forearm for inducing or assisting wrist extension by applying FES using a RehaStim stimulation device (Hasomed, Germany).EEG data were recorded continuously, with online classification 16 times per second.When a movement attempt was detected, FES was delivered.To balance the stimulation frequency between the groups, a BCI group patient was arbitrarily selected for each Sham group patient, and the corresponding frequency of stimulation was applied.

Clinical evaluation
A series of clinical evaluations was made to determine potential differences between the groups in terms of direct physical assessment and also impact on ability to perform daily tasks.The Edinburgh Handedness Inventory (EHI) was used to evaluate handedness.
The Fugl-Meyer Assessment upper extremity (FMA-UE) score (max.66) 52 was the primary outcome measure.A repeated measures ANOVA with the between-subject factor Group (BCI, Sham), the withinsubject factor Time (pre-and post-treatment), and the covariates Age, Sex, Days Post-Stroke, and Days of Therapy (i.e., number of treatment sessions) was used to compare the difference between FMA-UE score changes over the program between the groups.A repeated measures ANOVA was also applied including Therapy start (acute, subacute) as an additional between-subject factor.
A range of secondary endpoints was determined, to enable a detailed exploration of any potential differences between the groups.They included the Medical Research Council Power Test, the Rivermead Test, the Barthel Index, the National Institute of Health Stroke Scale (motor: Arm), the European Stroke Scale, the Modified Ashworth Scale (spasticity), the Goal Attainment Assessment, and the Stroke Impact Scale.

TMS
TMS was performed as a part of routine clinical monitoring from patients who fulfilled the inclusion and exclusion criteria relating to high magnetic field exposure.Before and after treatment, TMS was delivered to EEG location C4, over the primary motor cortex, while electromyographical signals (EMG) were simultaneously recorded over the affected (left) extensor digitorum communis.TMS was commenced at 70% of capacity and increased repeatedly by 10%, until the maximum motor evoked potential (MEP) amplitude was observed.The change in MEP from before to after treatment was compared between groups using a repeated measures ANOVA, with the between-subject factor Group (BCI, Sham) and the within-subject factor Time (before, after), correcting for the covariates, Age at stroke onset and Sex.

High-density EEG
High-density EEG data were recorded using a BrainAmpDC amplifier (Brain Products GmbH, Germany) from 64 channels (sampling rate: 500 Hz), simultaneously with electromyographic (EMG) data from electrodes placed over extensor digitorum communis of the affected limb during movement attempts, in twelve runs pre-and post-treatment.Each run comprised 10 movement and 5 rest trials in a pseudorandom order.Trials were presented using Presentation software (Version 18.2, Neurobehavioral Systems, Berkeley, CA, USA), analogously to movement cue presentation during the treatment program.The data were analyzed using custom Matlab scripts, EEGlab 53 , and FieldTrip 54 .Consistent with the clinical analyses, EEG data were analyzed from the patients with a non-dominant hemisphere, subcortical stroke.To enable electrode level comparison, we focused on patients who were purely right-handed (N = 8; BCI: n = 4, Sham: n = 4).
The EEG data were checked for internal consistency, then a notch (49-51 Hz) and a bandpass (1-200 Hz) filter were applied.The channels from each patient were then visually inspected and marked for ocular, EMG, and other artifacts.If more than 10 % of the data in a given channel were marked, the relevant channel was removed and replaced by spline-interpolated data from neighboring channels.The data were then re-referenced to an average reference, before being epoched according to movement cue presentation (at time = 0 s) with a window of -2 s to 2.998 s (2500 frames).Epochs containing artifacts, determined by visual inspection, were excluded from subsequent analysis by JK and RK, supervised by CMSR.Independent component analysis (ICA) was applied, and components containing eye-blink, eye movement, and muscle artifacts were identified by JK and RK on visual inspection and removed, followed by back-projection of the ICs to the electrode space.The EMG data were epoched with the EEG data but separately notch-and high-pass filtered (10 Hz cut-off), then rectified.The data were further epoched to the times relevant for the subsequent analyses.Time-frequency decomposition was carried out through convolution with 5-cycle Morlet wavelets from 4 to 31 Hz.Change in oscillatory spectral power from pre-to post-treatment was compared for each group.Paired T-tests were applied to each time-frequency point, with a threshold of p = 0.05, followed by cluster-based permutation tests with 500 randomizations.We then examined the change in individual patient beta spectral power pre-to post-treatment on an individual level over motor cortex ipsi-and contralateral to movement of the affected hand for each group, followed by calculation of Pearson's correlation coefficient between post-treatment contralateral beta spectral power and FMA-UE.
Coherence was calculated between the EMG signal recorded over the extensor digitorum communis during movement attempts and each EEG channel in the time-frequency window (0.5 to 1.5 s, 15-23 Hz) at which the pre-to post-treatment spectral power reduction differed between the BCI and sham groups.The EMG and EEG data were Fourier-transformed, with multitaper spectral smoothing, and the cross spectra were calculated based on the phase difference between the EMG and each EEG signal.The change in EEG-EMG coherence from pre-to post-treatment was compared for each group over contralateral motor cortex, at electrode C2, where power modulation was greatest, using paired T-tests.
Long-range temporal correlation (LRTC) was calculated using detrended fluctuation analysis (DFA).DFA was developed, because autocorrelation function analyses may yield spurious long-range correlations when the data are non-stationary.Evaluation of the decay in auto-correlation between remote parts of a non-stationary data sequence using DFA 55 is therefore applicable in EEG data 33 .LRTC can be quantified in EEG data in either the time or the frequency domain, the former by fitting the power law to the autocorrelation, and the latter by estimating the slope of the 1/f power spectrum on a log-log scale and computing the scaling exponent.DFA provides a more practical and most common approach to quantifying the degree of temporal dependency in non-stationary signals, captured in the Hurst exponent (H), and has been shown to be consistently related to both of those approaches 56 .In EEG signals, the degree of self-similarity within the time series has previously been quantified based on power law scaling, by applying least squares linear regression to determine the slope of a log-log plot of detrended fluctuations against window size (time scale) to yield H 44,55,57 .LRTC is deemed present when H is between 0.5 and 1.
LRTC in alpha and beta oscillations partially overlaps topologically with the distribution of spectral power, and alpha and beta power and LRTC correlate weakly 34 .We therefore evaluated LRTC at the electrode location at which power differences from pre-to post-treatment differed most between the BCI and Sham groups.The data were time-frequency decomposed using the wavelet transform with 5 cycle wavelets, amplitudes were extracted for alpha and beta frequencies (9-30 Hz), and H was calculated in 1 Hz steps.Long signal segments are needed to estimate H in narrowband signals 58 , so we concatenated the movement trials before applying DFA, following the approach of Wairagkar and colleagues 44 , as the DFA scaling exponent is not affected by stitching data together 57,59 .The minimum available number of trials for a given patient was 20, so 20 sequential trials were concatenated for each patient.The LRTC was then calculated over a 47.5 s sliding window in 50 ms steps, and the LRTC value was assigned to the first time point of each window.Paired T-tests were applied to compare LRTC before and after treatment for each group across time and the alpha and beta frequency ranges, as these frequencies were used as classifier features during the treatment program.

Figure 1 .
Figure 1.The Fugl-Meyer Assessment of the upper extremity (FMA-UE) showed greater motor recovery in the BCI group post-treatment than the Sham group.Interaction between Time and Group: F(1) = 8.03, p = 0.030, correcting for covariates Age, Sex, Days Post-Stroke, and Days of Therapy.Post hoc tests pre-to post-treatment: BCI: p = 0.004; Sham: p = 0.77.(The maximum score of the FMA-UE is 66 points.)Error bars = standard error of the mean.

Figure 2 .
Figure 2. The improvement in Fugl-Meyer Assessment of the upper extremity (FMA-UE) score was greatest in the BCI group from pre-to post-treatment in patients who started treatment in the acute phase (within one month) post-stroke compared with patients in the Sham group and with patients in either group starting treatment in the subacute phase.Including Therapy start as a factor: interaction Time x Group (F(1) = 6.66, p = 0.049) A. Patients starting treatment in the acute phase: post hoc p = 0.016.B. Patients starting treatment in the subacute phase: post hoc p = 0.78.Error bars = standard error of the mean.

Figure 3 .
Figure 3.The amplitude of the transcranial magnetic stimulation (TMS)-induced motor evoked potentials increased following treatment in the BCI group but not the Sham group.Interaction: Group and Time (F(1) =27.69 , p = 0.034), correcting for covariates.BCI: post hoc p = 0.012; Sham: post hoc p = 0.050.TMS was applied at electrode location C2, contralateral to the affected limb.Error bars = standard error of the mean.

Figure 4 .
Figure 4. Spectral power pre-treatment minus power post-treatment in each group.Spectral power reduction was greatest from pre-to post-treatment over contralateral (ipsilesional) primary motor cortex in the BCI group.Note that the positive T-values indicate a greater in desynchronization postthan pre-treatment.Black contour = cluster of adjacent time-frequency points at which the post-vspre-treatment power differed according to paired T-tests at threshold p = 0.05. A. BCI group: at each electrode.B. BCI group: largest cluster observed at electrode C2, over right primary motor cortex.C. Sham group: at each electrode.B. Sham group: at electrode C2, over right primary motor cortex.Cluster-based permutation testing showed a significant difference between spectral power pre-and post-treatment in the BCI group (p = 0.036).

Figure 5 .
Figure 5. Individual patient beta (15-23 Hz) spectral power at 1.2 to 1.4 s post-movement cue before and after treatment.A. Over motor cortex ipsilateral to affected hand movement (C1) in the BCI group.B. Over motor cortex contralateral to affected hand movement (C2) in the BCI group.C.Over motor cortex ipsilateral to affected hand movement (C1) in the Sham group.D.Over motor cortex contralateral to affected hand movement (C1) in the Sham group.E. Correlation between beta spectral power ipsilateral to affected hand movement (C2) and FMA-UE after treatment.F. Correlation between beta spectral power contralateral to affected hand movement (C2) and FMA-UE after treatment (r(2) = 0.96, p = 0.044).No other correlation was significant.

Figure 6 .
Figure 6.Changes in long-range temporal correlation (LRTC), quantified using the Hurst parameter, in high density EEG data recorded after compared with before the therapy program.Averaging over the beta frequency range at which power decreased post-therapy in the BCI group (15-23 Hz) and over time, LRTC decreased only in the BCI group (paired T-tests, BCI: T = -3.38,p = 0.043; Sham: T = 0.19, p = 0.86).A, B. Significance of the pre-to post-treatment LRTC difference over frequency and time based on pairwise T-tests. A. BCI group.B. Sham group.C, D. Changes in Hurst parameter in individual patients.Green: BCI group; Blue: Sham group; Solid lines: significant difference on T-test in this group and frequency; Dashed lines: difference not significant C. At beta (18 Hz).D. At alpha (9 Hz).