The Reach Cage environment for wireless neural recordings during structured goal-directed behavior of unrestrained monkeys

Sensorimotor neuroscience with non-human primates usually mandates partial movement restraint to confine behavioral parameters and protect recording equipment. We present the Reach Cage and a versatile visuo-haptic interaction system (MaCaQuE) for investigating goal-directed whole-body movements of unrestrained monkeys. Two rhesus monkeys learned to conduct instructed reaches towards targets flexibly positioned in the cage. 3-D wrist movements were tracked in real time with video motion capture. We wirelessly recorded up to 127 broad-band neural signals at single unit resolution from three cortical sensorimotor areas. We demonstrate that repeated movements show small enough trial-to-trial variation to allow grouping of data for sufficient statistical power, and single neuron activity is selective for different reach movements. In conclusion, the Reach Cage in combination with wireless recordings allows correlating multi-channel neural dynamics with trained repetitive simpler movements, equivalent to conventional experiments, but also more complex goal-directed whole-body motor behaviors, like walk-and-reach movements.


Introduction
Sensorimotor neuroscience investigates how the brain processes sensory information, develops an action plan based on this information and ultimately performs a corresponding action. For instance, the fronto-parietal reach network is integrating hand, gaze and target position to compute the movement direction from the hand to the target (Andersen & Cui, 2009;Batista, Buneo, Snyder, & Andersen, 1999;Buneo, Jarvis, Batista, & Andersen, 2002;Pesaran, Nelson, & Andersen, 2006). To understand the neuronal basis of such behavior, spatial parameters such as head position, gaze direction, and body and arm posture need to be monitored and correlated with detailed measures of neural activity at the single unit resolution (Kuang, Morel, & Gail, 2016). Especially in system neuroscience with nonhuman primates, this led to highly specialized and controlled experimental setups with strongly constrained motor behavior. Typically, monkeys are seated in a primate chair and respond to sensory cues by operating a manipulandum or touchscreen while single unit activity is recorded using intra-cortical electrodes. Such studies led to numerous important insights into neural correlates of visually guided reaching movements, for instance force encoding (Cheney & Fetz, 1980) direction encoding (Georgopoulos, Schwartz, & Kettner, 1986), spatial reference frames of reach goal encoding (Batista et al., 1999;Buneo et al., 2002;Pesaran et al., 2006), context integration (Gail & Andersen, 2006;Westendorff, Klaes, & Gail, 2010), obstacle avoidance (Kaufman, Churchland, & Shenoy, 2013;Mulliken, Musallam, & Andersen, 2008), or decision making (Cisek, 2012;Klaes, Westendorff, Chakrabarti, & Gail, 2011). Because of the physical restraint, arm movements were restricted to the immediately reachable space and well-controlled planning and execution of goal-directed movements could not be investigated in monkeys in larger environments. For example, to date it was not possible to investigate naturalistic goal-directed movements that require the monkey to walk towards a target and thus to investigate how monkeys plan to acquire a reach goal beyond the immediately reachable space.
In conventional experiments, single unit activity is recorded either with chronically implanted multi-electrode arrays or depth-adjustable single electrodes. Signals are processed by a head-mounted instrumentation amplifier ('headstage') and routed to a data acquisition system via cables. Such tethered connections make it impossible to record from freely moving primates, at least in the case of larger species such as macaques. A few studies showed that tethered recording of freely moving monkeys can be possible with smaller species such as squirrel monkeys (Ludvig, Tang, Gohil, & Botero, 2004) or marmosets (Nummela, Jovanovic, Mothe, & Miller, 2017). Using wireless recording technology in combination with chronically implanted arrays, recent studies achieved recordings of single unit activity in nonhuman primates investigating vocalization (Hage & Jurgens, 2006;Roy & Wang, 2012), simple uninstructed behavior (Gilja, Chestek, Nuyujukian, Foster, & Shenoy, 2010;Schwarz et al., 2014), locomotion (Foster et al., 2014;Yin et al., 2014), chair-seated translocation (Rajangam et al., 2016), and sleep (Yin et al., 2014). An experimental environment for monkeys performing well-structured, goaldirected sensorimotor tasks without physical restraint, while at the same time registering behavioral and neural data, is missing to date (see review Händel & Schölvinck, 2017).
An important translational goal of sensorimotor neuroscience with non-human primates is the development of brain-machine interfaces based on intracortical extracellular recordings to aid patients with severe motor impairments such as tetraplegia. Intracortical signals can be decoded to control external devices, as demonstrated in non-human primates (e.g. Hauschild, Mulliken, Fineman, Loeb, & Andersen, 2012;Musallam, Corneil, Greger, Scherberger, & Andersen, 2004;Santhanam, Ryu, Yu, Afshar, & Shenoy, 2006;Serruya, Hatsopoulos, Paninski, Fellows, & Donoghue, 2002;Taylor, Tillery, & Schwartz, 2002;Velliste, Perel, Spalding, Whitford, & Schwartz, 2008;Wessberg et al., 2000), and suited to partially restore motor function in quadriplegic human patients (Aflalo et al., 2015;Bouton et al., 2016;Collinger et al., 2013;Gilja et al., 2015;Hochberg et al., 2012;Wodlinger et al., 2014). Due to their medical condition, those patients are not able to move their limbs and, as such, those experiments could not test whether decoding remains stable while the subject performs additional or task-irrelevant movements. Ultimately, the control of prostheses should be possible in larger workspaces for which also whole-body movements are required for instance for amputee patients that lost a limb but otherwise do not suffer from any other disease. Little is known about the stability of decoding performance when movements are performed in parallel such as walking. Wireless technology can be used to reduce the physical restraint from brain-machine-interface studies (Schwarz et al., 2014). This was demonstrated, for example, with a monkey moving through a room by controlling a wheeled platform that carried the primate-chair in which the monkey was sitting (Rajangam et al., 2016). While this is an important proof-of-principle towards BMI wheelchair control in paralyzed patients, it is not suited to investigate naturalistic goal-directed movements in freely moving monkeys. For reliable BMI applications, it is necessary to identify motor control parameters that are not disturbed when performing multiple movements at the same time. Thus, experimental paradigms are required that allow to test complex behavior consisting of various movement types.
Here, we present an experimental environment, the Reach Cage, which is equipped with a visuohaptic interaction system (MaCaQuE) and allows investigating movement planning and goal-directed movements of freely moving rhesus monkeys while recording cortical single-unit activity. We trained monkeys to perform controlled visually-guided reach movements with instructed delay to targets within and beyond the immediately reachable space. Using video-based motion capture of a stained spot on the fur, we measured three-dimensional wrist trajectories during task performance in real-time. We used wireless recording technology to record from single units in three cortical areas (parietal reach region PRR, dorsal premotor cortex PMd, and primary motor cortex M1) from a monkey performing reach and walk-and-reach movements. We show that the Reach Cage is suitable for sensorimotor neuroscience with physically unrestrained rhesus monkeys providing a richer set of motor tasks. Still, behavior and its neural correlates can be well identified and analyzed like in conventional experiments due to the highly structured task and setting.

Results
We developed the Reach Cage to expand studies of visual guided reaching movements to larger workspaces and study movements of rhesus monkeys performing structured reach tasks while being physically unrestraint. We report on quantitative assessment of the animals' behavior in the Reach Cage, as a basis for any further neuroscientific analysis. The timing of the monkeys' reaching behavior can be precisely controlled and measured with the touch and release times of our touch-sensitive cagemounted targets (1st section). Additionally, 3-D reach kinematics can be measured directly with the video-based motion capture system (2nd section). Finally, we will show that wireless neural recording is possible in the Reach Cage (3rd section) and report on proof-of-concept single-unit activity during such structured task performance (3rd and 4th section).

