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 .
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 ;
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 .
thus far it is not known whether a bci system can be developed that utilizes the states of central brain structures located well below 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 ) .
pcs may provide a representation of an animal 's position in its environment and recent data suggests also time - dependent episodic coding ( leutgeb et al .
, 2005 ; pastalkova et al . , 2008 ; renn - costa et al . ,
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 ) .
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 . ,
in contrast , subicular cells provide a representation of the geometric relationships between different locations in an environment ( sharp , 1997 , 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 ;
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
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 .
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 .
for off - line position reconstruction the following tasks have to be performed ( see 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
. 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 .
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 .
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 .
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 .
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 . 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 ) .
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 hz6 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 ( espaol ) 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 . recording information of the off - line experiments ( three rats ) and off - line position reconstruction error relative to arena diagonal for manual and automatic spike sorting procedures .
the optimal reconstruction window was 3  s and the step size 0.5  s for all rats .
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 2401244  s. 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
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
therefore the resulting templates from the manual sorting were used to resort the spike activity to simulate the real - time procedure .
the arena was divided into subsets of space ( 64    64 ) and a specific class ( unique i d ) 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
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 , fi ( 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 .
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 .
therefore the reconstruction accuracy was compared for different parameter combinations and the optimal was selected ( length of reconstruction window : 0.5 , 110  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 ) .
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 241477 was used to test the accuracy of the method .
( a , b ) real ( red ) and reconstructed x- and y - positions ( blue ) .
( c ) reconstruction error and median error of the whole recording ( solid horizontal line ) .
( d ) running speed v. 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 .
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 .
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 real - time 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 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 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 .
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 ) .
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 hz6 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 ( espaol ) 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 .
recording information of the off - line experiments ( three rats ) and off - line position reconstruction error relative to arena diagonal for manual and automatic spike sorting procedures .
the optimal reconstruction window was 3  s and the step size 0.5  s for all rats .
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 ) .
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
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
therefore the resulting templates from the manual sorting were used to resort the spike activity to simulate the real - time procedure .
the arena was divided into subsets of space ( 64    64 ) and a specific class ( unique i d ) 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
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 , fi ( 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 .
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 .
( 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 .
therefore the reconstruction accuracy was compared for different parameter combinations and the optimal was selected ( length of reconstruction window : 0.5 , 110  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 ) .
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 241477 was used to test the accuracy of the method .
( a , b ) real ( red ) and reconstructed x- and y - positions ( blue ) .
( c ) reconstruction error and median error of the whole recording ( solid horizontal line ) .
( d ) running speed v. 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 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 .
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 real - time 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 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 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% .
of special importance is that the 3 and 3 real - time methods gave almost the same results .
in real - time mode the following steps must be performed ( also shown in figure 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 .
real - time spike sorting : is performed by comparing incoming spikes with templates to assign each spike to a specific neuron and to remove noise .
real - time decoding : the position reconstruction algorithm uses the on - line sorted spikes and the firing rate vector as inputs to predict the position of the animal .
accuracy : the video tracking information can be used to compare the predicted position with the rat 's position and to calculate the accuracy . for the real - time experiments tetrodes
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 model is reading in the neural data and position with the video tracking system and cuts out the spikes .
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 .
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 i d 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 .
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 .
this took about 1  h and 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 ) .
recording information of the real - time experiments ( rt ) and real - time position reconstruction error .
for all recordings a reconstruction window of 3  s with a step size of 0.5  s was used .
figure 4 shows the reconstructed trajectory for seconds 200500 including error and speed of the session 1 , rt .
x / y - positions of real track ( red ) and reconstructed track [ blue ( a , b ) ] .
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 .
zhang et al . ( 1998 ) reached classification accuracies of about 410  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 food - stand 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 .
( 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 .
is also that for the real - time experiment only the training data was used to obtain templates for the automatic spike sorting .
this means that the spikes of the rt run were never seen before for any training purposes . in future studies it
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 ;
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 .
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 ) .
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 ) .
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
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 wave - ripples 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 100500  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 .
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 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 . ,
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 can not 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 .
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 .
( 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
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 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 .
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 .
the authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest .
 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 56 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 . 
 
Introduction
Off-Line Position Reconstruction
Off-line experiments and recording setup
Off-line position reconstruction algorithm
Off-line results
Real-Time Experiments
Discussion
Conflict of Interest Statement