Source (or Part of the following Source): Type Article Title Real-time Position Reconstruction with Hippocampal Place Cells. Author(s) Real-time Position Reconstruction with Hippocampal Place Cells

Copyright It is not permitted to download or to forward/distribute the text or part of it without the consent of the author(s) and/or copyright holder(s), other than for strictly personal, individual use, unless the work is under an open content licence (like Creative Commons). UvA-DARE is a service provided by the library of the University of Amsterdam (http://dare.uva.nl) Brain–computer interfaces (BCI) are using the electroencephalogram, the electrocorticogram and trains of action potentials as inputs to analyze brain activity for communication purposes and/or the control of external devices. Thus far it is not known whether a BCI system can be developed that utilizes the states of brain structures that are situated well below the cortical surface, such as the hippocampus. In order to address this question we used the activity of hippocampal place cells (PCs) to predict the position of an rodent in real-time. First, spike activity was recorded from the hippocampus during foraging and analyzed off-line to optimize the spike sorting and position reconstruction algorithm of rats. Then the spike activity was recorded and analyzed in real-time. The rat was running in a box of 80 cm × 80 cm and its locomotor movement was captured with a video tracking system. Data were acquired to calculate the rat's trajectories and to identify place fields. Then a Bayesian classifier was trained to predict the position of the rat given its neural activity. This information was used in subsequent trials to predict the rat's position in real-time. The real-time experiments were successfully performed and yielded an error between 12.2 and 17.4% using 5–6 neurons. It must be noted here that the encoding step was done with data recorded before the real-time experiment and comparable accuracies between off-line (mean error of 15.9% for three rats) and real-time experiments (mean error of 14.7%) were achieved. The experiment shows proof of principle that position reconstruction can be done in real-time, that PCs were stable and spike sorting was robust enough to generalize from the training run to the real-time reconstruction phase of the experiment. Real-time reconstruction may be used for a variety of purposes, including creating behavioral–neuronal feedback loops or for implementing neuroprosthetic control. the cortical surface. In order to address this question we used the activity of hippocampal place cells (PCs) to predict the position of an animal (rat) in real-time. Neural cells with spatially modulated firing have been found in almost all areas …

the cortical surface. In order to address this question we used the activity of hippocampal place cells (PCs) to predict the position of an animal (rat) in real-time.
Neural cells with spatially modulated firing have been found in almost all areas of the hippocampus and in some surrounding areas, such as medial entorhinal cortex (Hafting et al., 2005). Hippocampal PCs may provide a representation of an animal's position in its environment and recent data suggests also timedependent episodic coding (Leutgeb et al., 2005;Pastalkova et al., 2008;Rennó-Costa et al., 2010). Their background firing rate is low, but when an animal enters the receptive field of the neuron, its firing rate rapidly increases (to a maximum between 5 and 30 Hz; O' Keefe and Dostrovsky, 1971). This specific location is called the place field (PF) of that particular neuron.
Animals use different cues to navigate and to build cognitive environmental representations which can be divided into idiothetic (self-motion) and external landmarks (Knierim et al., 1998).

IntroductIon
Brain-computer interfaces (BCI) are using the electroencephalogram (EEG), the electrocorticogram (ECoG), and trains of action potentials as inputs to analyze brain activity for communication purposes and/or the control of external devices (McFarland et al., 2008;Schalk et al., 2008;Velliste et al., 2008). The major difference between the three types of measures is their spatial resolution. In humans, scalp EEG provides a spatial resolution of several centimeter, ECoG of several millimeter and spikes of several micrometer. EEG and ECoG based BCI systems use mostly motor imagery and evoked potentials (Wolpaw et al., 2003;McFarland et al., 2008;Guger et al., 2009;Pfurtscheller et al., 2010). BCI systems based on spikes have thus far used action potentials from the primary motor area that allow monkeys or humans to control robotic devices or computer systems (Hochberg et al., 2006;Velliste et al., 2008). Thus far it is not known whether a BCI system can be developed that utilizes the states of central brain structures located well below Guger et al. Real-time position reconstruction

