1 Introduction

The analysis of extracellular potentials at macroscopic or microscopic scales is widely used to infer on the functioning of the healthy and pathological brain. Such electrophysiological signals reflect the spatio-temporal neural activities (Buzsáki et al. 2012; Einevoll et al. 2013b) and are useful to characterize local activity in a given population as well as large-scale brain dynamics over several structures (Pesaran et al. 2018). We focus in this paper on signals recorded at a microscopic scale, by sensors such as micro-wires, microelectrode array (MEA) such as Utah arrays (Blackrock) or silicon probes (Neuropixels), that we commonly denote in the following as microelectrodes. Considering the signal recorded by a microelectrode, two components are usually considered. The first one is a high-frequency component thought to reflect mainly the action potentials (APs) produced by neurons in the vicinity of the electrode tip (up to 200μ m Buzsáki 2004; Hagen et al. 2016; Toth et al. 2016). The second component is a low-frequencies component (usually < 300 Hz) known as the local field potential (LFP), which mainly originates from synaptic activities of neuronal cells relatively close the recording site (up to several millimeters Nunez and Srinivasan 2006; Mitzdorf 1985; Kajikawa and Schroeder2011).

The relationships between those scales are far from being fully understood (Peyrache et al. 2012; Destexhe et al. 1999), partly because of the electrophysiological dynamics of the structures explored at these different scales. Besides, the observed frequency dependence of the extracellular recordings with the electrode-source relative positions is not yet fully understood (resistive medium and complex source dynamics (Einevoll et al. 2013b; Logothethis et al. 2007; Ranta et al. 2017; Goto et al. 2010; Ness et al. 2015; Buccino et al. 2019) vs. complex medium and simpler source dynamics (Bédard and Destexhe 2011; Gomes et al. 2016). Computational models are thus needed to enlighten how field potentials are generated by the activity of large neuronal assemblies, as well as providing validation ground-truth for the development of inverse problem methodologies (e.g. spike sorting, relation analysis, etc) that are required to analyze such large amount of data.

Many methods and tools have been developed over the last decades to simulate realistic extracellular potentials from single neurons and neuronal populations. Following Mondragón-González and Burguière (2017) and Thorbergsson et al. (2012), one can distinguish between compartmental based models (Hines and Carnevale 1997; Gold et al. 2006, 2007; Lindén et al. 2014; Hagen et al. 2015; Parasuram et al. 2016; Tomsett et al. 2015; Dura-Bernal et al. 2019), data-driven models (Lewicki 1994; Martinez et al. 2009) and hybrid ones (Camuñas-Mesa and Quiroga 2013; Mondragón-González and Burguière 2017). The detailed state of the art models, based on multicompartmental neuron models (most based themselves on the NEURON environment Hines and Carnevale 1997), compute the extracellular potentials as a sum of monopolar current source contributions placed within each passive or active compartment (point current source model). An alternative is to use the Linear Source Approximation (LSA), where the membrane surfaces are reduced to a line source, resulting in a tractable analytic expression of the extracellular potentials (Holt and Koch 1999). Although these modelling tools provide accurate forward modelling, they can require a high computational burden for large neuronal populations.

In this paper, we propose a simplified and computationally efficient approach for simulating the extracellular action potential (EAP). Simplified modellings of EAP have been previously proposed, mainly for inverse problem purposes. The simplest one takes the form of a monopolar source placed within the soma (Chelaru and Jog 2005; Blanche et al. 2005), but do not accurately reproduce the decrease of the potential with the square of the distance as observed in experimental data (Gold et al. 2006; Pettersen and Einevoll 2008), and does not respect the principle of current conservation. In this perspective, the dipolar model stands as a better approximation and has been used to solve the inverse problem (Mechler and Victor 2012). Such simple point models are however not biophysically realistic in all ways and lack in reproducing accurately the variability of the waveforms at different recording sites around the cell. A compromise is then to be find between detailed compartmental models and point source models.

The method we propose aims to recover qualitatively realistic spike waveforms by taking into account the (simplified) morphology of the NEURON and the position of the electrode tips. We do not claim to obtain highly realistic extracellular potentials waveforms, as for example in the highly detailed models from Gold et al. (2006, 2007), but rather qualitatively similar EAPs using a simpler and computationally efficient model. More precisely, we focus on the axonal contribution and also include in our model the propagation of the AP along the axon, as well as different simplified axon / dendrites geometries. We show that the EAPs generated by this model can be reduced to a linear filtering of the EAP of a single dipole, with filters taking into account different NEURON morphologies (varying lengths and diameters of axons and dendrites) and electrode positions. All along the paper, we consider that the medium impedance is purely resistive (Buccino et al.2019; Einevoll et al. 2013b; Gold et al. 2007, 2010; Logothethis et al. 2007; Ness et al. 2015; Ranta et al.2017).

2 Methods

2.1 Multicompartmental modeling

The computation of the extracellular potentials is based on the volume conductor theory (Nunez and Srinivasan 2006). To express the influence of the NEURON morphology on the extracellular potential, we started from the classical assumption that at every time instant t, the potential ϕ(t) recorded by an electrode is a weighted sum of membrane currents of all the NEURON compartments (Lindén et al. 2014; Einevoll et al. 2013a), the weights depending on the medium conductivity (assumed homogeneous and isotropic) and the geometry (relative position of the compartments and the electrode).

The fundamental relationship between the potential \(\phi _{\textbf {r}_{\textbf {e}}}(t)\) recorded at position re given a single point current source Ii(t) at a position ri is given by the following equation:

$$ \phi_{\textbf{r}_{\textbf{e}}}(t)=\frac{1}{4\pi\sigma\left \| \textbf{r}_{\textbf{e}}-\mathbf{r_{i}} \right \|}I_{i}(t) $$
(1)

with σ the conductivity of the extracellular medium. Since contributions of N current sources add linearly, the equation (1) generalizes to :

$$ \phi_{\textbf{r}_{\textbf{e}}}(t)={\sum}_{k=1}^{N}\frac{1}{4\pi\sigma\left \| \textbf{r}_{\textbf{e}}-\textbf{r}_{\textbf{k}} \right \|}I_{k}(t) $$
(2)

for k current sources.

If each NEURON compartment is approximated by a point in space, equation (2) is called point source approximation (PSA) (Holt and Koch 1999; Pettersen et al. 2008) and yields the potential at re generated by the complete NEURON. Note that if the compartment is approximated by a line, one obtains the line-source approximation (LSA) (Gold et al. 2006).

Both methods give similar results when the electrode is farther than about 100μ m from the considered compartment (Parasuram et al. 2016), and it was shown that LSA is very close to the (more precise) cylindrical approximation of the compartment for distances above 1μ m (Holt and Koch 1999).

The time dynamics of Ik(t) depend on the modeling choice of the considered compartment. Indeed, compartments can be passive (i.e., their membrane is modeled as a simple RC circuit) or active. In that case, ionic channels are modeled (Hodgkin-Huxley dynamics for example Hodgkin and Huxley 1952). The compartments of a NEURON are interconnected and have interdependent time dynamics. The complete set of Ik(t) currents for both passive and active compartments is then computed using cable equations (Rall and Shepherd 1968; Lindén et al. 2010; Pettersen et al. 2014). In addition, for the active compartments, one needs to compute the Hodgkin-Huxley membrane dynamics. For the multicompartmental neurons commonly used to model complex morphologies, some of the compartments are set as active (at least the soma, in general the axon) and others passive (e.g. usually the dendrites). In any of these configurations, a complete simulation of the extracellular potentials requires to simulate hundreds of compartments and could lead to a high computational burden, especially when populations of neurons with multiple active compartments are considered.

2.2 Morphological filtering

The EAP can be thus modeled as a sum of the contributions of its different compartments, distributed over the three main parts of a NEURON (soma, axon, dendrites). Of course, because of the total electrical charge conservation, the current sources from one compartment must be compensated by current sinks, possibly located in other compartments, implying that the currents originating in different compartments are linked together. We start our modelling by making some simplifying yet plausible assumptions on the nature and relationships of these sources/sinks:

  • the soma and the axon are active, while the dendrites are mostly passive.

  • the active membrane mechanisms are roughly the same all over the active compartments for a given NEURON (all the ionic channels have the same dynamics and the same densities).

  • the active current sources (sinks) are mainly compensated by passive sinks (sources) in nearby compartments

Although the previous assumptions might seem oversimplifying (especially the first two - see the much more detailed models from e.g., Holt and Koch 1999; Gold et al. 2006, 2007; Thorbergsson et al. 2012), we have chosen here to follow the simpler models from Einevoll et al. (2013a), Lindén et al. (2011), Pettersen et al. (2008, 2011, 2012, 2014), which have shown that the modelled extracellular potentials using passive neurons (or with active conductance only in the soma and the axon (Pettersen et al. 2008)) are qualitatively similar to the more detailed models cited above. This assumption is also in agreement with (Kole et al. 2008; Gold et al. 2006; Mainen and Sejnowski 1996), which have shown that the concentration of the active channels responsible for the EAP generation is higher in the axon/soma than in the dendrites.

With these three preliminary hypotheses in mind, we can follow further the development as follows: such as in single source models, the initiation site and the main contributor to the AP is between the soma and the axon initial segment (AIS) (Chelaru and Jog 2005; Blanche et al. 2005; Mechler and Victor 2012; Teleńczuk et al. 2018). We model this contribution as a dipole, as in Mechler and Victor (2012) and we fix its origin in the soma and the orientation given by the direction between the center of the soma and the center of the AIS. Such simplified model lacks in reproducing the variability of the EAP shape around the NEURON and in particular on the axon side.

We assume then that the AP propagates along the axon away from the soma and that two consecutive axonal compartments act as pairs of source/sink, implying thus that every pair of consecutive compartments can be modeled as a current dipole. The axonal compartments being supposed identical and active, the time course of the transmembrane currents due to the AP is preserved while it propagates. We thus model this contribution as a traveling dipole along the axon.

Finally, the presence of dendrites is known to also impact the EAP pattern (Gold et al. 2006; Pettersen and Einevoll 2008; Lindén et al. 2010). We assume that the passive contribution of the dendrites can be modeled as small dipoles between the soma and each dendritic compartment.Footnote 1 Summing up, one can schematically split the EAP as follows:

$$ \phi_{EAP}(t) = \phi_{S,AIS}(t) + \sum\limits_{k}\phi_{A_{k}}(t) + \sum\limits_{j}\phi_{S,D_{j}}(t) $$
(3)

where ϕS,AIS is the potential generated by the pair soma-AIS, modeled as a dipole between these two compartments, \(\phi _{A_{k}}\) are the potentials generated by the k-th pair of neighbouring compartments on the axon and \(\phi _{S,D_{j}}\) are the dipoles between the soma and the dendritic compartment j. Because of their same origin, and because their time course is given by the somatic transmembrane currents, we can sum up the dendritic dipoles \(\phi _{S,D_{j}}\) in a single resultant dipole ϕD (see Fig. 1).

Fig. 1
figure 1

Sketch of a L5 pyramidal NEURON inspired from Mainen and Sejnowski (1996) with the various dipoles modeled : in red, the traveling dipole along the axon - in green, the soma-AIS dipole and in blue the resulting dendrite dipole

The orientation and amplitude of this dipole then depend on the particular shape of the dendritic tree. Moreover, the same reasoning can be applied for the ϕS,AIS contributor (origin in the soma, but different orientation and amplitude). Therefore, Eq. 3 can be rewritten as:

$$ \phi_{EAP}(t) =w_{0} C_{s} I_{0}(t)+\sum\limits_{k=1}^{N} w_{k} C_{a} I_{k}(t) $$
(4)

where I0 is the somatic membrane current with amplitude Cs (accounting for the soma, AIS and dendrites morphologies and relative positions) and Ik (\(k=1{\dots } N)\) are the currents generated by the N axonal compartments with identical contributions Ca.

Because we assumed dipoles between two successive axonal compartments k and k + 1, the weights wk above are not directly given by Eq. 2 but they result from the propagation of a dipolar source in an infinite homogeneous medium. More precisely, if we note rk the position of the center of the compartment k and re the position of the electrode, we can write:

$$ w_{k} = \frac{(\textbf{r}_{\textbf{e}}-\textbf{r}_{\textbf{k}})^{T}(\textbf{r}_{\textbf{k+1}}-\textbf{r}_{\textbf{k}})}{4\pi\sigma \left \|\textbf{r}_{\textbf{e}}-\textbf{r}_{\textbf{k}} \right \|^{3}} $$
(5)

Here, rk+ 1rk indicates the current dipole orientation.Footnote 2

Regarding the soma weight w0, the same equation applies:

$$ w_{0} = \frac{(\textbf{r}_{\textbf{e}} - \textbf{r}_{\textbf{0}})^{T}(\textbf{r}_{\textbf{res}}-\textbf{r}_{\textbf{0}})}{4\pi\sigma \left \|\textbf{r}_{\textbf{e}}-\textbf{r}_{\textbf{0}} \right \|^{3}} $$
(6)

Here, r0 is the soma position and rresr0 gives the resultant dipolar orientation (recall that we model the soma originating dipole as a composition of the soma-dendrites and soma-AIS dipoles, with a priori unknown orientation). Without loss of generality, we can further consider that (rresr0) has a unit amplitude (its actual amplitude being included in the Cs coefficient in Eq. 4),Footnote 3 meaning that w0 depends on the orientation of the resultant vector between the soma and the dendrites, thus (in the general 3D case), on two azimuthal and polar angles 𝜃 and ϕ (in spherical coordinates).

Next, we can normalize (4) by dividing by Ca (i.e., we are not focusing on the actual amplitude of the EAP, but on its shape). The soma amplitude coefficient CS = Cs/Ca will stand further for the relative weight between the soma based dipole and the axonal (traveling) dipole.

Considering normalized transmembrane currents Ik, the vector of weights corresponding to a specific electrode position and NEURON morphology writes:

$$ \bar{\textbf{w}} = [C_{S}w_{0} \qquad w_{1}\qquad {\dots} \qquad w_{N-1} w_{N}] $$
(7)

Next, as we have supposed similar dynamics for all active compartments (soma and axon), we can write the axonal currents as time shifted versions of the soma current:

$$ I_{k}(t) = I_{0}(t-\tau_{k}) $$
(8)

and we can gather them in a length N + 1 vector

$$\textbf{I}(t)=[I_{0}(t)\qquad I_{1}(t)\qquad \dots\qquad I_{N}(t)]$$

To sum up, using Eqs. 7 and 8, the extracellular signature of the action potential writes as a dot product:

$$ \phi_{EAP}(t) = \bar{\textbf{w}}\textbf{I}(t)^{T} $$
(9)

Finally, we make one last simplifying assumption: the action potential propagates along the axon at a constant velocity v. If the axonal compartments are identical, the traveling time of the axonal dipole from one compartment to another is constant:

$$ \tau_{k}=\tau=\frac{\|\textbf{r}_{\textbf{k+1}} - \textbf{r}_{\textbf{k}}\|}{v} $$
(10)

and Eq. 8 becomes:

$$ I_{k}(t) = I_{0}(t-k\tau) $$
(11)

Consequently, the EAP potential can be written under an computationally efficient form as the convolution between the soma current (given by the HH like dynamics) and a morphological filter \(\bar {\textbf {w}}\):

$$ \phi_{EAP}(t) = \sum\limits_{k=0}^{N}\bar{w}_{k}I_{0}(t-k\tau) $$
(12)

While in Eq. 12 the filter coefficients depend only on the morphology and the AP velocity appears through τ, the convolution is commutative and thus it can be as well written as:

$$ \phi_{EAP}(t) = \sum\limits_{k=0}^{N}h(t-k\tau)I_{0}(t), $$
(13)

where h(t) is the impulse response of the filter having the coefficients defined by Eq. 7 (\(h(k\tau )=\bar {w}_{k}\)). This last expression illustrates that the filtering coefficients depend on four parameters (CS, 𝜃, ϕ, v), that need to be fitted to the particular morphology of the simulated NEURON.

2.3 Simulation

This section presents our simulation and evaluation protocol. The final aim is to evaluate the accuracy of our filtering model when compared to state of the art compartmental models (seen as ground truth), as well as with simple fixed-dipole models. As mentioned above, we normalize the obtained EAPs because we are interested in their shapes recorded at different positions in space around different types of neurons. Consequently, our main performance criterion, used further on in the paper, is the correlation coefficient between the ground truth given by the compartmental models and the morphological filtering results.

2.3.1 Compartmental modelling

The ground truth is assumed to be the compartmental NEURON model. Several simulations were made:

  1. 1.

    As in other studies, we simulate the ball-and-stick (BS) NEURON, commonly used to study the frequency and spatial properties of NEURON extracellular potential despite its simplicity (Pettersen and Einevoll 2008, 2014; Archie and Mel 2000; Brette and Destexhe 2012). It consists of a lumped soma attached to an axon subdivided into fixed-length compartments. We set some assumptions about the morphology: the diameter of the axon is constant and the soma is assimilated to a cylinder with equal diameter and length. We considered the presence of the dendrites by adding them to the classical BS NEURON. The dendritic tree is reduced to a single stick in the opposite direction of the axon, assuming that the dendrites are well balanced around the soma with a bias in the opposite direction of the axon. The resulting dendrite is also subdivided into fixed-length compartments with the same morphological characteristics as the axonal compartments (lengths and distance inter-compartments). We then simulate different morphologies by varying four parameters: length and diameter of the axon and length and diameter of the resulting equivalent dendrite. For the axon, the diameters are set to 1, 2 and 4μ m, while the length varies in the set of values {1000,800,600,400,200}μ m. For the equivalent dendrite stick, the diameters are set to 2 and 4μ m and the length varies in the set {200,150,100,50,0}μ m. The length and diameter of the soma are fixed to 25μ m. In all, 135 morphologies are considered (for 0μ m length dendrites, the diameter is not relevant). Figure 2 illustrates the used model and the different parameter values. With this simplified NEURON morphology, the NEURON belongs to a plane defined by a Cartesian system whose origin corresponds to the soma center r0 = [0 0 0]T and with the x-axis aligned with the axon. For this simulation setup, as the equivalent dendrite is aligned with the axon and has thus a known orientation (𝜃, ϕ) the morphological filter is only parametrized by two coefficients (CS,v).

  2. 2.

    A slightly more general situation appears when the dendrites are biased and the equivalent dipole is not oriented in the opposite direction to the axon. We simulated thus a BS NEURON with a tilted equivalent dendrite (dotted line in Fig. 2, with 𝜃= 20 and ϕ= 90). We do not consider all the varying length and diameters for the axon and the equivalent dendrite, the role of this simulation being to illustrate the performances of our proposed method in a more general case. In particular, we simulate BS NEURON with a 600μ m length and a diameter of 2μ m (median values of axon length and width with respect to the previous simulation). As we are interested in the effect of the (tilted) dendritic stick on the accuracy of our model, we consider the two extreme cases for a 2μ m diameter dendrite, that is lengths of 50 and 200μ m.

  3. 3.

    Finally, we evaluate our proposed modelling approach on neurons with realistic morphologies. We consider two types of cells, one with a highly biased and important dendritic tree (the pyramidal L5 NEURON from Mainen and Sejnowski (1996)) and the other one with a rather symmetric disposition of the dendrites (the spiny stellate L4 NEURON from Mainen and Sejnowski 1996). As for the tilted dendrite simulation, We have connected a 600μ m length, 2μ m diameter axon to the somas of these two neurons.

Fig. 2
figure 2

Toy model of NEURON used in this study. The stick of the NEURON is aligned with the x-axis and the center of the soma is the origin of the Cartesian system. The black dots correspond to the positions for a subset of the 65 electrodes. The resulting dendrite (blue dot line) has an angle of 𝜃= 20 compared to the axonal axis.

These different morphologies were implemented in Neuron (Hines and Carnevale 1997). In order to simulate their electrophysiology, we need to define the electrical characteristics of the membrane for each compartment. In our simulations, we considered a combination of active and passive channels (as in Gold et al. 2006). More precisely, passive channels were implemented in all compartments of the NEURON (default LFPy values, gpas= 1/30000 S/cm2, epas= -65mV), and active channels were inserted in the soma and axon compartments (default NEURON values, see also Gerstner and Kistler 2002). The precision of the results of the simulations obviously depend on the specific chosen channels and their parameters. For the purpose of this study, we have limited ourselves to the default values and channels.

For obtaining the extracellular images of the action potentials, the different NEURON models were called from the Python package for extracellular potential computation LFPy (Lindén et al. 2014). An excitatory current was injected in the somas, such as the neurons fire an isolated spike. The extracellular potentials were computed at several positions around the simulated neurons. Because of their axial symmetry, we considered a grid of 65 electrodes positioned in the (x,y) plane, evenly spaced around the NEURON with a step of 50μ m along the y-axis and of 125μ m along the x-axis (Fig. 2). The only exception is the pyramidal L5 simulation, where the grid was extended on the apical dendrites side (Fig. 10), resulting in 105 electrodes.

Note that the method implemented in LFPy to calculate the extracellular potentials is a mix method between the PSA and the LSA considering the soma as a point and the membrane currents as evenly distributed along each compartment axis.

2.3.2 Morphological filter parametrization

As mentioned above, the proposed morphological filter has four parameters: the amplitude and the orientation of the somatic dipole (CS, 𝜃, ϕ) determine the w0 coefficient in Eq. 6, while the speed of the axonal propagation v determines the convolution step τ in Eqs. 12 or 13. In order to implement this convolution, these parameters need to be determined. Their values are optimized with a brute force method, that is the performances were evaluated on a regular grid in the four dimensional parameter space. More precisely, we have optimized the speed by exhaustively looking for the optimal τk in a range of 1 to 40 samples (1 to 40 μ s, corresponding to speeds between 0.25 and 10m/s), and we generally optimized the soma coefficient Cs in the range 0 to 20 (this range was extended only for the L5 compartmental model to 50). The angles 𝜃 and ϕ cover the whole range of orientations (from an equivalent dendrite opposed to the axon to one pointing in the same direction), with a step of 10. Note that, for the first simulation (BS with an equivalent dendrite pointing in an opposite direction as the axon), the angles 𝜃 and ϕ were fixed and the optimization was done in the two-dimensional space (v, Cs).

In all simulations, the membrane current I0(t) is obtained by modeling only one single compartment having a Hodgkin-Huxley dynamic (Hodgkin and Huxley 1952) with the values given in Gerstner and Kistler (2002).

The optimized (maximized) criterion was the mean correlation between the EAP produced by our convolutive approach and the detailed compartmental approach over the 65 electrodes (105 for the L5, simulation 4).

3 Results and discussion

This section presents the results of our simulation method. The EAP generated by morphological filtering of the membrane current of a single compartment NEURON is compared with the (ground-truth) LFPy/NEURON multicompartments modelling and with a simple two compartment modelFootnote 4 modelled as a fixed dipole. Most of the results presented here focus on the first simulation (BS NEURON with an equivalent dendrite pointing in the opposite direction as the axon). The results of this simulation are described and analyzed in details in the first two Sections 3.1 and 3.2. Although we have simulated axons of three diameters (1, 2 and 4μ m), we only present here the results concerning the axon diameters 2 and 4μ m. Comparative results for the 1μ m diameter axon yields similar conclusions and they are given in the Supplementary Material.

The following Sections 3.3 and 3.4 are dedicated to simulations 2 and 3, i.e., the tilted dendrite BS and the realistic morphologies. Section 3.5 presents our first results on simulating the EAPs contribution of a whole population to the extracellular potentials, either recorded by micro or macro electrodes. Finally, in the last subsection, we discuss the performances and the limits of the proposed model.

3.1 Simulation 1: optimally parametrized morphological filter

As mentioned earlier, the EAPs are obtained by a filtering operation (see Eq. 13) and the filter coefficients depend on the axonal propagation velocity v and on the somatic dipole amplitude CS (for simulation 1). Consequently, the shape of the generated EAP depends on these two parameters. We present first (see Fig. 3) the best fits after tuning v and CS in order to reproduce as accurately as possible the LFPy ground-truth (by maximizing the correlation).

Fig. 3
figure 3

Best fit results. The heights of the bars represent the mean correlation coefficient (over 65 electrodes) for a given morphology. The rows of the figure are organized by axon length (200μ m to 1000μ m), while the columns are organized by dendrite length (0μ m to 200μ m). The indices a to d encode axon-dendrite diameter pairs: a : {ΦA = 2,Φd = 2}μ m; b : {ΦA = 2,Φd = 4}μ m; c : {ΦA = 4,Φd = 2}μ m; d : {ΦA = 4,Φd = 4}μ m

As it can be seen, the correlation coefficients are very high, especially in the upper left corner of the figure, for long axons and low influence of the dendritic tree (according to our initial assumptions, this configuration stands for dendrites distributed around the soma, yielding a short equivalent dendrite stick). On the contrary, in the lower right corner, when the axon is short and the dendrite stick is long, the accuracy of the model decreases. The model remains relatively accurate when the axon influence is higher than that of the dendrites, for short axons and short dendrites or long axons and long dendrites, although in the latter case the diameter of the equivalent dendrite needs to be also considered (if the dendrites are long and thick, the accuracy is diminished). In summary, the quality of our model is determined by the imbalance between the importance of the axon and the dendrites: when the influence of the dendrites becomes too important relatively to the axon’s one, i.e., when the dendrites are long and thick (e.g., bars b and d in the columns at the right), the morphological filtering approach is less accurate in reproducing the compartmental models.Footnote 5

For comparison and further discussion, we present in Fig. 4 the performances of a simple dipolar model having a fixed origin in the soma. Note that in this case no filtering of the membrane current is performed and the shapes of the EAP are the same (except for the gain, which can be negative depending on the orientation of the dipole with respect to the electrode).

Fig. 4
figure 4

Best fit results for a fixed-soma dipole. The heights of the bars represent the mean correlation coefficient (over 65 electrodes) for a given morphology. The rows of the figure are organized by axon length (200μ m to 1000μ m), while the columns are organized by dendrite length (0μ m to 200μ m). The indices a to d encode axon-dendrite diameter pairs: a : {ΦA = 2,Φd = 2}μ m; b : {ΦA = 2,Φd = 4}μ m; c : {ΦA = 4,Φd = 2}μ m; d : {ΦA = 4,Φd = 4}μ m

By construction, the fixed simple dipolar model does not take into account the propagation of the action potential. We can thus expect to obtain higher correlation coefficients for the morphological filtering approach for long axons and possibly similar performances for short axons. This is partially confirmed by Fig. 4: the performances of the fixed-soma dipole improve for shorter axons. Still, they remain below our proposed approach, except for the shortest considered axons (200μ m, see explanations below in the soma coefficient paragraph). In summary, as long as the axon length decreases, its electric contribution to EAPs becomes more and more insignificant (the somatic and dendritic influence increase) and the NEURON can be more and more assimilated to a point-neuron.

It is also interesting to notice that, for axon of length 400μ m and above, the fixed dipole approach is higher in correlation for thick axons (bars c and d) than for the thin ones (a and b). In order to correctly interpret this observation, it is helpful to analyze the Fig. 5, giving the optimized speeds of axonal propagation v which determines the convolution (10) to (13). A first observation is that the speeds (recall that they were chosen for every morphology in order to maximize the correlation coefficients) have consistent values with the literature, at least for axons above 600μ m (or even above 400, for thin axons - 2μ m), that is between about 0.5 and 1m/s. Moreover, as reported in the literature, the speed is higher for thicker axons than for thin ones (approximately proportional to the diameter, Ritchie 1982; Horowitz et al. 2015): bars c and d are twice as high as a and b. How can this observation explain better results of the fixed-soma dipole approximation for thick axons (bars c and d Fig. 4)? Our interpretation is the following: as the speed increases, the τk in Eq. 10 decreases, which is equivalent to a morphological filter with a shorter time support and thus with a less filtering important effect. In other words, high axonal propagation speed yields EAP shapes less distorted by filtering and thus closer to the membrane current of a unique compartment (and thus to a fixed dipole).

Fig. 5
figure 5

Best fit results about the propagation speedv (m/s) of the action potential. The y axis is saturated at 3 m/s. The indices a to d encode axon-dendrite diameter pairs: a : {ΦA = 2,Φd = 2}μ m; b : {ΦA = 2,Φd = 4}μ m; c : {ΦA = 4,Φd = 2}μ m; d : {ΦA = 4,Φd = 4}μ m

The second parameter of our model is the weight of the somatic dipole CS. As for the optimal speed figure, we plot in Fig. 6 the optimal somatic coefficients (i.e., the one maximizing the correlation coefficient and yielding the best fits in Fig. 3).

Fig. 6
figure 6

Best fit results about the somatic dipole coefficient CS (unitless). The y axis is saturated at ± 10. The indices a to d encode axon-dendrite diameter pairs: a : {ΦA = 2,Φd = 2}μ m; b : {ΦA = 2,Φd = 4}μ m; c : {ΦA = 4,Φd = 2}μ m; d : {ΦA = 4,Φd = 4}μ m

As it can be seen, when the equivalent dendrite is negligible (first column), the weight of the somatic dipole is small. This is especially true when the axon is long and thus the axonal travelling action potential dominates the extracellular potentials. As the axon becomes shorter (still in the first column), the importance of the soma increases. One can notice a gap between 400 and 200μ m (for the latter, the soma coefficient saturates), indicating again that the validity of our model is weak for short axons (or at least its similarity with the LFPy model decreases). Note that the CS coefficient saturation explains also why the morphological filtering approach remains below the single dipole model (Figs. 3 and 4, 200μ m axon length).

As the length of the dendrites increases (columns from 2 to 5), the CS coefficient becomes more and more important and more and more negative, supporting the intuition of a fixed dipole oriented from the soma towards the dendrites. This is even more clear when the surface of the equivalent dendrite increases (i.e., for thick dendrites): bars b and d have bigger (absolute) values than bars a and c. It is interesting to notice that the value of the soma coefficient saturates quite rapidly as the length of the dendrite increases, except for the thick axon / thin dendrite case (bars c), where the relative weight of the axonal travelling dipole remains important compared to the somatic dipole.

The previous analysis of the CS coefficient needs nevertheless to be taken with care, because its importance is far less significant than the speed v influence. Indeed, for a given speed, the correlation coefficient between the morphological filtering and the ground truth varies little with CS. This could seem quite paradoxical, as we argued that the Cs coefficient should be highly negative for important dendrites. In fact, the performances are quite similar for a large interval of negative values (see Fig. 19 in the Supplementary Material). In our opinion, this is caused by a deeper caveat of our model, that is the unique dipole combining the dendrite and the AIS contributions. The price to pay for this simplified model is a dipole having less influence on the total performance (see also the discussion below, when presenting simulations 2 and 3 for the tilted dendrite and the realistic morphologies).

To sum up these analysis, we can conclude that our morphological filtering approach is able to accurately reproduce compartmental models for different simple (BS) neural morphologies, except for weak axons to dendrite surface ratios. Moreover, the parameters of the model have biological interpretations and pertinent values, coherent with the neurobiology for most of these morphologies (especially for the axonal travelling speed v). For a more detailed discussion on the limits of our model, see below, Section 3.6.

3.2 Simulation 1: empirical model

According to the previous analysis, it is tempting to fix the parameters of the morphological filter according to some rules derived directly from the morphology of the simulated neurons. In order to test this hypothesis, we have empirically fixed the speeds depending on the axon diameter only, to 0.45 m/s (for a diameter of 2μ m) and 0.83m/s (for 4μ m).Footnote 6

Next, once the speeds were fixed, we have tried to obtain a rule for adjusting the CS coefficient depending on the dendrites weights in the morphology. We have fitted different curves Cs = fD,LD), with ΦD and LD the diameter and the length of the equivalent dendrite (up to second order). Finally, a very simple linear regression explaining the somatic coefficient CS as a linear function of the dendrite surface (ΦD × LD) gave the best results, being consistent with our expectations:

