Main

A century of research in spinal cord physiology has demonstrated that circuits embedded in the lumbar segments of mammals can produce coordinated patterns of leg motor activity without brain input11,12. Various neuromodulation approaches have been developed to activate these circuits after injury to re-establish locomotion8,13,14,15,16,17. For example, epidural electrical stimulation (EES) of lumbar segments restored adaptive locomotion in paralysed rats8. Recent studies showed that EES is also capable of activating lumbar spinal circuits in people with paraplegia14,16.

These empirical observations prompted us to develop an evidenced-based framework to understand the interactions between EES and spinal circuits8,9,10. We aimed to exploit this knowledge to optimize stimulation protocols for clinical applications. Computational modelling and functional experiments revealed that EES engages spinal circuits through the modulation of proprioceptive feedback circuits10. This framework guided the design of spatiotemporal neuromodulation therapies that not only activate but also control the activity of spinal circuits engaging synergistic muscle groups8,9,10, enabling robust modulation of locomotor movements in rats whose spinal cords were void of brain input.

However, volitional locomotion requires the brain to control the activity of spinal circuits. Brain–computer interface technologies1,2,3,4,18 provide the tools to link the intended motor states to EES protocols19,20,21 to re-establish voluntary control of locomotion after injury. For these developments, nonhuman primates are more appropriate models than rodents because they exhibit cortical engagement during locomotion similar to humans22, analogous recovery mechanisms from injury23, and comparable technological requirements24. Here, we decoded motor states from leg motor cortex activity to trigger EES protocols facilitating extension and flexion of the corresponding leg. We show that this brain–spine interface alleviated gait deficits after spinal cord injury in nonhuman primates.

To support the development of the brain–spine interface, we established a wireless recording and stimulation platform in freely behaving, unconstrained and untethered nonhuman primates (Fig. 1 and Supplementary Video 1). Rhesus monkeys (Supplementary Table 1) were implanted with a microelectrode array into the leg area of the left motor cortex to record spiking activity from neuronal ensembles. Electromyographic signals were monitored using bipolar electrodes implanted into antagonist muscles spanning each joint of the right leg. Wireless modules enabled transmission of neural (20 kHz) and electromyographic (2 kHz) signals to external receivers25. We simultaneously acquired video recordings (100 Hz) to reconstruct whole-body kinematics23. To deliver EES, we used technologies previously developed in rats9, which we adapted to the characteristics of spinal segments and vertebrae measured in three monkeys (Extended Data Fig. 1). These spinal implants were inserted into the epidural space over lumbar segments, and connected to an implantable pulse generator commonly used for deep brain stimulation therapy. We engineered wireless communication modules that enabled control over the spatial and temporal parameters of EES with a latency of about 100 ms (Extended Data Fig. 2).

Figure 1: Conceptual and technological design of the brain–spine interface.
figure 1

The monkeys were implanted with a microelectrode array into the leg area of the left motor cortex. During recordings, a wireless module transmitted broadband neural signals to a control computer. (1) A raster plot recorded over three successive gait cycles. Each line represents spiking events identified from one electrode, while the horizontal axis indicates time. (2) A decoder running on the control computer identified motor states from these neural signals. (3) These motor states triggered electrical spinal cord stimulation protocols. For this, the monkeys were implanted with a pulse generator featuring real-time triggering capabilities. (4) The stimulator was connected to a spinal implant targeting specific dorsal roots of the lumbar spinal cord. Electromyographic signals of an extensor (grey) and flexor (black) muscles acting at the ankle recorded over three successive gait cycles are shown together with a stick diagram decomposition of leg movements during the stance (grey) and swing (black) phases of gait. Copyright Jemère Ruby (2016).

PowerPoint slide