Real-time control of behavior in physical unrestrained rhesus monkeys in the Reach Cage
The core element of our newly developed Reach Cage (Figure 1) is the Macaque Cage Query Extension (MaCaQuE). Using this interaction device, we were able to train two fully unrestraint rhesus monkeys to conduct a behavioral task common to sensorimotor neuroscience in primates in a temporally well-structured fashion.
Both animals learned within a single first session that touching a target presented on a MaCaQuE Cue and Target box (MCT, Figure 1B) leads to a liquid reward. Due to the computer-controlled precise timing and dosage of reward ( Figure 1C), like in conventional chair-based setups, we could employ MaCaQuE for positive reinforcement training (PRT) to teach both animals a visually-guided target acquisition task with instructed delay (see Materials and Methods). Unlike conventional setups, MaCaQuE allowed for target placement beyond the immediate reach of the monkeys ( Figure 1D). Monkey K performed the final stretch-and-reach version of the task (Figure 2A/B left) with 77% correct trials on average (s.d. 23%, 17 sessions) with up to 382 correct trials per session (mean 140, s.d. 99) and the final walk-and-reach version of the task with 82% correct trials (s.d. 8%, 14 sessions) with up to 387 correct trials per session (mean 261, s.d. 84). Monkey L performed the final walk-and-reach ( Figure 2A/B right) version of the task with 54% correct trials (s.d. 5%, 42 sessions) with up to 333 correct trials per session (mean 205, s.d. 57). Most errors of monkey L were due to premature release of the start buttons prior to the go cue, especially for far targets (see also start button release timing below, Figure 2C). Trials with properly timed movement initiation were 90% correct in monkey L.
While the animals were not physically restricted to a specific posture, the strict timing of the task encouraged them to optimize their behavior. Since the MaCaQuE system makes information about MCT touches and releases available with minimal delay (< 1 ms), it is possible to enforce an exact timing of the monkeysâĂŹ movements when solving a reaching task in the Reach Cage. Figure  2C shows the distribution of button release times and movement times towards near and far targets for the stretch-and-reach task (monkey K: 17 session, 2377 correct trials) and walk-and-reach task (monkey K/L: 14/42 sessions, 3660/8617 correct trials). Since a whole-body translocation is required to approach far targets, movement times were longer than for near targets in both monkeys and tasks  Figure 1 : The Rach Cage setup. A) Monkey K touching one of the illuminated MCTs inside the Reach Cage. Red fur staining at the wrist was used for motion-capture. B) A MaCaQuE Cue and Target box (MCT) with proximity sensor to make the translucent front cover touch-sensitive and four RGB LEDs to illuminate it. C) Schematic of Macaque Cage Query Extension (MaCaQuE) showing the electronic components with the microcontroller interfacing between MCTs and an external computer for experimental control. D) Sketch of the Reach Cage with ten MCTs inside, two on the floor pointing upwards serving as a starting position for the monkey and two rows of four (near and far) pointing towards the starting position. For the stretch-and-reach task, far MCTs were positioned such that monkey K could reach them from the starting position by streching its body. For the walk-and-reach task, the far MCTs were positioned to the back of the cage (red arrow) such that the animals needed to walk first. An eleventh MCT is positioned outside the cage for providing additional visual cues. The universal MCTs can be arranged flexibly to serve different purposes.
(t-test p < 0.001). Movement time distributions were narrow (s.d. <= 78 ms) indicating that the monkeys optimized their behavior for fast target acquisition. Button release time indicates the onset of the hand movement, not necessarily the whole-body movement. Video analysis suggests that the monkeys started their body movements prior to the hand movements. In monkey K, the button release times were higher for far compared to near targets for both tasks (t-test p < 0.001). In contrast, button release times in monkey L were lower for far compared to near targets for the walk-and-reach task (p < 0.001) reflecting a different behavioral strategy for movement onset (monkey K was sitting during the delay period while monkey L was standing). Button release time distributions were narrow in monkey K (s.d. <= 73 ms) showing that the animal reacted properly to the strict timing of the go-cue. Monkey L struggled with the go cue (see above) leading to standard deviations of the button release time distribution of 95 ms for near and 124 ms for far targets.
The behavioral results as assessed with MaCaQuE via the proximity sensors of the MCTs demonstrate that the Reach Cage is suitable to train animals on goal-directed reaching tasks with target positions not being constrained by the immediately reachable space of the animal. The temporally and spatially well-structured task performance at the same time allows behavioral and neurophysiological analyses as applied in more conventional settings.

Movement kinematics of an unrestrained rhesus monkey performing a memory-guided reaching task in the Reach Cage
Since we do not impose physical restraint, the monkeys have more freedom to move than in conventional setups. We used motion capture to analyze the variability of the reach kinematics of monkey K performing the stretch-and-reach version of the task.
We measured 3-dimensional trajectories of monkey K's wrist. Permanent hair-dye on the fur of  Yellow MCTs indicate illumination. Only near targets are shown to illustrate this example trial, in which the second left-most near target was indicated as target and had to be reached after an instructed delay in response to the go cue (transient illumination of all targets). B) An example trial to a far target for monkey K (stretch-andreach, left) and monkey L (walk-and-reach, right). The frames of the surveillance video correspond to the time periods of the trial illustrated in A. C) Times between go cue and start button release (button release time), and between start button release and target acquisition (movement time) were distributed narrowly in most cases for reaching movements to near (bright) and far (dark) targets. Dashed lines and corresponding numbers indicate the average and standard deviation (s.d.) in ms. D-F) Monkey K's wrist motion capture for reaches to the eight targets from 200 ms before start button release until 600 ms after start button release (stretch-and-reach task). Since the far outer right target was partly occluded for one of the cameras (see vertical metal frame in B), the part of the trajectories (red) closest to this target is missing, while all other trajectories were captured entirely. D) Average reach trajectories reconstructed in the 3-dimensional Reach Cage model. E) Top view of target (grey) positioning inside the cage with 2-dimensional reach trajectories. F) Average absolute velocities of wrist movement. Shaded area represents standard deviation. monkey K was sufficient for a reliable color tracking for around three months. Figure 2D shows the reconstruction of the average 3-dimensional trajectories within the Reach Cage volume. Trial-by-trial individual trajectories indicate that the monkey performed relatively straight reaches with low spatial variability ( Figure 2E). The speed profiles of the wrist movement ( Figure 2F) show the typical bell shape of directed reaching movements and large overlap between different near and between different far targets indicating smooth continuous movements. To quantify the variability in the reach trajectories, we calculated for each target separately and at each time point the Euclidean distance between the single-trial trajectories and the trial-average trajectory. The highest observed trial-averaged Euclidean distance over the course of the trajectories was 65 mm (s.d. 40 mm). Since the monkeys were free to position their hand on the proximity sensors, the measured variability in wrist position was not zero during hold phases. In the 150 ms before start button release, the average Euclidean distance was 9 mm (s.d. 7 mm), after target acquisition it was 11 mm (s.d. 7 mm). As a reference, the transparent front plate of the targets has a diameter of 75 mm and the center-to-center distance between neighboring targets is around 130 mm (near) and 210 mm (far).
The kinematic analyses demonstrate that animal K not only complied with the spatial and temporal task requirements in terms of starting and endpoint acquisition but also adopted reliable repetitive behavior in terms of overall reach kinematics. We computed trial-averaged video streams for both animals which confirm that animal L adopted an equivalent behavior, evident from the fact that the overlaid videos for same-target trials slightly blur but do not wash out the animal image (see Rich Media File supplemental materials).