$$ C_{S}=2.9-\frac{{\Phi}_{D}L_{D}}{37} $$
(14)

The correlation coefficients obtained with these fixed speeds (one per axon diameter) and the somatic coefficients given by Eq. 14 are given Fig. 7.

Fig. 7
figure 7

Correlation coefficients between the LFPy ground truth and the morphological filter approach, with fixed speed per axon diameter (see text). The heights of the bars represent the mean correlation coefficient (over 65 electrodes) for a given morphology, as in the previous figures. The indices a to d encode axon-dendrite diameter pairs: a : {ΦA = 2,Φd = 2}μ m; b : {ΦA = 2,Φd = 4}μ m; c : {ΦA = 4,Φd = 2}μ m; d : {ΦA = 4,Φd = 4}μ m

As it can be seen, the performances remain very high (correlation coefficients above 0.8) for the first three rows (axons above 600μ m, regardless of the dendritic morphology, except for the long thick dendrites and 600μ m thick axon, bar d or row 3, column 5, where the correlation equals 0.75). High correlation values are also obtained for 400μ m thin axons up to dendrites of 100μ m length and even for 200μ m axons with no equivalent dendrite (recall that this configuration models an dendritic tree radially surrounding the soma). As a matter of fact, neurons with thick short axons but no dendrites are also quite well modelled by this empirically parametrized morphological filtering (bars c and d in the lower part of the first column of Fig. 7, with the lowest correlation value at 0.75).