We first used well established methods9,26 to identify the natural spatiotemporal pattern of motoneuron activation underlying locomotion. Our aim was to reproduce this pattern after injury. We conducted an anatomical tracing to identify the spatial distribution of motoneuron pools innervating antagonist muscles spanning each joint of the leg (Fig. 2a). We then projected the muscle activity recorded during locomotion onto motoneuron locations to visualize the spatiotemporal maps of motoneuron activation (Fig. 2c). These maps showed that locomotion involves the successive activation of well defined hotspots located in specific regions of the spinal cord that were similar across monkeys (Extended Data Fig. 3). The most intense hotspots emerged in the caudal (L6/L7) and rostral (L1/L2) compartments of lumbar segments around the transitions between stance and swing phases. We labelled these hotspots the extension and flexion hotspots, respectively.

Figure 2: Development and validation of selective spinal cord stimulation protocols.
figure 2

a, Diagram illustrating injections of retrograde anatomical tracers into leg muscles to label motoneurons. The inset shows a confocal photograph of labelled motoneurons. The 3D reconstruction shows each labelled motoneuron innervating the iliopsoas (IPS) and gastrocnemius medialis (GM) muscles. The same procedure was applied to the gluteus medius (GLU), rectus femoris (RF), semitendinosus (ST), extensor digitorum longus (EDL), and flexor hallucis longus (FHL) muscles. The diagram reports the distribution of leg motoneurons within the spinal cord (n = 1-2 monkeys per muscle). b, Representative micro-computed tomography (μCT) scans of the spinal implant (monkey Q1). c, Electromyography of the recorded leg muscles (monkey Q1) was projected onto the motoneuron locations in the spinal cord to compute the mean (n = 73 gait cycles) spatiotemporal map of motoneuron activation during locomotion. Maps recorded around foot off (−10% to +20% of gait cycle) and foot strike (−10% to +30%) were extracted to highlight extension and flexion hotspots (see data from other monkeys in Extended Data Fig. 3). d, Median (n = 6 pulses) spatial map of motoneuron activation resulting from single pulses of stimulation delivered through the electrodes targeting the extension and flexion hotspots. For each monkey, the bar plots report the correlation between these spatial maps and the maps corresponding to the extension and flexion hotspots. L, lumbar.

PowerPoint slide

EES activates motoneurons through the recruitment of large-diameter proprioceptive fibres within the dorsal roots10,27. To access the extension and flexion hotspots, we targeted the dorsal roots projecting to spinal segments containing these hotspots. We reconstructed the spatial trajectory of the dorsal roots innervating each lumbar segment, and integrated this information together with motoneuron distribution into a unified library (Fig. 2a). We used the entry points of the dorsal roots as the targeted anatomical landmarks that guided the design and positioning of spinal implants (Fig. 2b and Extended Data Fig. 1). Experiments in three sedated monkeys confirmed that single EES pulses delivered through the electrodes targeting the extension and flexion hotspots led to spinal segment activation that correlated with the activation of these hotspots during locomotion (Fig. 2c and d, and Extended Data Fig. 3).

We next exploited cortical signals to decode the temporal structure of extensor and flexor hotspot activation. The spiking activity recorded from the left motor cortex displayed cyclic modulations that were phase-locked with right leg movements (Extended Data Fig. 4a). We developed a decoder that calculated the probability of foot-strike and foot-off events from this modulation to anticipate the activation of extensor and flexor hotspots associated with right leg movements (Extended Data Fig. 4b). Evaluations in two intact monkeys showed that the decoder accurately predicted these gait events in real time over extended periods of locomotion, including when initiating and terminating gait, and during rest (Extended Data Fig. 5).

We then exploited our wireless platform to implement a brain–spine interface—a system wherein the decoded motor states triggered EES protocols targeting the extension and flexion hotspots. We tested the capacity of the brain–spine interface to modulate the extension and flexion hotspots independently and simultaneously in two intact monkeys during locomotion on a treadmill. We calibrated the decoder with temporal offsets that were tuned to trigger and terminate stimulation protocols concomitantly to the activation of each hotspot (Fig. 3a and Supplementary Methods). We used data without and with stimulation to calibrate the decoders4, which substantially improved decoding accuracy (Extended Data Fig. 5).

Figure 3: Brain-controlled stimulation modulates the extension and flexion of the leg during locomotion in intact monkeys.
figure 3