off-lIne posItIon reconstructIon
For off-line position reconstruction the following tasks have to be performed (see Figure 1): (1) Data acquisition: first training data has to be acquired of a rat moving around in a two-dimensional space. Therefore the x-and y-positions of the rat have to be acquired with sufficient time resolution to capture the movements of the animal accurately. Implanted electrodes connected to an amplifier are used to record action potentials from the hippocampus together with the rat's position information. The recording must last long enough to ensure that the rat visits each position of the arena. The tracking data must be available continuously throughout the whole recording and spike amplitudes have to be checked for artifacts. (2) Encoding step: manual spike sorting is performed to assign to each spike a certain neuron number, to be able to distinguish activity of different neurons and to remove noise. This results in spike templates for automatic spike sorting and allows to calculate firing rate maps in order to identify PFs of the recorded cells. The firing rate maps and tracking information are used as training data for a position reconstruction algorithm.
(3) Decoding step: in this step spiking activity, recorded from a different time segment than in (2), but from the same rat and the same session, is used as input into the position reconstruction algorithm to reconstruct (decode) the trajectories of the rat's movements occurring during the period that very same spike trains were recorded. (4) Accuracy calculation: the reconstructed position based on spikes is compared with the animal's real position acquired with the tracking system to calculate the accuracy of the procedure.