To sum up, the proposed morphological filtering approach, with empirically tuned parameters based on neurobiologically sound hypothesis, achieves good to very good performances for an important number of ball-stick type neural morphologies. Visual and quantitative performances for a given NEURON morphology (BS with an axon having a length of 1000μ m and a diameter of 2μ m, as well as a 50μ m length 2μ m diameter equivalent dendrite) can be seen on the Fig. 8.

Fig. 8
figure 8

Position-dependent EAPs waveforms (top) and spectra (bottom) for a NEURON with a morphology given by LA = 1000μ m, ΦA = 2μ m, LD = 50μ m, ΦD = 2μ m. Red curves are computed using the compartmental model (LFPy+Neuron) while the blue ones are computed with the proposed morphological filter. Not all the electrode positions are displayed. Mean correlation value: 0.97, minimum value: 0.80, maximum value: 0.99, median value : 0.98. The colors of each electrode quantify the correlation between the morphological filter and the ground truth (see colorbar)

It is also interesting to notice (Fig. 8), that the spectra vary with the positions in space, with relatively higher frequencies along the axon than near the soma. Note that a dendritic influence on the spectra was shown in, for example, (Lindén et al. 2010).

3.3 Simulation 2: tilted equivalent dendrite

Up to now, we considered an equivalent resulting dendrite aligned with the axon and oriented in the opposite direction. This case is an idealized configuration, as for most neurons the dendrites are not perfectly symmetric (Fiala and Harris 1999). This simulation aims to evaluate the performances of the morphological filtering approach for asymmetric configurations, but still supposing that the dendritic ramifications can be approximated by a unique equivalent (tilted) dendrite. Two extreme cases were modelled and studied, namely a long and short equivalent dendrite with lengths LD of 50μ m and 200μ m. The axon length LA was set to 600μ m (the mean length in the previous simulations), its diameter ΦA to 2μ m and the diameter of the equivalent dendrite ΦD was set to 2μ m.