a, Two successive gait cycles recorded during locomotion without stimulation and during brain-controlled stimulation of the flexion hotspot, extension hotspot, or both (monkey Q2). From top to bottom: stick diagram decompositions of right leg movements; example of single-channel neural recording; probability of foot-off and foot-strike motor states; detected motor states (cyan and magenta broken lines), periods of stimulation through the electrodes targeting the flexion and extension hotspots; electromyographic signals; and limb length calculated as the distance from the hip to the fifth metatarsal joint. The grey and white backgrounds correspond to stance and swing, respectively. b, Relationship between frequency of brain-controlled flexion stimulation and step height, and between the stimulation amplitude and the activity of the GM muscle during brain-controlled extension stimulation (normalized to the GM mean activity 1 for stimulation ‘OFF’). Values for individual gait cycles (smaller dots) and mean values (larger dots) are shown. ***P < 0.001, Wilcoxon rank-sum test. c, Bar plots reporting the mean step height and mean GM activity without stimulation and during brain-controlled stimulation for monkeys Q1 (n = 125 steps) and Q2 (n = 119 steps). ***P < 0.001, Wilcoxon rank-sum test. Error bars, s.e.m. d, Decoder confusion matrices calculated during brain-controlled stimulation for monkeys Q1 (n = 125 steps) and Q2 (n = 119 steps).

PowerPoint slide

Without prior training of the monkeys, brain-controlled stimulation of the extension and flexion hotspots immediately modulated kinematic and muscle activity parameters related to the extension and flexion of the leg ipsilateral to stimulation (Fig. 3). A gradual increase in the frequency or amplitude of EES pulses led to a monotonic modulation of these parameters (Extended Data Fig. 6). We previously documented similar responses in rodents8,9,10, suggesting that the mechanisms underlying the modulation of spinal activity with EES are similar across mammals, including humans14,16.

Finally, we tested the ability of the brain–spine interface to alleviate locomotor deficits after a lesion of the corticospinal tract extending into the right dorsolateral column of mid-thoracic segments in two monkeys (Fig. 4a). Additional pathways were damaged, including the rubrospinal tract, dorsal column and reticulospinal fibres. This lesion initially led to a paralysis of the leg ipsilateral to the lesion, followed by an extensive yet incomplete spontaneous recovery (Fig. 4b and Extended Data Fig. 7). During the first week after the lesion and without training of the monkeys, the brain–spine interface restored weight-bearing locomotion on a treadmill (Fig. 4b, c) and overground (Extended Data Fig. 8), improving both the quantity and quality of steps performed by the impaired leg (Fig. 4d, e and Extended Data Fig. 9 and Supplementary Video 1). The quantity and quality of steps was directly linked to the temporal structure of the stimulation (Extended Data Fig. 10).

Figure 4: The brain–spine interface alleviates gait deficits after spinal cord injury.
figure 4

a, Diagram illustrating the location of the lesion and corticospinal tract labelling using biotinylated dextran amine (BDA). Right, anatomical reconstructions of spinal segments containing the lesion (grey), for monkeys Q2 and Q3. Photographs including insets (1) and (2), showing a longitudinal view of the lesioned spinal cord wherein astrocytes (glial fibrillary acidic protein (GFAP); grey), neurons (anti-NeuN antibody (NeuN); cyan) and corticospinal tract axons (BDA, pink) are labelled. The asterisk indicates the lesion. The overview scale bar is 500 μm and the inset scale bars are 50 μm. b, Gait cycles performed during locomotion without stimulation and during brain-controlled stimulation of both flexion and extension hotspots in monkey Q2 at 6 days post-lesion. Conventions are as in Fig. 3. Limb paralysis is shown in red. c, Snapshots extracted from video recordings showing a sequence of leg movements without stimulation and during brain-controlled stimulation (monkey Q2, 6 days post-injury). The timeline indicates video snapshot timing. The key refers to panels d and e. d, Bar plots reporting the ratio between steps performed by the affected versus unaffected leg by each monkey without stimulation (n = 6 for day 6 and n = 39 for day 14 for Q2, n = 68 for Q3) and during brain-controlled stimulation (n = 12 for day 6 and n = 93 for day 14 for Q2, n = 31 for Q3). ***P < 0.001, bootstrap. Error bars, s.e.m. e, Principal component analysis applied on 26 gait parameters for Q2. All the gait cycles corresponding to limb paralysis or stumbling have been excluded from this analysis. Each gait cycle is shown in the space defined by PC1 and PC2. Bar plots reporting the mean Euclidean distance between pre-lesion and post-lesion gait cycles corresponding to steps, calculated in the entire kinematic space. ***P < 0.001, Wilcoxon rank-sum test. Error bars, s.e.m.