Multi-channel single unit activity can be recorded in the Reach Cage using wireless technology
A main goal of this study was to provide a proof-of-concept that the Reach Cage is an adequate setting for studying neural activity of monkeys during movement planning and execution of goal-directed behavior. We here provide this proof-of-concept with recordings from three different sensorimotor areas of animal L during the walk-and-reach task. Implant development and methodological details will be discussed below (Material and Methods).
We chronically implanted a total of 192 electrodes in primary motor cortex (M1), dorsal premotor cortex (PMd) and posterior parietal cortex of both monkeys using six 32-channel floating microwire areas (FMA). We recorded broadband neural data while the monkeys performed a visually-guided delayed walk-and-reach task ( Figure 3). The animals moved through the cage with the wireless electronics and protective cap without apparent issues and performed the behavioral task as without electronics and cap.
We recorded in monkey K/L 17/19 sessions from one array at a time using the 31-channel wireless headstage (number of session per array: 3/3 PRR-posterior; 3/4 PRR-anterior; 3/2 M1-lateral; 2/3 M1-medial; 3/4 PMd-posterior; 3/3 PMd-anterior). While implants were designed to also use a 127channel wireless headstage, we here mostly report 31-channel recordings. Since for the current study simultaneous recordings of four FMA arrays are not relevant, and the 31-channel recordings were more stable than the 127-channel recordings, with very rare data loss and low likelihood of artifacts. When the signal was stable it was possible to isolate single and multi-unit waveforms from the 127-channel recordings (Figure reffig:3A).
Once antennas were oriented appropriately, we did not experience signal loss with the 31-channel headstage and could record broadband signals with receiving antennas either placed inside or outside the cage. The recording and transmission quality of the signal was high and the raw signals show clearly distinguishable spiking activity ( Figure 3B). The activity of the example channel is clearly modulated by the task events as spiking as well as low-frequency components of the activity changes after go cue and start button release. This example signal trace shows a stable signal during the movement of the animal, as was the case for the other channels monitored online during the monkey's movements. If present, artifacts or signal loss resulted in strong signal modulation or high voltage peaks clearly exceeding neuronal signals and easily detectable by eye during the recording. We did experience such   : Wireless recording quality in the Reach Cage. A) Averaged waveforms from 127 channels (two PMd and two PRR FMA arrays) recorded wirelessly in parallel in monkey L. Waveforms are normalized to the highest waveform per channel. Numbers indicate channel number. Light shaded area represents standard deviation. B) Raw broadband extracellular voltage from a single electrode of a 32-channel electrode array in area PMd of monkey L. Traces from four trials during the walk-and-reach task are shown. Black vertical lines indicate task events, first -go cue; second -start button release; third -target acquisition. Time axis is aligned to start button release. For the first two trials, the target was a far target and for the last two it was a near target. Neural spiking is clearly isolatable from the background noise of the signal during all phases of behavior. artifacts when the animal moved its head very close to metal, particularly when drinking from the reward bowl mounted on metal bars of the cage frame.
From the data of all neural recording sessions, we could isolate waveforms from the broadband data. The data obtained from the 31-channel recordings revealed clear and stable waveform cluster over the session durations, allowing us to isolate single and multi-unit activity from all arrays. In the 17/19 sessions of monkey K/L, respectively, we isolated up to the following number of units per session with an average firing rate above 1Hz: 5/13 (PRR-posterior); 15/14 (PRR-anterior); 20/24 (M1-lateral); 15/31 (M1-medial); 19/24 (PMd-posterior); 16/13 (PMd-anterior).
In summary, the Reach Cage proofed to be suitable for addressing neuroscientific question based on single unit recordings. Broadband wireless neural signals showed excellent spike isolation and modulation of spike frequency correlated with behavioral events.

Reach Cage recordings allow novel sensorimotor neuroscientific studies
The precise behavioral control of the unrestraint animals in the Reach Cage together with the wireless recording opens opportunities for addressing new research questions. We can ask, for instance, whether neurons modulated for contralateral arm movements are also modulated for walk-and-reach movements to far-located targets. Activity patterns of single units during task performance indicate task-specific response modulations with high across-condition selectivity and within-condition trial-totrial reliability ( Figure 4).
During planning and execution of (walk-and-) reach movements, neural activity was modulated with respect to direction and distance of the targets. The purpose here is not a detailed neurobiological interpretation of the observed neural patterns, but to provide a proof-of-concept of the Reach Cage functionality towards neuroscientific questions. For this, we quantified the neural modulation using a modulation index regarding target distance (distMI) and target direction for near (nearMI) and far (farMI) targets in few selected neurons with consistent modulation pattern in both animals.
First, we demonstrate that it is possible to identify neural modulation during movement planning when no physical restraint is applied. Example A ( Figure 4A) shows units from PMd of monkey K and L, respectively, the activity of which is directionally modulated for near targets before the go cue (Kruskal-Wallis p < 0.001, nearMI = 0.44/0.47) with preference for left targets. The activity for far targets is not significantly modulated (Kruskal-Wallis p = 0.47/0.32). Example B shows units from PMd with higher firing rate for far targets than for near targets during movement planning (after target cue onset: Kruskal-Wallis p < 0.001, distMI = 0.22/0.21; before go cue: Kruskal-Wallis p < 0.001, distMI = 0.56/0.13). The activity of those units does not or only weakly differ between target directions after target cue onset (near: Kruskal-Wallis p = 0.52/0.02, nearMI = 0.05/0.07; far: Kruskal-Wallis p = 0.17/0.49, farMI = 0.08/0.04).
Second, comparing reach with walk-and-reach movements allows us to investigate if neural activity correlates only with goal-directed (contralateral) arm movements or also forelimb movements included in walking. When aligning the data with the time of target acquisition, the period of the goal-directed arm movements mostly overlaps in reach and walk-and-reach trials, spanning approximately the last 350 ms before target acquisition (see near movement times). On the other hand, when aligning the data with the start button release, in the first few hundred milliseconds the goal-directed arm movements in reach trials correspond approximately to the onset of the whole-body movement including limb movements for locomotion in the walk-and-and reach trials. Example C shows units from PRR with a strong peak of activity aligned with arm movement onset. For near targets, the activity peaks with the start button release, while for walk-and-reach there is little activity around start button release resulting in a strong difference in neural activity between near and far targets (after start button release: Kruskal-Wallis p < 0.001, distMI = 0.64/0.22). Before target acquisition the activity peaks for far and near target reaches are aligned resulting in a weak near-far modulation (Kruskal-Wallis p < 0.001, distMI = 0.07/0.19). In contrast, even though contralateral arm movements are clearly different for reach and walk-and-reach movements after start button release, activity can be similarly modulated in other neurons. Example D shows units in M1 the activity of which is clearly directionally modulated for near and far targets after start button release (near: Kruskal-Wallis p < 0.001, nearMI = 0.42/0.55; far: Kruskal-Wallis p < 0.001, farMI = 0.14/0.23) with a preference for left targets in both cases.
Neural activity patterns in all three brain areas were modulated during walk-and-reach movements. In Figure 4B we show the activation of 15 units per area during the period lasting from 400 ms before until 900 ms after the start button release. As example data, repeated movements to the near mid left (bottom) and far mid left target (top) are shown in the raster plots. During this time period of the trial almost all units were modulated, i.e. either excited or inhibited.
Taken together, we can record neural activity from a large number of recording sites spread over multiple sensorimotor areas while animals conduct structured cognitive sensorimotor tasks in the Reach Cage. The presented example data suggests that neural activity (1) encodes near target location during movement planning (example units A) similar to conventional settings; (2) differs between reach and walk-and-reach movements already during early movement planning (example units B); (3) can be aligned to the contralateral arm movement independent of body movements (example units C); and (4) can be similarly modulated during full-body and isolated arm movements (example units D).

Discussion
We introduced the Reach Cage as novel experimental environment for sensorimotor neuroscience with physically unrestrained rhesus monkeys. As core interactive element, we developed MaCaQuE, a new experimental control system for sensorimotor tasks in cage environments. We trained two monkeys to conduct spatially and temporally structured reach tasks that required them to reach to targets near or far from them with a stretch-and-reach movement (monkey K) or a walk-and-reach movement (both monkeys). With MaCaQuE, we could measure button release and movement times in response to visual cues with high temporal precision, which revealed, for example, faster hand movement initiation for near compared to far targets. Using motion capture, we additionally could track wrist trajectories for reach and stretch-and-reach movements of an unrestraint monkey (K) in the Reach Cage. Trajectories were consistent over trials and showed typical speed profiles as known from experiments with highly trained chair-seated monkeys. We could wirelessly record broadband neural signals of up to 127 channels from three brain areas (M1, PMd, PRR) of monkeys performing a walk-and-reach task. Like in more restricted conventional settings, neurons were clearly modulated by the task events and encoded information about the location of immediate reach targets. Beyond this, neurons revealed selective activity patterns when the monkey planned and conducted full-body movements. Hence, the Reach Cage allows identifying if and how neurons that contribute to contralateral arm movements also contribute to full-body movements (example units C and D), we provide a proof-of-concept for wireless neural recordings during structured behavior in unrestraint rhesus monkeys, significantly expanding the scope of sensorimotor systems neuroscience.