It is important to notice that, if in the previous simulations the orientation of the dipole accounting for the equivalent dendrite was fixed in the opposite direction to the axon, this orientation needs to be estimated for a tilted dendrite. In other words, we have to estimate the rres or more precisely its spherical coordinates, see Eq. 6. The morphological filter then is configured using 4 parameters and, as for the speed and the CS coefficient, we have performed an exhaustive research in order to determine the optimal polar and azimuthal angles ϕ and 𝜃.

Figure 9 shows the correlation values for each electrode position around the NEURON for the two tested equivalent dendrite lengths. It can be seen that, for a short equivalent dendrite, the waveforms are very similar with the ones computed with the multicompartmental model (ground-truth), supporting the idea that the method can deal with asymmetric dendritic ramifications as long as the asymmetry remains low and the equivalent dendrite short. In fact, as indicated by the small CS value (= 1), the contribution of the somatic dipole is low and the ϕ and 𝜃 angles are not relevant (indeed, practically the same mean correlation performances, within a 10− 2 precision, are obtained regardless of these angles).

Fig. 9
figure 9

Tilted dendrites results. The neurons illustrated here have an axon with a length LA = 600μ m and a diameter of ΦA = 2μ m. The equivalent dendrite lengths are LD = 50μ m (top) and LD = 200μ m, both with a diameter ΦD = 2μ m. The angle between the dendrite axis and the axonal axis is π/9. For the top NEURON (LD = 50μ m), the mean correlation value is 0.97, with minimum value 0.79, maximum value 0.99 and median value 0.98. The optimal filter parameters are CS = 1, v = 0.47 m/s, ϕ = π/2, 𝜃 = −π/18. For the bottom NEURON (LD = 200μ m), the mean correlation value is 0.78, with minimum, maximum and median values of -0.15, 0.99 and 0.94 respectively. The optimal filter parameters are CS = 18, v = 0.45 m/s, ϕ = π/2, 𝜃 = π/18