PowerPoint slide

Accuracy of decoded extension and flexion motor states from neural activity declined shortly after the lesion and then improved during the following week. This improvement suggested that the initial decrease was probably due to the reorganization of cortical dynamics (Extended Data Fig. 9). This recovery coincided with improvement in the quantity and quality of steps, indicating that the monkeys had spontaneously regained some degree of neural control over the impaired leg (Extended Data Fig. 7). At this stage, the brain–spine interface alleviated many of the remaining gait deficits (Fig. 4d, e). Tuning the EES frequency maximized the quantity and quality of steps, whereas the same stimulation protocols (that is, the same electrode configurations at same amplitudes and frequencies of stimulation) applied continuously failed to facilitate locomotion or were markedly less efficient than brain-controlled stimulation (Extended Data Fig. 10).

The recovery of coordinated, weight-bearing locomotion in a primate model of spinal cord injury emphasizes the therapeutic potential of the brain–spine interface for clinical applications. We have integrated intracortical arrays2,3, wireless modules25 and pulse generators that have been approved for research applications in humans, thus potentially enabling proof-of-concept clinical studies.

Our brain–spine interface exploits neuronal ensemble modulation that naturally occurs during locomotion, immediately linking cortical dynamics with spatiotemporal neuromodulation therapies without prior training of the monkeys. This ecological approach28 enabled a smooth cooperation between residual supraspinal signals and the brain–spine interface in generating leg movements. Imaging29 and electrophysiological4 studies have shown that leg motor cortex dynamics is preserved in people with paralysis. Moreover, cortical activity modulates with intended movements in people with long-lasting tetraplegia, which has allowed them to control robotic arms2,3 and neuromuscular stimulators4. These results suggest that the decoding strategy employed in this study may have useful application in people with paraplegia.

Our model of paralysis avoided many of the complications associated with severe injuries that are difficult to manage and ethically debatable in primates24. The use of a brain–spine interface to restore bipedal locomotion in humans after severe injuries may require additional interventions, including monoaminergic replacement therapies13,19 compensating for the interrupted source of serotonin from brainstem centres and robotic systems to sustain balance. Nevertheless, several people with complete leg paralysis regained weight-bearing standing and stepping movements during continuous EES14,16. Therefore, it should now be possible to test the efficacy of the brain–spine interface to enhance neuroplasticity21,30 during rehabilitation in people with spinal cord injury.

Methods

No statistical methods were used to predetermine sample size. The experiments were not randomized. The investigators were not blinded to allocation during experiments and outcome assessment.

Animal husbandry

Experiments were approved by the Institutional Animal Care and Use Committee of Bordeaux (CE50, France) under the license number 50120102-A and performed in accordance with the European Union directive of 22 September 2010 (2010/63/EU) on the protection of animals used for scientific purposes in an AAALAC-accredited facility (Chinese Academy of Science, Beijing, China). Nine healthy male rhesus monkeys (Macaca mulatta, China; Supplementary Table 1) aged between 4 and 9 years old, and weighing between 4.3 kg and 8.4 kg (6.5 ± 0.5 kg) were housed individually in cages designed according to European guidelines (2 m × 1.6 m × 1.26 m). Environmental enrichment included toys and soothing music. All the monkeys are included in the manuscript. Only two monkeys received a spinal cord injury.

Surgical procedures