Neural recordings in unrestrained non-human primates
Only few studies demonstrated wireless recordings of neural single unit activity in physically unrestrained non-human primates so far. Those studies focused on locomotion (Capogrosso et al., 2016;Foster et al., 2014;Yin et al., 2014), vocalization (Hage & Jurgens, 2006;Roy & Wang, 2012), or showed proof-of-concept data of sleep (Yin et al., 2014) or basic uninstructed behavior (Fernandez-Leon et al., 2015;Gilja et al., 2010;Schwarz et al., 2014). One study used a wireless brain-machine-interface to let monkeys control a robotic wheelchair in which they sat (Rajangam et al., 2016). Other studies used tethered recordings to investigate primates freely exploring the environment while being attached to a pole (Sun et al., 2006), to a cable assembly (Ludvig et al., 2004) or seated in a chair they could move (Rolls, Robertson, & Georges-François, 1997). Alternatively, data logging can be used to store the recorded data on a head-mounted device (Jackson, Mavoori, & Fetz, 2007), with the limitation that the logging device is detached from any behavioral monitoring or task instruction system. In none of the mentioned wireless settings, precisely timed and spatially well-structured goal-directed behavior, or even movement planning, in unrestrained monkeys was investigated. This is what we achieved with the Reach Cage.

Structured behavior in the Reach Cage with MaCaQuE
With the Reach Cage, we aimed for maximal freedom of the animal to move and combined this with the conventional approach of a highly trained and structured task that (1) allows us to identify certain periods, such as movement preparation; (2) ensures that the animal focuses on the specific behavior due to the task demand and (3) provides repetition for a statistical analysis. With this combination, we were able to train the animals to conduct goal-directed walk-and-reach movements upon instruction, a behavior which cannot be studied in conventional chair-based settings.
The animals' movement behavior was only constrained by the task and the overall cage volume. Nonetheless, reach trajectories revealed fast straight movements with a typical bell shaped speed profile comparable to conventional setups (Georgopoulos, Kalaska, & Massey, 1981) and little trial-to-trial variability. Apparently, over the course of training, the animals had optimized their movement behavior and adopted consistent starting postures and stereotyped movement sequences. Video analyses additional to the wrist motion capture confirmed this notion. This spatio-temporal consistency of the behavior over many trials allows analytical approaches to both the behavioral and the neural data equivalent to conventional settings. Even without motion capture, we were able to use the interaction device MaCaQuE to monitor movement parameters such as the hand release time of the start button as response to the go signal and the movement time from the start button to the reach target. Both timing measures showed narrow distributions, further underlining the well-structured behavior induced by the task.
MaCaQuE can serve as a robust-cage-based equivalent to illuminated push-buttons (Batista et al., 1999;Buneo & Andersen, 2012) or a touch screen (Klaes et al., 2011;Westendorff et al., 2010) in conventional experiments, or as an alternative to wall-mounted touch screens in the housing environment Calapai et al., 2017). Yet, the MaCaQuE system is more flexible. Targets and cues are vandalism-proof and can be placed at any position in large enclosures, allowing for 3-dimensional arrangements and an arbitrarily large workspace. If more explorative, less stereotyped behavior is of interest, the trial-repetitive nature of the current task can easily be replaced by alternative stimulus and reward protocols, e.g. for foraging tasks. In another study (not shown here), we used MaCaQuE with humans and expanded it to deliver vibro-tactile stimuli to the subjects' fingers and to receive additional input from push buttons in parallel to the reach target input and output. Similar to other systems for neuroscience experimentation and training (Libey & Fetz, 2017;Ponce, Genecin, Perez-Melara, & Livingstone, 2016;Teikari et al., 2012), we used low-cost of-the-shelf components with an easy-to-program microcontroller platform as a core.
While we could track the wrist's movement, reliable motion capture with monkeys provides a technical challenge. At least two cameras need to see a marker or body part to reconstruct a 3dimensional position. Occlusion by objects or the animal itself is usually an issue (Chen & Davis, 2000;Moeslund, Hilton, & Krüger, 2006). When using systems based on physical markers (active LEDs or passive reflectors), rhesus monkeys tend to rip off the markers attached to their body. An alternative are fluorescent or reflective markers directly painted to the skin of the animal (Courtine et al., 2005;Peikon, Fitzsimmons, Lebedev, & Nicolelis, 2009), which also require continuously repeated shaving, or markers that cannot be removed, such as collars (Ballesta, Reymond, Pozzobon, & Duhamel, 2014). A videobased marker-free system using skeleton models was recently reported (Nakamura et al., 2016), however, this or similar systems were not yet reported in a larger, more complex environment with monkeys. We used a commercially available system with only four VGA cameras tracking a permanently dyed part on the animal's fur and the colored cap of the head implant (data not shown). Since we knew the behavior of the animal due to the structured task, we could set up the cameras to record reach trajectories to near and far targets.
When some behavioral parameters could not be controlled, physical restraint is used in conventional setups. For instance only the animal's hand contralateral to the investigated brain hemisphere gets access to a touchscreen. Here, in the beginning, Monkey L triggered the targets with its tongue and not its hand. Also for a subsequent study not reported in this manuscript, we trained monkey K on a walk-and-reach version of the task but using its left and not right hand. In both cases, we could train the monkeys to perform the behavior we intended by manual PRT in combination with MaCaQuE. Once trained, the monkeys performed the intended behavior consistently without manual PRT. Monkey K performed the same behavioral task with its left hand with 78% correct trials on average (s.d. 2%, 2 sessions). During monkey K's first training, we used only one position for reward delivery. We varied the position by placing the reward bowl right, left and behind of the starting position of the behavioral task. For all three reward positions, monkey K turned its body towards the reward system when being in the start position during the task. Introducing a second reward system and randomly assigning the reward to one of the systems each trial made it impossible for the monkey to know the position of reward delivery. Since then, we did not see an apparent change in body posture during the task based on the reward position. Based on this experience, we conclude that even without full control of all behavioral parameter it is possible with proper setup configuration and short periods of manual training to consistently instruct the animal on the desired behavior without applying physical restraint. However, full-body motion capture or at least markers on and multiple-camera view of more than one extremity would be beneficial to automatically detect undesired and reinforce desired behavior.
The animals performed a reasonable amount of trials in the Reach Cage (around 200 -300 correct trials per session), despite a clearly higher per-trial physical effort compared to conventional setups due to the full-body movements. As common in cognitive neuroscience research, we applied a fluid control regime (Prescott et al., 2010) to increase the incentive of the liquid rewards. One of the two monkeys (monkey L) performed tasks in conventional setups before (Morel et al., 2015) and showed a higher motivational level in the Reach Cage seen by an increase in number of trials performed despite a higher amount of reward per correct trial. While the Reach Cage is less suitable for neuroscience experiments that rely on an extraordinary degree of control over the sensory input, for instance vision research with precise gaze control, our results suggest that it is a suitable alternative for a certain range of motor and sensorimotor neuroscience studies which enables a much richer repertory of possible movements to be studied.

Motor-goal encoding in the Reach Cage
Previous studies provided evidence that it is possible to identify simple goal-directed behavior of a fully unrestraint monkey in single and multi-unit activity (Gilja et al., 2010;Schwarz et al., 2014).
However, those studies only tested a short period of uninstructed behavior as a proof-of-concept. Here, single units of all three brain areas that we recorded from were clearly modulated by task events and target choice. Due to the trial structure of the trained behavior, conventional temporal alignment and trial-averaging approaches were sufficient already to reveal such target selectivity in different periods of the trial, as seen from the example neurons. We applied neither physical restraint on body posture or movement, nor controlled gaze of the animal and visual input as strictly as in conventional setups, for which experiments often take place in a darkened room with only the controlled stimuli being visible. Therefore, it was not a priori clear if reach goal selectivity would be measurable in a way comparable with conventional experiments previously performed in our and other labs, particularly in posterior parietal cortex, where spatial frames of reference play a critical role (Batista et al., 1999;Bhattacharyya, Musallam, & Andersen, 2009;Klaes et al., 2011;Pesaran et al., 2006;Westendorff et al., 2010). Yet, animals were accustomed to the structure of the task and showed high consistency in their movement patterns. This is the likely reason why the observed neural responses in fronto-parietal cortices of monkey L during planning and execution of near-target reaches were highly reminiscent of data from comparable goal-directed reaching movements in chair-seated animals. But neuronal activity was also present during planning of reaches beyond immediate reach, i.e. for planed stretch-and-reach and walk-and-reach movements. A more detailed quantification of similarities and differences will need further experiments.
Another study used data-logging to simultaneously record single-unit activity from primary motor cortex and EMG activity from the contralateral wrist during free behavior (Jackson et al., 2007). The firing rate of most of the units was correlated with muscle activity. Interestingly, during a center-out reach task with EMG cursor control in a conventional restraining setup, the muscle-neural activity correlation was only weakly related to the correlation seen during free behavior. It remains to be tested if neural activity related to a behavioral task without physical restraint, like in the Reach Cage, would be stronger correlated with activity related to uninstructed behavior.