For the long dendrite case, although the EAPs are correctly modelled on the axon side, the proposed method can not reproduce realistic waveforms on the dendrite side. It is nevertheless interesting to notice that, unlike for the short dendrite, the weight of the somatic dipole is important and the angles become relevant. Indeed, the only 𝜃 angles achieving correlations above 0.75 are between 0 and 2π/9, i.e., around the actual tilted dendrite angle of π/9. Still, despite the good angle estimation, the EAPs on the dendrite side are not well modelled, pointing out the limits of our model (in our opinion, this is at least partly due to the inaccuracy of the dipolar estimation in the close field, see also the Discussion section below).

3.4 Simulation 3: complex morphologies

The next step in evaluating the performances of the proposed morphological filter is to confront it with multicompartmental simulations of neurons having complex morphologies. This section focuses on EAPs generated by two neurons:

  • a modified L5 pyramidal NEURON based on Mainen and Sejnowski (1996). More precisely, we have kept the complete dendritic morphology (apical and basal dendrites) and we have added a 600μ m length axon of 2μ m diameter, connected to the soma. The dendrites were kept passive, while active channels (as above) were included in the axon and the soma.

  • a modified stellate inhibitory NEURON, also based on Mainen and Sejnowski (1996). As for the L5, we have kept the complete dendritic morphology (basal dendrites only) and we have added a 600μ m length axon of 2μ m diameter, connected to the soma. The dendrites were kept passive, while active channels (as above) were included in the axon and the soma.