All the surgical procedures were performed under full anaesthesia induced with atropine (0.04 mg kg−1) and ketamine (10 mg kg−1, intramuscular injection) and maintained under 1%–3% isofluorane after intubation. A certified functional neurosurgeon (J.B.) supervised all the surgical procedures. Surgical implantations were performed during a single operation lasting approximately 8 h. We implanted a 96-channel microelectrode array (Blackrock Microsystems, of pitch 1.5 mm) into the leg area of the left primary motor cortex1 (F4, Supplementary Table 1). The monkeys also received a wireless system2 (T33F-4, Konigsberg Instruments, USA) to record electromyographic signals from the following leg muscles: gluteus medius (GLU), iliopsoas (IPS), rectus femoris (RF), semitendinosus (ST), gastrocnemius medialis (GM), tibialis anterior (TA), extensor digitorum longus (EDL), and flexor hallucis longus (FHL). A custom-made spinal implant was inserted into the epidural space of the lumbar spinal cord according to previously described methods9. The implant was inserted at the L4–L5 vertebrae and pulled until it reached the T13–L1 vertebrae. Electrophysiological testing was performed intra-operatively to adjust the position of the electrodes. Specifically, we verified that a single pulse of stimulation delivered through the most rostral and most caudal electrodes induced motor responses in the IPS and GM muscles, respectively. The connector of the implant, enclosed into a titanium orthosis, was secured to the vertebral bone using titanium screws (Vis MatrixMIDFACE, of diameter 1.5 mm and length 8 mm, Synthes). The wires were routed subcutaneously to an implantable pulse generator inserted between intercostal muscles (see Supplementary Information).

Monkeys Q2 and Q3 received a spinal cord injury. A partial laminectomy was made at the level of the T7/T8 thoracic vertebrae. A micro-blade was used to cut approximately two-thirds of the dorsoventral extent of the spinal cord. The lesion was completed using micro-scissors under microscopic observation. Animals retained bowel, bladder, and autonomic function after the injury. The veterinary team continuously monitored the monkeys during the first hours after surgery, and numerous times daily during the seven subsequent days. A few hours after completion of surgical interventions, the animals were able to move around and feed themselves unaided. Clinical rating and monitoring scales were used to assess post-operative pain. Ketophen (2 mg kg−1; subcutaneous) and Metacam (0.2 mg kg−1; subcutaneous) were administered once daily. Lidocaine cream was also applied to surgical wounds twice per day. The antibiotics ceftriaxone sodium (100 mg kg−1; intramuscular) was given immediately following surgery, and then once daily for 7 days.

Experimental recordings

Monkeys were trained to walk on a treadmill and overground along a corridor (300 cm × 35 cm × 70 cm). Plexiglas enclosures were used to maintain the monkeys within the field of view of the cameras. Food pellets and fruits rewarded appropriate behaviours. Additional food to complete daily dietary requirements was provided after training.

Single-pulse stimulation in sedated monkeys

Monkeys were lightly sedated with ketamine (3.5 mg kg−1), and suspended in the air using a jacket that did not impede leg movements. Single pulses of cathodic monopolar, charge-balanced stimulation (0.3 ms, 1 Hz) were delivered through the electrodes to elicit compound potentials in leg muscles. We selected the active sites whose corresponding spatial maps of motoneuron activation showed the highest correlation with the hotspots.

Brain-controlled stimulation during locomotion in intact monkeys

Brain-controlled stimulation protocols were tested during locomotion on a treadmill at a comfortable speed (Q1, 2.0 km h−1; Q2, 1.6 km h−1). Recording sessions were organized as follows: first, we recorded two to five blocks each of duration 1–2 min during stepping without stimulation. These baseline recordings were used to calibrate the decoders for real-time detection of foot-off and foot-strike gait events. Second, monkeys were recorded during brain-controlled stimulation protocols involving (1) solely the electrode targeting the extensor hotspot, (2) solely the electrode targeting the flexor hotspot, and (3) both electrodes. We tested the effects of stimulation frequency and amplitude over functional ranges (30–80 Hz; 1.5–3.9 V). See Supplementary Table 2.