Tracking eye-movements in the Reach Cage
Gaze position modulates activity in PRR and PMd during planning and execution of reaches to peripheral targets when animals are trained to keep ocular fixation to a stimulus dissociated from the reach target (Batista et al., 1999(Batista et al., , 2007Boussaoud, 1995;Boussaoud & Bremmer, 1999;Boussaoud, Jouffrais, & Bremmer, 1998;Buneo et al., 2002;Pesaran et al., 2006). Here, we have a rudimental control of gaze position during the delay phase of the walk-and-reach task, since the go-cue has unpredictable timing and consist of an isoluminant color change of the MCT mounted in the straight-ahead direction below the targets. This arrangement strongly encouraged the animals to foveate the go-cue MCT. However, this strategy cannot fully prevent saccades, for instance, between the indicated target and go-cue MCT, nor does it control for eye movements during the movement phase. Since the animalâĂŹs body and head position does not change strongly during the delay phases within and between trials (see Rich Media Files), it is conceivable to implement an optical eye-tracking solution using cameras surveilling the sub-volume of the cage where the animal places its head. This would allow for precise eye movement tracking during the delay period without the need to attach additional devices to the animalâĂŹs body. During movement execution a head-mounted device would be necessary to allow movements in larger workspaces such as the Reach Cage (Kano & Tomonaga, 2013;Shepherd & Platt, 2006).

Neural signal quality in the Reach Cage
We recorded mostly artifact-free broadband data during the behavioral task despite whole-body movements. This is true despite the cage edges and one side, as well as the top and bottom grid consisting of stainless steel. Artifacts were visible outside of the task in predictable circumstances, when the animal moved the head with the transmitter close to a metal part (e.g. when drinking from a reward bowl) or too close to an antenna. Due to the known structure of the behavioral task, we could predict roughly the animal's head movements and setup the antennas so that they provided clean signals during the behavior of interest. Although we focused on single unit data, the quality of the broadband signals suggests that LFP analysis is possible as well. Even outside the immediate workspace of our behavioral task, signal loss and artifacts were seldom. For free behavior, such as exploration of the environment, using as little metal as possible in the cage certainly would be beneficial. This was not the case for the 127-channel system for which the higher bandwidth makes the system more prone to artifacts and signal loss. We were not able to obtain stable recording over a whole experimental session. However, periods of data loss were short and the signal quality was otherwise similar to the 31channel system suggesting that the 127-channel system would perform adequately in an environment optimized for RF-transmission. Apparently, the currently used metal cage including the MaCaQuE hardware interfered more strongly with the high-bandwidth wireless signal transmission. The cage could be optimized by systematically replacing metal parts with non-ferromagnetic materials.

Conclusion
Systems neuroscience can benefit from the possibility of quantifying free behavior and simultaneously recording brain activity, particularly but not only in sensorimotor research. Its technical realization is far from simple, though, especially with the complex movements primates are capable of. When using wireless technology, a desirable approach would be to let the monkey freely decide on their behavior to obtain neural correlates of most natural behavior (Gilja et al., 2010) while motion capture provides the related movement kinematics (Ballesta et al., 2014;Bansal, Truccolo, Vargas-Irwin, & Donoghue, 2012;Nakamura et al., 2016;Peikon et al., 2009). But even if full-body motion capture would be available, it will remain a major challenge to identify to what extent neural activity relates to sensory input, the currently performed movement or the planning of the next movement in free behavior. With the Reach Cage and the MaCaQuE system, we introduce a compromise, in which animals are not physically restrained in their movements, but still conduct structured cognitive and sensorimotor tasks, easing analyses of behavior and wirelessly recorded neural activity from large-scale neural networks. Such combination will provide important insights into the neural basis of more complex behavior than previously available.

Animals
Two male rhesus monkeys (Macaca mulatta K age: 6 years; and L age: 15 years) were trained in the Reach Cage. Both animals were behaviorally trained with positive reinforcement learning to sit in a primate chair. Monkey K did not participate in any research study before but was trained on a goal-directed reaching task on a cage-based touchscreen device . Monkey L was experienced with goal-directed reaching on a touch screen and with a haptic manipulandum in a conventional chair-seated setting before entering the study (Morel et al., 2015). Both monkeys were chronically implanted with a transcutaneous titanium head post, the base of which consisted of four legs custom-fit to the surface of the skull. The animals were trained to tolerate periods of head fixation, during which we mounted equipment for multi-channel wireless recordings. We implanted six 32-channel floating microelectrode arrays (Microprobes for Life Science, Gaithersburg, Maryland) with custom electrode lengths in three areas in the right hemisphere of cerebral cortex. Custom designed implants protected electrode connectors and recording equipment. The implant design and implantation procedures are described below.
Both animals were housed in social groups with one (monkey L) or two (monkey K) male conspecific in facilities of the German Primate Center. The facilities provide cage sizes exceeding the requirements by German and European regulations, access to an enriched environment including wooden structures and various toys . All procedures have been approved by the responsible regional government office [Niedersächsisches Landesamt für Verbraucherschutz und Lebensmittelsicherheit (LAVES)] under permit numbers 3392 42502-04-13/1100 and comply with German Law and the European Directive 2010/63/EU regulating use of animals in research.

MaCaQuE
We developed the Macaque Cage Query Extension (MaCaQuE) to provide computer-controlled visual cues and reach targets at freely selectable individual positions in a monkey cage (Figure 1).

MaCaQuE comprises a microcontroller-based interface, controlled via a standard PC, plus a variable number of MaCaQuE Cue and Target boxes (MCT).
The MCT cylinder is made of PVC plastic and has a diameter of 75 mm and a length of 160 mm. At one end of the cylinder the MTCs contain a capacitive proximity sensor (EC3016NPAPL, Carlo Gavazzi, Steinhausen, Switzerland) and four RGB-LEDs (WS2812B, Worldsemi Co., Daling Village, China), both protected behind a clear polycarbonate cover. With the LEDs, light stimuli of different color (8-bit color resolution) and intensity can be presented to serve as visual cues ( Figure  1B). The LEDs surround the proximity sensor which registers when the monkey touches the middle of the polycarbonate plate with at least one finger. This way the MCT acts as a reach target. LEDs, sensor plus a custom printed circuit board for the controlling electronics and connectors are mounted to a custom designed 3D-printed frame made out of PA2200 (Shapeways, New York City, New York). A robust and lockable RJ45 connector (etherCON, Neutrik AG, Schaan, Liechtenstein) connects the MCT to the interface unit from the opposite side of the cylinder via standard Ethernet cables mechanically protected inside flexible metal tubing. The RGB-LEDs require an 800 kHz digital data signal. For noise reduction, we transmit the signal with a differential line driver (SN75174N, SN74HCT245N, Texas Instruments Inc., Dallas, Texas) via twisted-pair cabling in the Ethernet cable to a differential bus transreceiver (SN75176B, Texas Instruments Inc.) on the MCT. Ethernet cables are CAT 6, however, any other category would be suitable (CAT 1 up to 1 Mhz). This setting allowed us to use cables up to 15 m. Hence, there are no practical limits on the spatial separation between MCTs and from the interface for applications even in larger animal enclosures. We did not test longer cables. Apart from the one twisted-pair for the data stream of the RGB-LEDs, the Ethernet cable transmits 12 V power from the interface unit and the digital touch signal from the proximity sensor to the interface unit. The proximity sensor is directly powered by the 12 V line. The LEDs receive 5 V power from a voltage regulator (L7805CV, STMicroelectronics, Geneva, Switzerland) that scales the 12 V signal accordingly. The PVC and polycarbonate enclosure of the MCT as well as the metal cable protection are built robustly enough to be placed inside a rhesus monkey cage. MaCaQuE incorporates up to two units to deliver precise fluid rewards . Each unit consists of a fluid container and a peristaltic pump (OEM M025 DC, Verderflex, Castleford, UK). MOSFET-transistors (BUZ11, Fairchild Semiconductor, Sunnyvale, California) on the interface unit drive the pumps.
The MCTs and reward systems are controlled by the Arduino-compatible microcontroller (Teensy 3.x, PJRC, Sherwood, Oregon) placed on a custom printed circuit board inside the interface unit ( Figure  1C). To operate a high number of MCTs the microcontroller communicates with the proximity sensor and LEDs using two serial data streams respectively. For the proximity sensor, we used shift registers (CD4021BE, Texas Instruments) that transform the parallel output from the MCTs to a single serial input to the microcontroller. The LEDs have an integrated control circuit to be connected in series. An additional printed circuit board connected to the main board contained 16 of the RGB-LEDs that receive the serial LED data stream from Microcontroller. We use this array of LEDs to convert the serial stream into parallel input to the MCTs by branching each input signals to the differential line drivers that transmit the signal to each MCT. To optimize the form factor of the interface unit we made a third custom printed circuit board that contains all connectors. In our current experiments, we assembled a circuit for connecting up to 16 MCTs but the MaCaQuE system would be easily expandable to a larger number. To set the transistors to drive the pumps of the reward systems, the 3.3V logic signal from the microcontroller is scaled up to 5V by a buffer (SN74HCT245N, Texas Instruments Inc., Dallas, Texas). Since MaCaQuE incorporates parts operating on 3.3V (microcontroller), 5V (LED array) and 12V (peristaltic pump and MCT), we used a standard PC-power supply (ENP-7025B, Jou Jye Computer GmbH, Grevenbroich, Germany) as power source. Additionally, twelve digital general-purpose-inputoutput (GPIO) pins are available on the interface, which were used to 1) send and receive synchronizing signals to other behavioral or neural recording hardware (strobe); 2) add a button to manually control reward units, and 3) add a switch to select which reward unit is addressed by the manual reward control. Further options like sending test signals or adding sensors or actuators are possible. Custom printed circuit boards are designed with EAGLE version 6 (Autodesk Inc., San Rafael, California).
We used Arduino-C to program the microcontroller firmware. MaCaQuE was accessed by a USB connection from a computer using either Windows or Mac OS. A custom-written C++ software package (MoRoCo) operated the behavioral task and interfaced with MaCaQuE via the microcontroller. We developed hardware testing software using Processing and C++.