Considering the previously presented simulations, one would expect better results for the stellate NEURON compared to the pyramidal L5, because of their different dendritic morphologies (symmetric basal for the stellate, highly asymmetric and tilted for the L5). Moreover, for the latter, the EAPs should be better reproduced on the axon side than on the (apical) dendrite side. Indeed, these expectations are confirmed by the quantitative results, presented in Fig. 10.

Fig. 10
figure 10

Position-dependent EAPs waveforms for a stellate interneuron (top) and an L5 pyramidal NEURON (bottom). Red curves are computed using the compartmental model (LFPy+Neuron) while the blue ones are computed with the morphological filter method. Not all the electrode positions are displayed. The color of the electrodes gives the correlation level (negative values are saturated at 0). For the stellate cell, the performance indices are: mean correlation value: 0.94, minimum value: 0.60, maximum value: 0.99, median value : 0.96. The optimal filter parameters are CS = 6, v = 0.62 m/s, ϕ = 8π/9, 𝜃 = − 13π/18. For the L5 cell, the performances indices are: mean correlation value: 0.39, minimum value: -0.24, maximum value: 0.98, median value : 0.47. The optimal filter parameters are CS = 28, v = 1 m/s, ϕ = π/3, 𝜃 = 17π/18(170)

3.5 Simulating EAP contributions to the LFP for large populations

It is well known that one of the main components of the extracellular electric field (LFP) is generated by the membrane currents of neurons situated in a volume around the recording electrode (Buzsáki et al. 2012). The extent of this volume is debated, but the LFP is usually known to reflect the neural activity of populations within a few hundred micrometers from the recording electrode (Toth et al. 2016; Kajikawa and Schroeder 2011; Lindén et al. 2011).

The method we propose in this paper can be used to quickly evaluate the contribution to the measured extracellular potentials of the action potentials generated by a whole population. Of course, in a real population or in a realistic model (Traub et al. 2004), the variety of the neurons yields contributions to the extracellular potential with different shapes that our model cannot capture. We rather follow the philosophy behind the populations simulators from Mazzoni et al. (2015), where the aim was to obtain approximations of (the synaptic contributions to) the LFP. Still, unlike in Mazzoni et al. (2015), we focus on the EAP contributions, which our model is able to reproduce to a certain extent, especially considering the relative positions of the electrodes and neurons.

If the previous simulations showed that the morphological filtering is able to yield varying EAP waveforms depending on the NEURON positions with respect to the electrode, we have not yet explored the EAPs variations due to the morphologies themselves. Of course, the simple BS models we propose cannot capture the variability of the EAPs of realistic neurons, but an interesting question is if it still can generate varying waveforms, for the same relative NEURON positions with respect to the electrode, but for neurons with different simple morphologies.Footnote 7

We have thus simulated two different (extreme) BS morphologies:

  • long axon (1000μ m) - long dendrite (200μ m) morphologies, that we call further on pyramidal neurons (long projecting axon and long apical dendrites, yielding a long equivalent dendrite stick);

  • short axons (200μ m) - no dendrite, that we call further on inhibitory neurons (short axon and radially distributed dendrites).

All diameters are set to 2μ m.

The simulated EAPs as seen by an electrode near the soma (the closest on the dendrite side) are presented Fig. 11. As it can be seen, the shapes respect basic features of the inhibitory EAP (shorter duration) and excitatory EAP (larger duration). These shapes are to be compared to results from the literature (Barry 2015; Bieler et al. 2017; Lewandowska et al. 2015; Robbins et al. 2013). If the peak-to-peak width is quite similar for both types of neurons (2.14 ms for the pyramidal NEURON and 2.19 ms for the inhibitory neuron), the half peak-to-peak width is significantly shorter for the inhibitory NEURON compared to the width of the excitatory (pyramidal) neuron - respectively 0.26 ms (horizontal red line) and 0.41 ms (horizontal blue line). Without pretending to simulate highly realistic waveforms as in Gold et al. (2006), our simulations are qualitatively coherent with the basic biological observations on the EAPs shapes.

Fig. 11
figure 11

Examples of EAP simulated waveforms: the pyramidal cell (blue) has a larger spike width than the inhibitory cell (dotted red). The two horizontal dotted lines represent the half peak-to-peak width

With these considerations in mind, we simulated a population of neurons, roughly implementing the same setup as in Mazzoni et al. (2015). Our population consists of 4000 pyramidal and 1000 inhibitory neurons having the somas randomly and uniformly positioned in a cylinder with 250μ m radius and 250μ m height (z from 0 to -250μ m) – (Fig. 14A). These dimensions correspond to a neuronal population which contributes the most to the LFP (Lindén et al. 2011; Łėski et al. 2013; Einevoll et al. 2013a) and have also been used in Mazzoni et al. (2015).

Pyramidal neurons are known for having a preferred orientation, so they were z-oriented with a (small) random angle, while inhibitory neurons do not have a specific orientation for the axons, which were thus oriented randomly, see Fig. 12.

Fig. 12
figure 12

Micro and macroelectrodes positions with respect to the neural population (SEEG, electrodes 1 and 2, ECoG, electrode 3). Notice the laminar electrodes inside the population

Several measurement points (electrodes) were simulated, with different positions and sizes. The activity was first simulated at different depths along the z-axis by placing three groups of three point electrodes in a linear manner (as for a laminar electrode). The distance between electrodes was set at 50μ m, while the three groups were placed at depths 150, -75 and -700μ m (first electrode of each group). These three depths correspond respectively to the influence area of the dendrites (micro A), somas (micro B) and axons (micro C), see Fig. 12. In order to evaluate the contribution of the population EAPs to macro electrodes (intracerebral SEEG or ECoG), we have also simulated finite surface contacts, for which the potentials were computed by spatial averaging (Lindén et al. 2014). These macro electrodes were placed either parallel to the z-axis (and thus to the population, more or less like SEEG electrodes passing through the cortex) or perpendicular to the z-axis and above the population (apical dendrites side, more or less like an ECoG electrode). Their dimensions were set at 1200× 600μ m for the SEEG1 and SEEG2, while the circular ECoG electrode radius was set at 250μ m. The SEEG-like electrodes were placed at 350μ m and 550μ m from the population frontier (cylinder surface), while the ECoG-like electrode was placed at 300μ m from the somas (see Fig. 12). The potentials recorded by these electrodes were simulated by averaging over a regular grid of points on their surfaces (153 points for the SEEG and 83 points for the ECoG).