Brain-controlled stimulation during locomotion in injured monkeys

Monkeys Q2 and Q3 were recorded after injury as soon as they were able to sustain independent locomotion on the treadmill, which corresponded to 6 days and 16 days post-injury, respectively. Q3 recovered more slowly than Q2, probably owing to receiving more extensive ventral and lateral spinal cord damage (Extended Data Fig. 9). Therefore, monkey Q3 could only be recorded when appropriate behavioural and physical conditions were reached, which occurred two weeks post-injury. Owing to restrictions on the total duration of the experiments (2 weeks), only one entire session could be conducted with this monkey. Following this experiment, the monkey rapidly recovered, which prevented evaluation of the efficacy of the brain–spine interface. The monkeys were recorded on the treadmill at their most comfortable speed (1.2–1.4 km h−1 for monkey Q2 and 1.0 km h−1 for monkey Q3). Recording sessions were organized as follows. First, we recorded two to six blocks each of duration 1–2 min without stimulation. These recordings were used to calibrate the decoders. Second, the decoders were used to test brain-controlled stimulation of both the extension and flexion hotspots over a range of stimulation frequencies. The effects of continuous stimulation using the same stimulation features as during brain-controlled stimulation were also tested. Within the functional range of stimulation parameters, brain-controlled stimulation did not trigger undesired movements or spasms that impaired locomotor movements. See Supplementary Table 2.

Data acquisition

Procedures to record kinematics and muscle activity have been detailed previously25,31. Whole-body kinematics was measured using the high-speed motion capture system SIMI (Simi Reality Motion Systems, Germany), combining 4 or 6 video cameras (100 Hz). Reflective white paint was directly applied on the shaved skin of the monkey overlying the following body landmarks of the right side: iliac crest, greater trochanter (hip), lateral condyle (knee), lateral malleolus (ankle), 5th metatarsophalangeal (mtp), and the outside tip of the fifth digit (toe). The Simi motion tracking software was used to obtain the three-dimensional spatial coordinates of the markers. Joint angles were computed accordingly. Electromyographic signals were recorded simultaneously (2 kHz, Kronisberg, USA) and synchronized through the Blackrock Cerebrus system (Blackrock Microsystems, USA), which also recorded neural signals. For this, the Cereplex wireless system25 was mounted on the head of the monkeys. Six antennae and a receiver were used to transmit25 broadband neural signals (0.1 Hz to 7.8 kHz band, sampled at 22 kHz). The signals were band-pass filtered (500 Hz to 7.5 kHz) and spiking events were extracted through threshold crossings2,3,32,33,34. Specifically, a spiking event was defined on each channel (96 in total) if the signal exceeded 3.0–3.5 times its root-mean-square value calculated over a period of 5 s. This procedure resulted in a binary signal from 96 multiunits, each originating from one of the 96 electrodes of the array. Signals from all 96 multiunits were integrated in the decoder.

Decoding of motor states from neural signals

Our aim was to deliver stimulation over the extensor and flexor hotspots around the times at which these hotspots are active during natural locomotion. To this end, we decoded gait-related motor states from neural activity and used those detections to trigger the stimulation protocols at the appropriate times. The control computer was connected to the local network and continuously received Used Datagram Protocol (UDP) packets containing neural recordings. We designed a custom in-house software application running on the control computer (Visual Studio C++ 2010), which analysed the neural signals in real time. Every 20 ms, the application made a decision: whether or not to trigger one of the spinal cord stimulation protocols. The decision was made based on probabilities of observing a foot-off or a foot-strike motor state given the history of neural data (300 ms pre-lesion and 400 ms post-lesion), as calculated by our decoders.

Natural activations of the extension and flexion hotspots were time-locked to foot-off and foot-strike gait events, respectively). In turn, we defined the foot-off and foot-strike motor states as the neural activity preceding foot-off and foot-strike gait events by ΔtFO and ΔtFS temporal offsets, respectively. The offsets were derived to maximize the overlap between the stimulation over the hotspots and the natural activation of those hotspots. In effect, the offsets integrated the latencies between the gait events and the hotspot activations, as well as latencies related to wireless communication between our devices, into the design of our decoders.