Reach Cage
The Reach Cage is a cage-based training and testing environment for sensorimotor experiments with a physically unrestraint rhesus monkey ( Figure 1A). Inner cage dimensions are 170 cm x 80 cm x 85 cm (W x D x H) with a metal mesh grid on top and bottom, a solid metal wall one long side (back) and clear polycarbonate walls on all other sides. The idea of the experiment was to implement a goaldirected reach task with instructed delay, equivalent to common conventional experiments, to compare neural responses during planning and execution of reaches towards targets at different positions in space.
We used MaCaQuE to provide ten visual cues and reach targets (MCTs) inside the cage. Two MCTs were positioned on the floor pointing upwards. Eight were placed 25 cm below the ceiling in two rows of four each, pointing toward the middle position between the two MCTs on the floor ( Figure 1D). The floor MCTs provided the starting position for the behavioral task (start buttons). The monkey could comfortably rest its hands on the start buttons while sitting in between. The row of ceiling MCTs closer to the starting position was placed with a 10 cm horizontal distance and 60 cm vertical distance to the starting position (near targets). We chose this configuration to provide a comfortable position for a rhesus monkey to reach from the starting positions to the near targets without the need to relocate its body. For monkey K, the second row of MCTs was positioned at 50 cm horizontal distance from the starting positions (far targets). In this setting, the animal needed to tilt and stretch its body in order to acquire one of the far targets (stretch-and-reach task; Figure 2B left). For monkey L, the far targets were placed at 100 cm horizontal distance from the start positions, requiring the animal to make steps towards the targets (walk-and-reach task; Figure 2B right). In this setting, an eleventh MCT was placed outside the cage in front of the monkey (when sitting in the starting position and facing the opposite wall) to provide an additional visual cue. For positive reinforcement training, MaCaQuE's reward systems can provide fluid reward through protected silicon and metal pipes into one of two small spoon-size stainless steel bowls mounted approx. 20 cm above the floor in the middle of either of the two long sides of the Reach Cage.

Behavioral task
Using the Reach Cage, we trained monkey K on a memory-guided stretch-and-reach task with instructed delay ( Figure 3A). When the starting positions lit up, the monkey was required to touch the right start button and hold it (hand fixation). After 400 -1000 ms, one randomly chosen reach target lit up for 600 ms indicating the future reach goal (cue). The animal had to remember the target position and wait for 400 -2000 ms (memory period) until the lights of the starting positions turned off and concurrently lights of all targets turn on (go cue). The monkey then had a 600 ms time window starting 200 ms after the go cue to release its right hand from the right start button. We introduced the 200 ms delay to discourage the animal from anticipating the go cue and triggering a reach prematurely. After releasing the start button, the animal needed to reach to the remembered target within 1000 ms. Provided the animal kept touching for 300 ms, the trial counted as correct, indicated by a high pitch tone and reward. A lower tone indicated an incorrect trial. Reward was delivered by juice filled into one of two randomly assigned drinking bowls. We used unpredictable sides for reward delivery to prevent the animal from planning the movement to the reward before the end of the trial. We always used white light for visual cues during this task.
Both monkeys performed a variant of the task, namely a walk-and-reach task with instructed delay. The variant of the task differed in four aspects from the task of monkey K. First, both starting positions had to be touched and held by the animal during fixation. Second, the target illumination remained during the instructed delay, i.e., the animal was not required to memorize the target position, but it still had to wait for the go cue before initiating the reach. Third, far targets were placed at 100 cm distance, which required the animal to walk-and-reach, and which also affected the timing of the task. Forth, the go cue was displayed on the outside-cage MCT (visual cue) as an isoluminant color change from white to red. This encouraged the animal to foveate to this MCT during movement planning so that it did not miss the go cue which was unpredictable in time. We calibrated the luminance of the MCT using a luminance meter (LS-100, Konica Minolta, Tokyo, Japan). The timeline of the walk-and-reach task was as follows: 1) the visual cue turned on (white) to indicate that a trial can be initialized; 2) both starting buttons had to be touched and held for 400 -800 ms; 3) the future reach goal lit up (white) and stayed on; 4) after 1000 -2200 ms the fixation stimulus turned from white to red ('go' signal); 5) at least one starting position had to be released within 800 ms; 6) the target had to be acquired within 600 ms for a near target or 1200 ms for a far target; 7) after 300 ms of holding the target the trial was correct and the animal received the reward and high-pitch acoustic feedback.
In the beginning, we did not impose the choice of hand on the monkeys in this study but let them freely pick their preferred hand. While monkey K reached to the targets with the right hand, monkey L used the left hand. Both animals consistently used their preferred hand and never switched. For the walk-and-reach task we trained monkey K to use its left hand using positive reinforcement training. Once trained, the monkey used consistently its left hand.

Motion capture and analysis of behavior
The animals' behavior was analyzed in terms of accuracy (percent correct trials), timing (as registered by the proximity sensors), and wrist kinematics (video-based motion capture).
We analyzed start button release and movement times of both monkeys when they performed their respective task (monkey K: 17 sessions stretch-and-reach task and 14 sessions walk-and-reach task; monkey L: 42 sessions walk-and-reach task). Button release time is the time between the go cue and the release of one of the start buttons. Movement time is the time between the release of one of the start buttons and target acquisition. We analyzed the timing separately for each monkey and separately for all near and all far targets.
We recorded the wrist kinematics of monkey K in seven sessions. For this, we video-tracked the monkey K's right wrist position during the task with other behavioral and neural data. Using a video-based motion capture system (Cineplex Behavioral Research System, Plexon Inc., Dallas, Texas) we can measure the 3-dimensional positions of uniformly colored objects. With four Stingray F-033/C color cameras (Allied Vision Technologies GmbH, Stadtroda, Germany) objects can be tracked at a frame rate of up to 90 fps in VGA resolution. The system was calibrated with a checkerboard reference stimulus according to the Cineplex protocol using the built-in proprietary algorithm. Video processing and object tracking on camera and host PC takes less than 20 ms (camera shutter opening time not included). For synchronization with other data, the system sent a sync pulse every 90 frames to MaCaQuE.
We dyed the wrist of the animals' preferred arms with permanent red hair dye approved for human use (Preference Intensive Red, L'Oréal Paris). The stained fur provided a color object for tracking without the need for the animal to tolerate physical marker objects attached to the body or repeated shaving for visualizing markers on the skin.
To quantify reach trajectories of highly trained behavior, we analyzed five of those seven sessions of which the monkey performed more than 80% successful trials. Due to the attenuated illumination of the Reach Cage, we tracked arm movements from monkey K with 30 fps in the stretch-and-reach task. A total of 980 trials from 1486 successful trials in the seven sessions yielded at least five data points during the trial. Only those trials were included in the analysis. The trajectories were aligned to the button release time. This alignment time point is independent of the sampling time points of the Cineplex system. To quantify variability of the trajectories across trials as a function of time, we synchronized trajectories based on linear interpolation using the same sampling rate of 30Hz. We chose linear interpolation for simplicity since signal reconstruction according to sampling theory did not lead to different results. Further analyses were performed based on the linearly interpolated data. By illuminating all MCTs in different colors during a reference measurement, we were able to register the position of the touch sensitive surface of the MCTs in the same coordinate system as the recorded wrist positions. We oriented the coordinate system to be aligned with the cage. We calculated speed profiles as spatial derivative (difference of adjacent interpolated positions in time) in every trial.
Furthermore, we computed the average wrist trajectory for each target. To quantify the spatial variability of the reaching movement towards a certain target, we computed for each trajectory at each time point the 3-dimensional Euclidean distance to the average trajectory. Then, we averaged the Euclidean distances over all trajectories per target at each time point. From those averages, we calculated the maximum for each target. Additionally, to quantify the variability of a resting hand, we calculated for all targets the mean and standard deviation within the time windows 50 ms to 200 ms before start button release and after target acquisition.
The behavioral analyses were performed using Matlab (Mathworks Inc., Natick, Massachusetts) with the data visualization toolbox gramm (Morel, 2018). Additionally, we used Inventor (Autodesk Inc.) for visualizing the averaged 3-dimensional reach trajectories inside a model of the reach cage.