Modelling a realistic dynamics of this neural population through realistic synaptic connectivity is beyond the scope of this paper. We thus generated the spiking activity of the simulated population using a random (Poisson) process with variable intensity, the same for all neurons in order to simulate phases of synchronous firing (see Fig. 13 bottom). A refractory phase of 10ms was considered for all neurons. The resulting raster (3 seconds at a sampling frequency of 32000Hz) is shown in Fig. 13. In order to simulate the membrane currents and the spiking activity of the population, the raster was convolved with Im(t), the membrane currents generated by a Hodgkin-Huxley model. For every NEURON and electrode, the corresponding morphological filter was computed as described in the previous sections, and the contribution of the population action potentials to the extracellular potential were obtained, for every point in space and thus every electrode, by adding the contributions of the different neurons.

Fig. 13
figure 13

Spiking activity of the excitatory (blue) and the inhibitory neurons (red). The black line corresponds to the common firing rate

The signals seen by the micro electrodes inserted into the simulated population are shown in Fig. 14. Previous simulations and studies have shown that the extracellular signature of the action potential can be recorded by several electrodes (Einevoll et al. 2013b; Kajikawa and Schroeder 2011). The main key feature is that the shape and the amplitude will change according to their relative positions compared to the NEURON morphology as it can be seen on the Fig. 14 (and as it was shown for a single NEURON simulation in the previous sections).

Fig. 14
figure 14

Signals recorded by the different electrodes located in the neuronal population : in the dendrites area (Micro A - top), among the inhibitory and pyramidal somas (Micro B - middle) and in the pyramidal axons area (Micro C - bottom). The colored spikes correspond to the same neurons type (inhibitory in red, pyramidal in blue). Note the different shapes of the EAP of the same NEURON, depending on the electrode. The circles show the contribution (in terms of energy, computed as the sum of squared magnitudes) of the excitatory neurons (blue) and the inhibitory neurons (red) to the extracellular potentials (the EAP contribution)

Another feature of the simulation is that the electrodes of group C (lower part of the cylinder) detect mainly pyramidal neurons activity and more specifically axonal action potentials (Fig. 14). The inhibitory contribution to the extracellular potential is not significant because of the size of the inhibitory neurons and their short axonal influence area. However, when the electrodes are located among the somas (micro B), it is clear that EAPs from both neurons types can be seen (Fig. 14 - middle). Their contribution to the global signal is no more negligible (red parts in the circles on the right). It is noteworthy to mention here that this decrease of the contribution of inhibitory interneurons is also present when moving away radially from the center of the population (perpendicular to z-axis, not shown). Moreover, the inhibitory contribution rises when the electrodes are located in the dendrites influence area (micro A) and EAPs from both neurons types can still been seen. These observations can be explained by the intrinsic properties of the inhibitory neurons, having a smaller morphology and no preference for axon orientation. Consequently, it appears that the overall contribution of the inhibitory EAPs to the spiking activity is much smaller and more local than the excitatory EAPs contribution (the same conclusions were drawn for synaptic contributions of the post-synaptic pyramidal neurons, compared to the ones of the inhibitory neurons Mazzoni et al. 2015). It also appears that the shapes of the different EAPs show a high variability (between neurons but also for the same NEURON recorded on a given electrode depending on the background activity), indicating that these signals could be in principle used for spike sorting algorithms benchmarking or training - see more detailed discussion below.

We finish this section by discussing the contribution of the action potentials of the whole population to macroscopic recordings, simulated by averaging the extracellular potentials over the surface of the macro electrodes. We have filtered the obtained signals in order to mimic a macroscopic (clinical) EEG recording device. Here, the populations activities have been bandpass-filtered with a 2nd-order Butterworth filter between 0.15Hz and 480Hz (Micromed, Treviso, Italy, Technical Note). For each macro electrode, we computed the recorded extracellular potential, as well as the separate contributions of the the excitatory and inhibitory neurons.Footnote 8 For both types of macro electrodes, we quantified the relation between the population firing rate and the extracellular potentials by estimating the correlation coefficient between them. The Fig. 15 illustrates the relation between this firing rate and both populations activities on both types of electrodes.

Fig. 15
figure 15

Macro oscillations of both populations correspond to the firing rate. A Simulated firing rate. B and C The activity of the excitatory neurons (blue) is more significant than the activity of the inhibitory neurons (red) for the SEEG1 electrode (B) and the EcoG electrode (C). The correlation between the firing rate and the SEEG signal is about 0.46 and the correlation with the ECoG signal is 0.61. The circles quantify the contribution of the excitatory (blue) and the inhibitory (red) neurons to the extracellular potentials (relative energy, computed as the sum of squared magnitudes)

It is clearly visible that the excitatory population contributes more significantly to the global extracellular recordings than the inhibitory population. The most interesting observation is that the action potentials of synchronous firing pyramidal neurons seem to contribute to very low frequencies in the extracellular signals and that this contribution is correlated to the firing rate. Assuming that the overall EAPs contribution to the LFP is significant (i.e., it is not completely dominated by the synaptic contribution), this would help to explain and justify the use of the firing rate of a population as a proxy for the LFP, or at least as a partial component. It is noteworthy that the ECoG electrode seems to have a relatively stronger low-frequencies component compared to the SEEG (the ECoG potential has a higher correlation than the SEEG one with the firing rate, 0.61 compared to 0.46). This observation can be explained by the predominant somatic and dendritic contribution to the ECoG simulated signal, having lower-frequencies than the axonal contribution that contributes more significantly to the SEEG-like signals (see also spectra in Fig. 8).

3.6 Discussion

Simulating realistic EAP waveforms is a great challenge because they depend on many parameters such as the different ionic channels of the membrane, their density, the detailed morphology and the electrode position (Gold et al. 2006; Pettersen and Einevoll 2008). The method that we propose in this paper does not aim to reproduce these highly realistic waveforms, but to compute qualitatively plausible EAPs, especially of the axon contributions, with a very low computational burden.

Indeed, the computation speed is significantly enhanced with respect to more sophisticated simulation techniques, as for example the LFPy/NEURON environment, that we used as a ground-truth to evaluate the performances of our approach. The computation time is decreased by at least an order of magnitude. For example, on a personal laptop, simulating the extracellular potential (in one point in space) due to 1000 pyramidal neurons modelled as above (BS, with an axon having 1000μ m length and 2μ m in diameter and en equivalent dendrite of 200μ m length and 2μ m diameter), during one action potential (10ms), takes 10s using the morphological filter (implemented in Matlab) and 215s using the multicompartmental approach (LFPy/NEURON - in Python). The difference is even higher if we only compute one single Hodgkin-Huxley model for all 1000 neurons, in this case the simulation using the morphological filter only lasts 400ms for the 1000 neurons (note that this last option can be considered if all neurons are assumed to share exactly the same dynamics, i.e., there is no difference among them in surfaces or in conductances/capacities).

On the same laptop, for the complete population of 5000 neurons and the 3 seconds length signal presented in the previous Section 3.5, the simulation of the EAPs contribution to the extracellular potential takes 17.5 s for one point in space (slightly less than two hours for the complete simulation on the almost 400 points in space representing the set of laminar/SEEG/ECoG electrodes),Footnote 9 while the LFPy/NEURON simulation takes more than 4 hours for a single point in space.