Extraction of motor states used for decoder calibration

We calibrated the decoders on data from two to seven no-stimulation blocks recorded at the beginning of each session. Gait events were identified from electromyographic recordings (Q1) or from video recordings (Q2 and Q3). Identification of foot-off and foot-strike gait events from electromyographic recordings was performed using signals from the iliopsoas muscle, which was active around the time of swing onset and remained active throughout most of the swing phase of gait. The foot-off and foot-strike gait events were estimated by thresholding the envelope of the rectified electromyographic signal. Identification of foot-off and foot-strike gait events from video recordings was performed visually. After injury and while the monkeys exhibited minimal movements only of the limb ipsilateral to lesion, foot-off and foot-strike gait events were defined according to residual hip or knee oscillations, which correlated with attempts to execute steps.

Calibration to account for stimulation-induced changes in neural signals

Analysis of the decoding temporal precision in Q1 revealed that decoded foot-off and foot-strike motor states during brain-controlled stimulation differed from the times of the motor states estimated from the foot-off and foot-strike gait events (median difference for foot-off was 68 ms and for foot-strike was −90 ms). We did not observe such a difference when detecting motor states in the absence of stimulation (median difference for foot-off was 11 ms and for foot-strike was 3 ms). A range of factors could have decreased decoding performance, including changes in somatosensory feedback influenced by the stimulation, attempts by a monkey to adapt its gait, changes in stability, and so on. To improve the temporal accuracy of our decoder, we introduced a decoder recalibration process. The initial decoder, trained on data without stimulation, was used to trigger stimulation through the extension hotspot or flexion hotspot independently for 2 to 3 blocks each. The data collected during these blocks was then combined with the blocks of no stimulation to calibrate a new, second decoder. This decoder successfully compensated for stimulation-induced changes in motor cortex activity (Fig. 3. and Extended Data Fig. 5).

Duration of hotspot stimulation protocols

We sought to stimulate flexion and extension hotspots throughout the duration of their natural activation during locomotion. We determined the duration of the flexion and extension hotspot stimulation protocols by setting this duration to 300 ms. We then recorded a few steps during brain-controlled stimulation, and adjusted the duration of the stimulation protocols for each monkey when necessary in order to obtain a clear modulation of leg kinematics. This procedure was performed only once for all pre-injury sessions and was repeated for each post-injury session.

Blinding

Data analyses, except for identification of the steps and the marking of foot-off and foot-strike gait events from video recordings, were performed by automatic computer routines. When analyses required involvement of investigators, these were blind to the experimental conditions.

Spatiotemporal map of motoneuron activation

To visualize spatiotemporal maps of motoneuron activation, electromyographic signals were mapped onto the rostrocaudal distribution of the motoneurons reconstructed from histological analyses. This approach provides an interpretation of the motoneuron activation at a segmental level rather than at the individual muscle level.

Identification of extensor and flexor hotspots activation

Flexion and extension hotspots were identified from the mean spatiotemporal map of motoneuron activation for each monkey independently (n = 3 for Q1, P2 and P3). Single maps computed between two consecutive foot-strike events were time-interpolated to a 1,000-point map and averaged to obtain the mean spatiotemporal map of motoneuron activation. Flexion and extension hotspots were then identified by time-averaging the mean map around the foot-off event (−10% + 20% of the gait cycle) for the flexion hotspot and around the foot strike event (−10% + 30% of the gait cycle) for the extension hotspot.

Analysis of muscle recruitment curves

The compound potentials recorded in leg muscles were rectified and integrated for each muscle and stimulation amplitude, and represented in colour-coded spatial maps of motoneuron activation. Instead of measuring specific flexor and extensor muscle selectivity we selected the electrodes that elicited spatial maps similar to those extracted during activation of the flexion and extension hotspots, regardless of muscle specificity. The correlation between the resulting map and the maps recorded during locomotion was calculated for each monkey to identify the voltage range over which the correlation was maximal. The derived voltage range was then used during behavioural experiments (Extended Data Fig. 3c).