Implant system design
Wireless neural recordings from the cerebral cortex of rhesus monkeys during minimally restrained movements require protection of the electrode array connectors and the headstage electronics of the wireless transmitters. We designed a protective multi-component implant system to be mounted on the animal skull ( Figure 5). The implant system and implantation technique was designed to fulfill the following criteria: 1) Electrode connectors need to be protected against dirt and moisture; 2) While the animal is not in the experiment, the implants need to be small and robust enough for the animal to live unsupervised with a social group in an enriched large housing environment; 3) During the experiment, the wireless headstage needs to be protected against manipulation by the animal and potential physical impacts from bumping the head; 4) The head-mounted construction should be as lightweight as possible; 5) Placing of the electrode arrays and their connectors during the surgery needs to be possible without the risk of damaging electrodes, cables, or the brain; 6) Implant components in contact with organic tissue need to be biocompatible; 7) Temporary fixation of the animal's head in a primate chair needs to be possible for having access to implants and for wound margin cleaning; 8) Implants must not interfere with wireless signal transmission; 9) Optionally, the implant may serve as colored trackable object for the motion capture system. We designed the implant system for two main configurations: first, a home configuration containing only permanently implanted components and being as small as possible when the animal is not in a recording session but in its group housing ( Figure 5D, left); second, a recording configuration with removable electronic components being attached. This configuration should either fit the 31-channel headstage ( Figure 5D, middle), or the 127-channel headstage ( Figure 5D, right) of the wireless system (W32/W128, Triangle BioSystems International, Durham, North Carolina). The implant system consists of four custom-designed components: a skull-mounted outer encapsulation (chamber; no 1 in Figure 5A/C), a mounting base for holding a custom-designed printed circuit board (adaptor board holder, no 2), a mounting grid to hold the connectors of the electrode arrays (connector holder, no 3), and a set of different-sized caps to contain (or not) the different wireless headstages (no 5-9). Dimensions of the wireless headstages are W32: 17.9 mm x 25 mm x 14.2 mm (W x D x H), 4.5g weight; W128: 28.7 mm x 34.3 mm x 14.2 mm (W x D x H), 10 g weight.
We designed the implants custom-fit to the skull by using CT and MRI scans. Using 3D Slicer (Brigham and Women's Hospital Inc., Boston, Massachusetts), we generated a skull model out of the CT scan ( Figure 5A) and a brain model out of the MRI scan (T1-weighted; data not shown). In the MRI data we identified the target areas for array implantation based on anatomical landmarks (intraparietal, central, and arcuate sulci; pre-central dimple), and defined Horsley-Clarke stereotactic coordinates for the craniotomy necessary for array implantation ( Figure 5B). We used stereotactic coordinates extracted from the MRI scan to mark the planned craniotomy on the skull model from the CT scan. We then extracted the mesh information of the models and used Inventor (Autodesk Inc.) and CATIA (Dassault Systèmes, Vélizy-Villacoublay, France) to design virtual 3-dimensional models of the implant components which are specific to the skull geometry and planned craniotomy. Both monkeys already had a titanium headpost implanted of which the geometry, including subdural legs, was visible in the CT ( Figure 5A, no 4), and, therefore, could be incorporated in our implant design.
We built the chamber to surround the planned craniotomy and array connectors ( Figure 5A/C, no 1). The chamber was milled out of polyether ether ketone (TECAPEEK, Ensinger GmbH, Nufringen, Germany) to be lightweight (monkey K/L: 10/14 g; 65/60.3 mm max. length, 50/49.5 mm max. width, 24.9/31.2 mm max. height; wall thickness: 2/2 mm) and biocompatible. For maximal stability despite low diameter, stainless-steel M2 threads (Helicoil, Böllhoff, Bielefeld, Germany) were inserted in the wall for screwing different protective caps onto the chamber. The built-in eyelets at the outside bottom of the chamber wall allow mounting of the chamber to the skull using titanium bone screws (2.7 mm corticalis screws, 6-10 mm length depending on bone thickness, DePuy Synthes, Raynham, Massachusetts). Fluting of the lower half of the inner chamber walls let dental cement adhere to the chamber wall.
The subdural 32-channel floating microelectrode arrays (FMA, Microprobes for Life Science) are connected by a stranded gold wire to an extra-corporal 36-pin nano-strip connector (Omnetics Connector Corporation, Minneapolis, Minnesota). We constructed an array connector holder to hold up to six of the Omnetics connectors inside the chamber ( Figure 5A/C, no 3). The connector holder was 3D-printed in a very lightweight but durable and RF-invisible material (PA2200 material, Shapeways). The holding grid of the array connector holder is designed such that it keeps the six connectors aligned in parallel with 2 mm space between. The spacing allows to either: 1) connect six 32-channel Cereplex (Blackrock Microsystems LLC, Salt Lake City, Utah) headstages for tethered recording simultaneously on all connectors, 2) directly plug a 31-channel wireless system onto one of the array connectors, or 3) flexibly connect four out of six arrays with adaptor cables to an adaptor board, linking the arrays to a 127-channel wireless system. The total size of the array connector is 27 mm x 16.2 mm incorporating all six connectors. The bottom of the array connector holder fits the skull geometry with a cut-out to be placed above an anchor screw in the skull for fixation with bone cement (PALACOS, Heraeus Medical GmbH, Hanau, Germany). This is needed since the array connector is placed on the skull next to the craniotomy during insertion of the electrode arrays, i.e. before implantation of the surrounding chamber (see below). The medial side of the holding grid, pointing to the craniotomy, is open so that we can slide in the array connectors from the side during the surgery. On the lateral side small holes are used to inject dental cement with a syringe to embed and glue the connectors to the grid.
The 31-channel wireless headstage can be directly plugged into a single Omnetics nano-strip array connector. The 127-channel wireless headstage instead has Millmax strip connectors (MILL-MAX MFG. CORP., Oyster Bay, New York) as input. A small adapter board (electrical interface board, Triangle BioSystems International) builds the interface to receive up to four Omnetics nanostrip connectors from the implanted arrays via adaptor cables (Omnetics Connector Corporation). We constructed a small holder with two M3 Helicoils for permanent implantation to later screw-mount the adaptor board when needed during recording ( Figure 5A/C, no 2). Fluting on the sides of the adaptor board holder helps embedding of the holder into dental cement. Like the array connector holder, the adaptor board holder was 3D-printed in PA2200.
Depending on the experiment and space needed, we used three different protective caps. While the animal was not in an experiment, a flat 4 mm machine-milled transparent polycarbonate cap with rubber sealing protected the connectors against moisture, dirt and manipulations ( Figure 5D, no 5). During experiments, we used two specifically designed protective caps for the two different wireless headstages. Both were 3D-printed in PA2200 in violet color for motion capture. Since the 31-channel wireless headstage is connected to the array connectors directly, it extends over the chamber walls when connected to one of the outermost connectors ( Figure 5D, no 6). We designed the respective protective cap to cover this overlap ( Figure 5D, no 7). The 127-channel wireless headstage ( Figure 5D, no 8) with its adapter board is higher and overlaps the chamber on the side opposite to the connectors. We designed the respective cap accordingly ( Figure 5D, no 9). Since the 3D-printed caps were only used during recording sessions, i.e. for less than 2h, without contact to other animals, and under human observation, we did not add extra sealing against moisture. However, by adding a rubber sealing, the internal electronics would be safe even for longer periods of time in a larger and enriched social-housing environment without human supervision.