This increase in computation speed does not necessarily alter the accuracy of the simulation for simple ball-stick type neurons, in particular for those with a rather small equivalent dendrite stick. Moreover, in these favourable configurations, the parameters of the morphological filter used in the simulation can be tuned using basic information about the morphology of the simulated neurons (see Section 3.2) and the resulting EAPs have qualitatively realistic features: the axon propagation speed depends on the diameter, waveform shapes and spectra depend on the morphology of the NEURON (short/long axons and dendrites) and on the position of the electrode.

On the other hand, the morphological filter approach has its limits. Returning to Figs. 5 and 6, it seems that the model parameters v and CS are less plausible and/or saturate for the short axons/long dendrites configurations. For example, Fig. 7 seems to indicate that our empirically/biologically tuned model is physiologically valid for morphologies limited to the first three rows (axons above 600μ m) and for shorter axons also as long as they remain thin (2μ m) or when the dendrites weight is low. Indeed, the yellow bars (c and d) in the lower right corner of Fig. 5 are implausibly high - the axonal speeds are too fast. Similarly, Fig. 6 shows that in the lower right corner (and partially even in the upper rows, for long dendrites) the CS coefficients are saturated (as a matter of fact, we have tested values up to ± 20, and even if the figures are saturated to ± 10, the obtained optimal values of CS are actually saturated at ± 20). In other words, the best correlations between the LFPy ground truth and the morphological filtering model are obtained for implausible values of some of the filter coefficients. On the one hand, even if they loose their physiological meaning, they still might be simply interpreted as model coefficients necessary for a good reproduction of the actual EAP shapes (this reasoning might hold for 400μ m axons and long dendrites, for which higher speeds ensure higher correlations, see the last three columns of the fourth row in Figs. 3 and 5). On the other hand, these morphologies might simply be seen as out of the reach of our model.

The accuracy of the method diminishes further for more complex morphologies. Indeed, cells such as the L5 pyramidal neurons have good results only on the axon side and this is the most critical issue (and future research direction) of the model. Some possible explanations of these weak performances could be linked to the (oversimplified) dipolar approximation on the dendrite side: complex apical dendrites cannot be modelled by a single equivalent dipole having a somatic origin (in fact, the dipole approximation of this configuration stems from two monopoles, one in the soma and the other somewhere far in the apical dendrite: we are thus in a near field situation, where the dipolar model does not hold; in other words, only the potentials of the electrodes situated far from the two monopoles model could be modelled using a dipole approximation, meaning that almost all electrodes on the dendrite side are affected by this error). Of course, it is totally possible that a two monopole approximation would not be sufficiently accurate neither (although a qualitatively acceptable approximation seems to hold Pettersen et al. 2012). In this case, multicompartmental models and full cable theory need to be used. Even so, as long as the dendrites models remain passive and the soma and the axon active, one can imagine combining the LFPy cable computations (for simulating the dendrites contributions) with the morphological filter introduced in this paper (for the axonal contribution) in order to obtain fast and accurate EAPs for passive dendrites/active axon NEURON models (as EAP computation is simply a linear combination of the two). This would still imply only one active compartment simulation (soma), instead of a complete LFPy simulation of a full NEURON with passive dendrites and active soma and axon.

We also have to note that the model and the results proposed in this paper were validated on neurons having an unmyelinated axons above 200μ m. We might legitimately ask if the model can be adapted to myelinated axon. In our opinion, the myelin shield isolates the axon and the only visible contributions to the EAPs are, in this case, those generated by the initial unmyelinated part (the contributions of the Ranvier nodes to the EAPs should be small, both because they are situated in principle far from the recording sites and because of their small surface). Still, unmyelinated long axons or axons with long initial segments are not uncommon. In the literature, unmyelinated 1mm axons were reported for the (rat) CA3 pyramidal cells, as well as long unmyelinated initial axonal segments, from 200μ m the (ferret) L5 pyramidal neurons to 1mm for the (rat) CA3 pyramidal cells or Dentate Gyrus granule cells, see Kress and Mennerick (2009) and the references therein.

To sum up, our morphological filter model yields reliable results (reproduces accurately the EAPs at different space locations) for neurons having a rather radially distributed dendritic tree around the soma (basal dendrites). Apical (biased and/or tilted) dendritic ramifications diminish the performances (although they remain correct if these ramifications are not very important and can be modelled by a short equivalent dendrite). For biased dendritic trees (i.e., non-null “equivalent dendrite”) the results are maintained as long as the axon is significant compared to the equivalent dendrite assumed to account for the spatial bias of the dendritic tree. The parameters of our filter are biologically founded and depend on the NEURON morphology.

4 Conclusion

This paper introduces a new method to model extracellular signatures of action potentials, starting from single-dipole neurons and requiring thus only one computation of the membrane dynamics.

We showed that the proposed method is able to fit accurately a large variety of shapes of action potentials for various neurons morphologies with a predominant axon compared to the dendrite. For inhibitory neurons and morphologies with a predominant axon, these EAPs shapes are really similar to those produced by state of the art multicompartmental models such as LFPy/NEURON (Lindén et al. 2014), while the gain in computational speed is shown to be of one to two order of magnitude.Footnote 10 Moreover, they are qualitatively comparable to those found in experimental extracellular recordings from the literature (Robbins et al. 2013). The main novelty is the rewriting of the potentials generated by a travelling action potential (along the axon) as a convolution with a morphological filter whose coefficients can be estimated from the NEURON morphology and the relative position of the recording electrode with respect to this NEURON. The parameters of the morphological filter have biophysical justifications and interpretations (traveling speed along the axons, total dendrite surface). Choosing adequately these coefficients, it should be possible to simulate neurons morphologies producing different EAPs shapes. Despite the use of such simple modeling, our results provide evidence that the proposed model is indeed able to reproduce features of the EAPs already observed in recent studies, such as the time/frequency variability at different positions around the neurons.

We have also shown that with this simulation setup we are able to rapidly compute the EAP contributions from a whole population of neurons with different morphologies (yielding waveforms qualitatively comparable to inhibitory and excitatory EAP shapes). Using as input a realistic rasterplot, the method proposed in this paper could be seen as a computationally efficient alternative to HybridLFPy (Hagen et al. 2016).

The simulated population signal could be in principle used for preliminarily testing signal processing methods such as spike sorting algorithms. Other spike sorting benchmark signals simulators were proposed in the literature, either multicompartmental based methods (Camuñas-Mesa and Quiroga 2013) or including real spikes (Martinez et al. 2009). Unlike these methods, the approach described here can handle a complete population simulation, including (close) single and (far) multi-units as well as (farther) population contributions. It is true that, in our approach, the variability among the simulated EAPs does not stem mainly from the morphology, but from the relative positions of the electrodes with respect to the neurons. Still, enriched with a more accurate model of the dendritic contribution, with variable HH dynamics per NEURON and with synaptic contributions (using for example the methods proposed in Mazzoni et al. (2015) and Aussel et al. (2018), see preliminary results in Aussel et al. 2019), our approach might become an all-in-one simulation method of extracellular potentials, potentially able to compete with (state of the art) hybrid methods combining real signals, simulated noise and detailed multicompartmental models.

To conclude, our method could become a valuable tool to generate qualitatively realistic extracellular potentials of neuronal populations being done on any computer. It also shows that the variability of the obtained EAPs shapes due to relative position changes of a NEURON with respect to the electrodes is important, indicating that the spatial configuration is a strong factor influencing for example spike sorting algorithms. We believe that the tool we propose here can be a starting point for a more complete simulator useful to validate, train or benchmark neural signal processing methods such as spike sorting algorithms.