off-lIne experIments and recordIng setup
For the off-line experiments action potential data were recorded from three rats from CA1 or subiculum at IDIBAPS (Barcelona) and the Institute of Cognitive Neuroscience (University College London, UCL). Recording details are given in Table 1. The rats were chronically implanted with a microdrive and tetrodes were used for the recordings. The electrodes were connected to the recording system (sampling rate 48 Hz, bandpass: 300 Hz-6 kHz) via a headstage amplifier. For tracking the rat's position, small infrared light-emitting diodes (LEDs) were attached to the rat's head and a video camera was mounted above the experimental arena. The sampling frequency for the position-tracking signal was 48 Hz (IDIBAPS) and 46.875 Hz (UCL). Animals were food-deprived up to 80% of their original weight after which recordings commenced. Grains of sweetened rice were thrown in the enclosed environment every 20 s at random locations within the open field, keeping the animal in continuous locomotion, thereby allowing a complete sampling of the environment. IDIBAPS rats were cared for and treated in accordance with Spanish regulatory laws (BOE 256;October 25, 1990) which comply with the EU guidelines on protection of vertebrates used for experimentation (Strasbourg March 18, 1986). The animal care facility is registered with the number B9900020 and is regulated by the Real Decreto (Español) Rodents use landmarks to guide them to specific locations and they find the way back without landmarks by using self-motion cues known as path integration (O'Keefe and Conway, 1980;Etienne, 1992). In blind rats, Save et al. (1998) showed that self-motion (idiothetic) information in conjunction with stimulus recognition is sufficient for normal firing of PCs. However, path integration tends to accumulate errors over time and therefore a re-calibration by fixed external landmarks is required (Poucet et al., 2003). Both cells in the hippocampus proper (CA1) and subiculum show location related firing patterns. CA1 cells provide a spatial representation of the environment, and can even show multiple maps for one environment when environmental cues are changed (Leutgeb et al., 2005;Rennó-Costa et al., 2010). In contrast, subicular cells provide a representation of the geometric relationships between different locations in an environment (Sharp, 1997(Sharp, , 1999. Parasubicular and subicular PCs tend to show higher levels of background activity and have larger PFs than hippocampal PCs (CA1; Taube, 1995).
Place cells were used to reconstruct the path of rats by investigating their firing patterns (Wilson and McNaughton, 1993;Brown et al., 1998;Zhang et al., 1998;Jensen and Lisman, 2000;Barbieri et al., 2005). All of these studies used hippocampal PCs, with large numbers of simultaneously recorded neurons, in two cases using linear tracks (Zhang et al., 1998;Jensen and Lisman, 2000), in two other cases circular environments (Brown et al., 1998;Barbieri et al., 2005), and in one case in a rectangular environment (Wilson and McNaughton, 1993). In these studies the spike information and position of the rat were recorded first before position reconstruction methods were applied off-line. For reconstruction Template Matching and Bayesian methods were investigated. In general a Bayesian two-step algorithm taking into account the previous position of the rat performed best and was tested by several groups (Brown et al., 1998;Zhang et al., 1998;Jensen and Lisman, 2000;Barbieri et al., 2005). Importantly, data of the same run was used for training and for testing the performance.
In this study we test whether the rat's position can be reconstructed in real-time using training data acquired before the actual experiment. For this task it is important that all steps including data acquisition, visualization of spikes, storage, spike sorting, and position reconstruction are done in real-time without delay. In this way, PC firing can be used to provide on-line feedback to the rat to manipulate its behavior and possibly manipulate underlying cognitive processes. First we investigate three different rats foraging in a rectangular environment. For the position reconstruction a Bayesian two-step algorithm was implemented and tested to identify the important parameters of the algorithm. We tested how neurons of CA1 and neurons with larger PFs than those found in CA1, such as subicular neurons, perform in this environment. Then we implemented a spike sorting algorithm that works also in real-time with high accuracy and speed and compared it to manual and automatic spike sorting results (done off-line). Based on these results we started the real-time position reconstruction experiments with one rat to test reconstruction accuracy using previously recorded training data and to test whether all analysis tasks could be performed fast enough to support real-time reconstruction.
FIgure 1 | Spikes and tracking information were acquired and the first 50% of the data were used for the encoding step, the last 50% were used for the decoding. Then in the encoding step first the data were manually sorted and firing rate maps and spike templates were calculated from the spike trains. From the position-tracking data the probability distribution was calculated. In the decoding step the spikes are automatically sorted with the spike templates calculated before. Then the firing rate of each neuron was calculated and passed together with the probability distribution of position and with the firing rate maps into the Bayesian two-step algorithm. The Bayesian two-step algorithm returns the reconstructed position and was compared to the position coming from the tracking system to calculate the overall accuracy of the reconstruction procedure. In real-time mode instead of splitting the data in 50% parts, one run was performed for the encoding and later on another run was performed for the real-time decoding step. The optimal reconstruction window was 3 s and the step size 0.5 s for all rats.
The reconstruction algorithm can be improved off-line by tweaking several parameters: (i) length of reconstruction window: this defines the degree of averaging the spiking activity over time; (ii) step size for shifting the reconstruction window forward after each iteration, (iii) smoothing factor of PFs: firing rate and spatial occupancy distributions were smoothed using a rectangular filter. This reduced the influence of outliers on the reconstruction result. (iv) The minimum number of spikes within each reconstruction window: if this parameter is set to a value m higher than zero, the reconstruction is only performed for windows that include at least m spikes. If this condition is not fulfilled the reconstruction for this step is skipped and the position is interpolated. Setting m to a high value affects the reconstruction accuracy but also reduces the number of time points where the reconstruction can be performed at all. (v) The number of PCs. It is important to find a parameter combination yielding the best reconstruction result. Therefore the reconstruction accuracy was compared for different parameter combinations and the optimal was selected (length of reconstruction window: 0.5, 1-10 s in steps of 1; step size: 100, 200, 500, 1000, 2000 ms; smoothing factor: 5 × 5 to 30 × 30 in steps of 1 × 1). The datasets were divided into two equally long parts. Algorithm training (encoding) was performed on the first half of each recording session, while the remaining 50% was used for decoding (reconstruction). Figure 2 shows the reconstruction results computed with the Bayesian two-step algorithm for one recording (rat 2) of 477 s length. Data from seconds 0 to 240 were used to train the algorithm and the interval 241-477 was used to test the accuracy of the method.

off-lIne results
To calculate the reconstruction error, the reconstructed position was compared to the position known from the position-tracking data. Figure 2 shows that the reconstructed path follows the real path for many data points of the recording. In this case the median reconstruction error was 9.4 cm or 13.3%. The graph illustrates some erratic jumps of the reconstructed path in both x-and y-coordinates (e.g., at seconds 280, 365, 415,…) which were mostly caused by a drop in firing rate. Table 1 compares reconstruction performance for different spike sorting methods for all rats. Spikes were sorted (i) manually, (ii) with the KlustaKwik (Harris et al., 2000;Redish, 2008) algorithm using the energy, amplitude, and first principal component of spike waveforms, (iii) with the 3σ method and, (iv) in real-time mode with the 3σ real-time method. The 3σ method will be described below. For methods i-iii the spike sorting was performed for the first 50% of the data of a session to yield training data and for the last 50% of the session to have testing data. The firing field was calculated only from the training data and the position reconstruction algorithm was trained only with the training data. For the realtime operation it is not possible to sort the spikes in advance and therefore a real-time sorting algorithm was developed. This means that only information from the training data can be used to sort the spikes of the testing data and this is tested with the method iv.
The real-time 3σ method uses the manual sorting results as input to calculate average spike waveforms for each neuron. Additionally the SD of the maximum and the minimum voltages 1201 October 1, 2005. UCL rats handling and care were conducted under Home Office licensing according to the guidelines in the Animals (Scientific Procedures) Act of 1986.
The reconstruction was tested in square arenas of different sizes. The size of the arenas leads also to the maximum theoretical position reconstruction error by calculating the diagonal distance (e.g., 70 cm*SQRT(2) = 99 cm). The recording duration was between 240-1244 s.

off-lIne posItIon reconstructIon algorIthm
First, the recorded spike activity was used as input for the manual spike sorting procedure to separate neuronal activity picked up by the electrodes into single cell activity. To carry out the sorting between spikes, amplitudes, shapes, and timing of the spikes were compared across different electrodes. Units were only included for further analysis if no spike was present in the first millisecond of the interspike interval histogram (ISIH). In real-time mode the spike sorting must be done automatically. Therefore the resulting templates from the manual sorting were used to resort the spike activity to simulate the real-time procedure.
Next, firing rate maps were created based on spike and tracking information. The arena was divided into subsets of space (64 × 64) and a specific class (unique ID) was assigned to each pixel. This led to an edge length for each pixel of, e.g., 1.09 cm for rat 1. The firing rate for each class was calculated by counting the number of spikes within this location. Afterward these firing rate maps were spatially smoothed with a window of specific length (Smoothing Kernel in Table 1).
For position reconstruction the Bayesian two-step algorithm with continuity constraint was implemented (Zhang et al., 1998). The probability of being at position x, given the number of spikes n of all the cells within the time window is where P(x) is the rat's position distribution, f i (x) is the average firing rate of cell i at position x, N is the total number of PCs, ∆ is the length of the time window. The most probable position will be regarded as the animal's position: A continuity constraint can improve the accuracy of reconstruction by reducing sudden jumps in the reconstructed path by incorporating the reconstructed position from the preceding time step and speed information (e.g., Barbieri et al., 2005). This gives the Bayesian two-step algorithm: The firing rates of all cells within a sliding time window were compared with the firing rate vectors of each pixel that were set up in the training phase. A pixel number (e.g., 8 out of 64 × 64) was returned which identified the reconstructed position. Then the time window was shifted to the next reconstruction position.
(2) Real-time spike sorting: is performed by comparing incoming spikes with templates to assign each spike to a specific neuron and to remove noise. For the real-time experiments tetrodes were implanted in one rat at IDIBAPS and connected to a lightweight headstage amplifier. The headstage amplifier was mounted with a microdrive on the head of the rat and was connected with a flexible cable to the main biosignal amplifier that sampled the data with 38.4 kHz. The amplifier used for each channel a 24 Bit analog to digital converter and oversampling for high data quality. The data were transmitted with a USB interface to a laptop computer running Microsoft Windows. The video based tracking system was mounted above the arena of the rat and acquired the x-and y-positions of the rat with 50 Hz resolution. For the real-time analysis g.USBamp Highspeed On-line Processing for Simulink (g.tec medical engineering GmbH, Austria) was used. This environment uses hardware interrupt controlled data transfer to operate the Simulink model in real-time. The real-time model is shown in Figure 3.
The g.USBamp amplifier device driver reads in the data into Simulink and the data are converted to double precision. Then the tetrodes (up to four in the model) are re-referenced by performing bipolar derivations. Next, the data is bandpass filtered between 300 Hz and 6 kHz to remove artifacts. The spike threshold Detection of spike traces are calculated. Next, these averages were used as templates to automatically sort the spikes. In real-time mode, the algorithm computes for each newly recorded spike the differences to all existing neuron-templates. At each sample point the difference is calculated and the results are summed up. The neuron whose template has the smallest distance to the new spike is identified as the one to which that spike belongs. When noise is recorded the algorithm would assign it to the template having the smallest distance to it, no matter what the signal looks like. To be able to distinguish noise from neuronal signals, the SD of the maximum and minimum of the waveform templates were considered. Therefore a 3σ border of all maxima and minima was calculated to define borders for spike acceptance for every lead. Small spikes hidden in the background noise were already rejected by the thresholding done for spike acceptance. Table 1 shows that the median position reconstruction error for all four spike sorting methods for each rat and an average for all recordings. The manual spike sorting reached on average the lowest error rate of 14.4%, followed by the 3σ methods with 15.6 and 15.9%. But in general all methods had a very similar performance. Of special importance is that the 3σ and 3σ real-time methods gave almost the same results.

real-tIme experIments
In real-time mode the following steps must be performed (also shown in Figure 1): (1) Real-time data acquisition: action potentials are recorded together with tracking information, but now the tracking information is just recorded to evaluate the performance of the system afterward. then the real-time experiment was started. In session 1 only one real-time recording (RT) was done, in session 2 two real-time recordings were performed, denoted as 2A and 2B. The median error of the training sessions was 13.9% (equal training and testing data) and of the real-time sessions 14.7%. For comparison, the best off-line reconstruction result had a relative error of 13.3% (eight neurons). Figure 4 shows the reconstructed trajectory for seconds 200-500 including error and speed of the session 1, RT.

dIscussIon
We have addressed the question whether the position of an animal can be reconstructed in real-time from neuronal data. Off-line and real-time position reconstruction algorithms for neural spike trains were successfully implemented and applied to PC activity. Of special importance is that the whole system is able to perform the reconstruction in real-time and that previously acquired training data can be used for the encoding step. In the experiments the training data were acquired about 1 h before the real-time experiment. Interesting for future experiments will be to investigate how long in advance this training data can be acquired as different process such as learning and neuronal plasticity might affect unit response in subsequent recording sessions. blocks compare the data to a user controlled threshold. If a spike is detected, a 1-ms-wide (200 μs before and 800 μs after the spike) segment of all four channels per tetrode is stored and visualized.
After a spike is detected the neuron ID is written into a continuously updating ring-buffer with 500 ms length to calculate the current firing rate of all neurons. Spikes detected within a time window of, e.g., 3 s are considered for firing rate calculation and therefore for the reconstruction. Next, the window was moved forward by 500 ms. The firing rates calculated in this way are compared with the firing rates at all positions of the training (encoding step). The position paired with the firing rate most similar to the actual firing rate is the predicted position as was computed with the Bayesian two-step algorithm (Real-time Reconstruction block).
Finally the reconstructed position can be compared to the real position with the X, Y PLOT block and both are stored for later off-line analysis.
The real-time tests were performed with one rat and two sessions as shown in Table 2. In session 1 initially 900 s of data and in session 2 865 s of data were recorded to perform the encoding step. Then the procedure described under the off-line section was performed to obtain firing rate maps, probability distribution, and spike templates with 100% of the data. All data were used to have as much as possible training data. This took about 1 h and  that the spikes of the RT run were never seen before for any training purposes. In future studies it must be shown how reliable the method is for different animals. We have demonstrated that the path reconstruction system described works for different sets of neurons of different sizes. Rather than depending on the variability across animals, the success of the technique may depend on the characteristics of the PFs for a given set of neurons. Thus, when a given set of neurons has PFs covering a larger area of the maze, the reconstruction would be more reliable. If during the recording there would be any plasticity of PFs for example because landmarks are modified, then the reconstruction would be negatively affected. Thus, the path reconstruction will be valid for a particular set of neurons with stable PFs, the training of the algorithm being useful for that set. It is not to be applied to a different set of neurons or to a different animal. In future studies the system can be tested in larger numbers of animals and neuronal sets, to further test the robustness of the reconstruction. Theoretically the reconstruction error is inversely proportional to the square root of the number of cells as reported in several publications (Wilson and McNaughton, 1993;Skaggs et al., 1996;Zhang et al., 1998). Wilson reported an error of 33 cm with 10 cells and Zhang of 25 or 11 cm for 10 cells. Wilson and McNaughton (1993) investigated the amount of cells theoretically needed for reaching a tracking error of less than 1 cm and an extrapolation yielded 110 cells. Jensen and Lisman (2000) reported that with a relatively low number of cells (∼5) accuracies of about 12 cm can be reached. In this publication a minimum error of 9.4 cm was reached with only eight cells for off-line algorithms and a minimum error of 13.8 cm in real-time with only five cells. This shows that even with a few cells reconstruction can already be performed. But of course the presence, location, and size of PFs play an important role. Large errors occur if space is uncovered by lack of spikes and lack of cells. It must be noted that for this analysis no time periods were neglected like done in other publications (e.g., Fenton and Muller, 1998). Different accuracies in position reconstruction have been reported in different studies. Zhang et al. (1998) reached classification accuracies of about 4-10 cm with 30 and 25 cells in two rats. These rats were tested in a figure-8 maze and another maze shaped like the upper part of the eight. The width of the track was 6.4 cm and the size was 94 cm × 81 cm. Jensen and Lisman (2000) reported an accuracy of 3 cm with 38 neurons (linear track with 204 cm length and 8 cm width) for one rat by using only intervals with more than nine spikes and no foodstand locations (without large irregular activity, LIAs). If all data was used, an error of 15.4 cm was reached with only spike rate information and 14.4 cm by using also theta phase information. Brown et al. (1998) reported an accuracy of about 7.7 and 8.0 cm for two rats with 33 and 34 cells, using an open circular maze of 70 cm diameter. Barbieri et al. (2005) achieved an error of 5.1 cm in a 70-cm diameter circular environment with 44 neurons. In a rectangular environment (124 cm × 62 cm) Wilson reported an error of about 9 cm with 76 cells. In general it must be noted that the intrinsic tracking error, which is defined as the average uncertainty in position tracking, due to the size of the LED arrays, the elevation of the diodes above the rat's head and variations in posture is about 5 cm (Skaggs et al., 1996). In our study the arenas were between 50 cm × 50 cm and 100 cm × 100 cm in size, and the rats were foraging in an open square field which required reconstruction in both x-and y-dimensions. The open field was divided into 64 × 64 bins giving in total 4096 possible positions, which is far more than considered, e.g., for linear tracks (e.g., 150 bins in Jensen and Lisman, 2000). But there were three major differences between Jensen's and our study: (i) no segments were excluded and (ii) for the real-time experiment, the training and testing data were not from the same run, but from runs contiguous in time, (iii) less cells were used. All three conditions make the reconstruction more difficult. Of special importance is also that for the real-time experiment only the training data was used to obtain templates for the automatic spike sorting. This means coding). We wanted to implement a system that could also be used as a real-time system and therefore spike firing from future periods of time were not included in our study (see also Brown et al., 1998). This may have imposed a further limit on reconstruction quality. The step size had a minor influence on accuracy and 500 ms appeared to be optimal for the accuracy and it is also relatively short compared to a 3-s time window.
The spike sorting algorithm used in this paper requires some training data to identify spike templates for real-time sorting. A disadvantage of real-time sorting algorithms is that neurons of which waveforms are changing during recording cannot be identified after the training stage (Chandra and Optican, 1997;Aksenova et al., 2003). Therefore real-time spike sorting algorithms without the need of a learning phase are developed (Rutishauser et al., 2006). This is of special importance for closed-loop experiments which adapt experimental stimuli to the neural response observed. In some previous position reconstruction papers the spike sorting was done with all the data and for the encoding and decoding steps the data were split (e.g., Brown et al., 1998). In the current paper it was important to get all of the parameters for spike sorting only from the training data to allow the sorting in real-time mode. This was realized with the 3σ method that performed comparably to well known sorting methods (manual sorting, KlustaKwik).
The position reconstruction was also possible with subicular units, but was more accurate with CA1 units which have smaller PFs (Taube, 1995;Sharp, 1997). This was of course just tested with one recording but it is interesting that subicular units contain enough information for the reconstruction. Hippocampal and subicular regions work together, possibly to provide the overall cognitive mapping abilities of the animal (Sharp, 1997). For the real-time experiments CA1 was used because of the higher accuracy achieved here but for future experiments it will be interesting to perform reconstruction using both types at the same time. More datasets will be recorded in future to compare the two regions.
Hippocampal activity is also depending on theta activity (O'Keefe and Recce, 1993). The phase of firing becomes earlier on each successive theta cycle the animals runs through its' PF. Huxter et al. (2008) demonstrated that phase precession occurs in both linear and two-dimensional environments and that position and heading can be predicted from neural activity at different theta phases. Heading information can be best recovered from ascending slopes of theta oscillations and position reconstruction optimally from descending slopes. Jensen and Lisman (2000) found that reconstruction is improved when phase coded and rate coded information are both considered. But this was only the case when epochs with large systematic error were excluded first. For the real-time reconstruction it is not possible to exclude epochs and therefore it was not implemented for the real-time experiments. Furthermore the optimal time window for reconstruction was around 3 s which spans several theta cycles and averages out the phase information.
Trying to reconstruct the animal's path based on the firing of a small set of neurons is not only a technological achievement. By doing it, we try to understand how the hippocampus and the brain integrate information from PCs in order to codify position and to construct a map of space. Something that we have learnt is that a few neurons are sufficient to reconstruct with certain accuracy the trajectory of an animal. This finding suggests that there is quite Erratic jumps in reconstruction accuracy can occur for different reasons. The firing rate is modulated by speed, and often decreases when the animal stops and receives food rewards and therefore stopping was often associated to visiting the home base or to eating (Tchernichovski et al., 1998). This increased the chance for errors and artifacts in the recorded data. There may be also biological reasons for the erratic jumps, maybe due to the rat looking around or planning the next move (Johnson et al., 2005). Jensen and Lisman (2000) have shown that by using both phase information and rate information the reconstruction error can be improved. In this case also theta cycles must be identified to investigate the firing at specific theta phases. But the improvement is reduced if large systematic error sources affect the reconstruction. Jensen and Lisman (2000) showed that erratic jumps can be reduced if the reconstruction is only performed for time windows with a minimum of spikes present. Furthermore when an animal is eating, LIA and sharp waveripples occur which are associated with replay and thus yields larger errors (Foster and Wilson, 2007;Lansink et al., 2009). As already mentioned in the results section, minimizing the reconstruction to points where the firing rate is above a certain threshold yielded better reconstruction results for certain segments of space. But it does not reduce the overall error rate much, because the positions that have not been reconstructed have to be interpolated. This estimation leads to new reconstruction errors for the interpolated positions, and thus increases the error rate. Important to note is also that for a real-time system every single time point should be reconstructed and therefore no data were excluded.
The length of the reconstruction window defines how many spikes are used for the reconstruction and is therefore dependent on the firing rate of the neurons and the rat's running speed. In theory the error is inversely proportional to the square root of the time window. While Zhang et al. (1998) and Brown et al. (1998) used windows of about 1 s length we found that a relative long time window of 3 s yielded the best results, which can be explained by the lower amount of cells used. Also Wilson and McNaughton (1993) showed an improved accuracy by increasing the window length from 0.1 to 4 s. Jensen and Lisman (2000) showed that even with short windows of about 100-500 ms good accuracy can be reached, but excluded epochs with less spikes. In our case, using a time window of 3 s, the time steps that contained no spikes were below 0.5% of total recording time, and therefore their influence can be neglected. It must of course be noted that a rat can run longer distances if the window length increases.
We found that the selection of the PF smoothing Kernel is of relevance for the reconstruction. Zhang et al. (1998) reported that the reconstruction was not sensitive to the spatial blurring Kernel. The difference in findings may depend on the number of simultaneously recorded cells included: the lesser number of cells, the larger the impact each one of the PFs has on the global computation. Thus, larger PFs overlap more easily with other PFs and this increases the joint firing rate and yields a lower error rate. But this advantage is counterbalanced by the fact that larger PFs hold less spatial information. In this study the optimal smoothing Kernel was calculated in the off-line procedure.
In previous studies (Zhang et al., 1998) the time window used for position reconstruction included spike information not only from the past (retrospective coding) but also from the future (prospective some redundancy in the system and opens the question of why this redundancy is necessary, and what are all the different spatial and non-spatial aspects that PCs are coding. It also reveals that our system works for a stable set of PCs, while the hippocampus can deal with PFs which can be rather plastic, while the spatial representation remains stable. With the system described here, one could explore under which conditions our reconstruction algorithm could maintain a stable path reconstruction while some landmarks, and thus some PFs, would change.
For a BCI application based on PCs it has to be assumed that a rat could be trained in a closed-loop experiment to modulate its own PC activity. In a first run the rat learns its environment and generates particular patterns of PC activity at various places in the arena. If the animal would only receive a rewarding stimulus when it visits a particular position in space where a specific PC fires, one may ask whether the activity of this PC would be enhanced. Another question is whether the rat is able to modulate PC firing voluntarily.
The system can also be seen as a verification method of the prior characterization of the environment and allows us the express stability with a certain accuracy rate. This allows of course also to express changes of the environment to study varying environments. The spatial characterization of the environment is specific for the training arena and can therefore not be applied to unknown spatial contexts. But this is also the case for other neuroprosthetic applications that must be trained, e.g., on a specific types of movement.
The closed-loop experimentation and analysis system proposed here allows to evaluate the quality of PC recordings in real-time and helps to reduce the recording time. The real-time system allows researchers on the fly to check whether the spikes are sortable and not contaminated with noise. Furthermore, it can be used to change, e.g., arena properties and or provide direct neuronal stimulation during the recording to investigate changes in PFs. As such it introduces a new range of closed-loop systems for the study of cognition and behavior and their neuronal substrate. Our study showed successfully that deeper brain structures can be analyzed in real-time which could be useful for future neuroprosthetic applications.