Decoding performance quantification

We quantified the performance of our asynchronous decoders using confusion matrices and normalized mutual information, as described in ref. 35.

Steps classification for kinematic analysis

To evaluate the efficacy of the brain-spine interface and assess the importance of the timing of stimulation in correcting gait deficits, we conducted a post-hoc classification of the steps based on the temporal accuracy of the decoder to reproduce the desired hotspot activation timings. We defined optimal and sub-optimal steps according to the initiation of flexion and extension hotspot stimulation. All the gait cycles that contained only one correct extension activation (stimulation occurring at foot-strike ±125 ms) and only one correct flexion activation (stimulation occurring between foot-off −200 ms and foot-off +50 ms) were defined as optimal steps (Extended Data Fig. 10).

Stepping quantity

After the spinal cord lesion, the monkeys typically walked using their three intact limbs while the leg ipsilateral to the lesion was either dragging along the walking surface or maintained in a flexed posture. Occasionally, monkeys hopped to move both legs forward and avoid bumping against the back of the treadmill enclosure, owing to their inability to move at the selected treadmill belt speed. We counted the numbers of these ‘hop’ and ‘bump’ steps as well as the numbers of normal steps. Experimenters were blinded to stimulation conditions during this analysis. To quantify the functional improvement mediated by the brain–spine interface, we calculated the proportion of normal steps over all recorded blocks on a given day. To quantify the ability of the monkeys to sustain locomotion, we extracted all the events marked as steps, and measured the relative number of steps that were not performed while bumping into the back of the treadmill enclosure.

Stepping quality

A total of 26 parameters quantifying kinematics (Supplementary Table 3) were computed for each step according to methods described previously in refs 8, 9 and 31. We used principal component analysis to visualize the changes in gait over time and for different conditions (Fig. 4, and Extended Data Figs 7 and 8). To quantify locomotor performance, we calculated the mean Euclidean distance between steps corresponding to a given experimental condition and the mean of steps recorded before the lesion in the same monkey in the entire 26-dimensional space of kinematic parameters.

Tissue processing

Monkeys were deeply anesthetized and perfused transcardially with a 4% solution of paraformaldehyde. The spinal cord dura was removed and the spinal cord was removed by cutting 40-μm-thick sections using a cryostat microtome, before storage at 4 °C in 0.1 M phosphate-buffered saline azide (0.03%).

Anterograde tracing of motor cortex projections

Monkeys Q2 and Q3 underwent anterograde tracing of corticospinal projections from the leg and trunk area of the left motor cortex using anatomical tracers. All animals were anesthetized as described above. Biotinylated dextran amine (BDA; 10% solution in water; 10,000 Da; Molecular Probes, TSA PLUS Biotin KIT PerkinElmer, catalogue number NEL749A001KT) was injected at 300 nl per site into 40 sites spanning the leg and trunk regions of the left motor cortex.

Quantification of the spinal cord lesion

Camera lucida reconstructions of the lesion (Neurolucida 11.0, MBF Biosciences, USA) were performed using evenly spaced horizontal sections (1:4) throughout the whole dorsoventral axis on sections labelled for astrocytic (GFAP; 1:1000, Dako, USA, catalogue number Z0334), NeuN (anti-NeuN; 1:300, Millipore, catalogue number MAB377) and BDA reactivity. Immunoreactions were visualized with secondary antibodies labelled with AlexaFluor 488 (1:400, Invitrogen, catalogue number A-11034) and 647 (1:300, Invitrogen, catalogue number A-21235).

Statistical procedures

All the computed parameters were quantified and compared within each monkey. All data are reported as mean values ± standard error of the mean (s.e.m.). Significance was analysed using the non-parametric Wilcoxon rank-sum test, bootstrapping or a Monte Carlo approach.

Data availability

Data that support the findings and software routines developed for the data analysis are available from the corresponding author upon reasonable request.