Surgical Procedure
The intracortical electrode arrays and the permanent components of the chamber system were implanted in a single sterile surgery under deep gas anesthesia and analgesia via an IV catheter. Additionally, the animal were prophylactically treated with Phenytoin (5-10 mg/kg) for seizure prevention, starting from one week before surgery and continuing until two weeks post-surgery (fading-in over 1 week), and with systemic antibiotics (monkey K: Cobactan 0.032 ml/kg and Synolux 0.05 ml/kg one day pre-surgery and two days post-surgery; monkey L: Duphamox, 0.13 ml/kg, one day pre-surgery to one day post-surgery). During craniotomy, brain pressure was regulated with Mannitol (monkey K/L: 16/15.58 ml/kg; on demand). Analgesia was refreshed on a 5-h cycle continuously for four post-surgical days using Levomethadon (0.28/0.26 mg/kg), daily for one/three post-surgical days using Metacam (0.24/0.26 mg/kg) and for another four days (Rimadyl, 2.4/1.94 mg/kg) according to demand.
We implanted six FMAs in the right hemisphere of both monkeys. Each FMA consists of 32 Parylene-coated Platinum/Iridium electrodes and four ground electrodes arranged in four rows of nine electrodes (covering an area of 1.8 mm x 4 mm) staggered in length row-wise. Two FMAs were placed in each of the three target areas: parietal reach region (PRR), dorsal premotor cortex (PMd) and arm-area of primary motor cortex (M1). PRR arrays were positioned along the medial wall of the intraparietal sulcus (IPS) starting about 7 mm millimeters away from the parieto-occipital sulcus ( Figure 5B), with electrode lengths of 1.5 -7.1 mm. M1 arrays were positioned along the frontal wall of the central sulcus, at a laterality between precentral dimple and arcuate spur, with electrode lengths of 1.5 -7.1 mm. PMd arrays were positioned, between arcuate spur, precentral dimple and the M1 arrays, with electrode lengths of 1.9 -4.5 mm.
Except for the steps related to our novel chamber system, the procedures for FMA implantation were equivalent to what was described in (Schaffelhofer, Agudelo-Toro, & Scherberger, 2015). The animal was placed in a stereotaxic instrument to stabilize the head and provide a Horsley-Clarke coordinate system. We removed skin and muscles from the top of the skull as much as needed based on our pre-surgical craniotomy planning. Before the craniotomy, we fixed the array connector holder to the skull with a bone screw serving as anchor and embedded in dental cement on the hemisphere opposite to the craniotomy. After removing the bone with a craniotome (DePuy Synthes) and opening the dura in a U-shaped flap for later re-suturing, we oriented and lowered the microelectrode arrays one-by-one using a manual micro-drive (Narishige International Limited, London, UK), which was mounted to the stereotaxic instrument on a ball-and-socket joint. Before insertion, the array connector was put into our array connector holder and fixed with a small amount of dental cement. During insertion, the array itself was held at its back plate by under-pressure in a rubber-coated tube connected to a vacuum pump which was attached to the microdrive. We slowly lowered the electrodes about 1 mm every 30 seconds until the back plate touched the dura mater. We let the array rest for four minutes before removing first the vacuum and then the tube.
After implanting all arrays, we arranged the cables for minimal strain and closed the dura with sutures between the cables. We placed Duraform (DePuy Synthes) on top, returned the leftover bone from the craniotomy and filled the gaps with bone replacement material (BoneSource, Stryker, Kalamazoo, Michigan). We sealed the craniotomy and covered the exposed bone surface over the full area of the later chamber with Super-Bond (Sun Medical Co Ltd, Moriyama, Japan). We secured the array cables at the entry point to the connectors and filled all cavities in the array connector holder with dental cement. We mounted the chamber with bone screws surrounding implants and craniotomy, positioned the adaptor board holder, and filled the inside of the chamber with dental cement ( Figure  2C). Finally, we added the flat protective cap on the chamber.

Neural recordings
Neural recordings were conducted in both monkeys during the delayed walk-and-reach task in the Reach Cage. The 31-channel wireless headstage (W32) recorded from a single array per session ( Figure 5D, no 6), allowed headstage placement on any of the six array connectors. Alternatively, we used the 127-channel headstage (W128) recording from four arrays simultaneously ( Figure 5D, no 8). The headstage amplifies the input voltage by a gain of 200 and transmits the analog signal with 3.05 GHz (W32) or 3.375 GHz (W128) transmission frequency to the receiver.
We used a 128-channel Cerebus system (Blackrock Microsystems LLC) for digitization and signal processing. The wireless receiver and an adapter, connected to the receivers output, reduce the overall gain to 1. The W32 system and W128 system have their own specific receiver, but we used the same Cerebus system for both wireless systems. 32-channel Cereplex headstages are connected to the adapter and digitize the signal with 30 kHz. MaCaQuE sends the trial number at the beginning of each trial to the parallel port of Cerebus system. We connected an additional shift register M74HC595 (STMicroelectronics) to the GPIO port of MaCaQuE for interfacing the Cerebus parallel port. The Cerebus system records the trial number along with a time stamp for offline data synchronization.
We performed the preprocessing of broadband data and the extraction of waveforms as previously described (Dann et al. 2016). First, the raw signal was high-pass filtered using a sliding window median with a window length of 91 samples (~3 ms). Then, we applied a 5000 Hz low-pass using a zero-phase second order Butterworth filter. To remove common noise, we transformed the signal in PCA space per array, removed principle components that represented common signals and transformed it back (Musial, Baker, Gerstein, King, & Keating, 2002). On the resulting signal, spikes where extracted by threshold crossing using a negative or positive threshold. We sorted the extracted spikes manually using Offline Sorter V3 (Plexon Inc., Dallas, Texas). If single-unit isolation was not possible, we assigned the non-differentiable cluster as multi-unit, but otherwise treated the unit the same way in our analysis. The spike density function for the example units were computed by convolving spike trains per trial and per unit with a normalized Gaussian with standard deviation of 50 ms. The spike density function was sampled at 200 Hz.
We analyzed the firing rate of example units with respect to four different temporal alignments: target cue onset, go cue, start button release and target acquisition. To quantify neural activity during the delay period and the movement, we analyzed time windows of 500 ms either immediately before or after a respective alignment. Within those time windows we analyzed the modulation of firing rate relative to the position of the reach targets. The target setting provides a 2x4 design with factors distance (near, far) and direction (outer left, mid left, mid right, outer right). To show if firing rate is modulated with distance (considering all eight targets) or direction within a fixed distance (considering only four targets respectively), we calculated Kruskal-Wallis tests with a 5% alpha level. Additionally, we quantified the extent of modulation with a modulation index. The modulation index with respect to distance, near direction and far direction is reported as distMI, nearMI and farMI respectively. To calculate nearMI and farMI we computed the average firing rate (fr) for each target. The modulation index is then defined for all near (nearMI) or all far (farMI) targets as max(f r)−min(f r) min(f r)+max(f r) . For the distMI we averaged the firing rate across all near and all far targets and calculated the modulation index the same way. This is equivalent to |f rnear−f r f ar | f rnear+f r f ar . Modulation indices range from 0 to 1 with 0 indicating no modulation and 1 maximum modulation.
Raw data and spike data processing was performed with Matlab and visualized using the toolbox gramm (Morel, 2018).
training and Janine Kuntze, Luisa Klotz and Dirk Prüße for technical support.
This work was supported by the German Research Foundation (DFG RU-1847, grant GA1475-C1 to A. Gail) and the European Commission in the context of the Plan4Act consortium (EC-H2020-FETPROACT-16 732266 WP1 to A. Gail).