1 Introduction

A major feature of the human brain is the complexity of its organization. It consists of a vast network of hundreds of billions of neurons whose connections and activities are a complex and poorly understood process both on microscopic and on macroscopic scale [1]. This huge network is the support of brain activity that governs the entire functioning of the human body.

Obtaining better knowledge of how the brain functions generates applications in the short or medium term, especially in the medical field (treatment of epilepsy, using the surgical decision analysis of mental disorders) and long-term implications that could cover the whole of the human activity.

Consequently, several methods have been introduced in order to analyze the brain activities for various applications [13]. Among the best methods to visually represent the brain activity is the brain mapping. The electroencephalogram (EEG) signals, which represent the measurements of the electrical activity bound to current generators on the scalp surface, are considered amid the means for generating these types of images. A brain mapping founded on EEG signals shows the distribution of potentials over the full scalp by creating images of electrical activity at a given time point.

The evoked potentials such as EEG record the scalps electrical activity only on specific points corresponding to the electrode locations. In order to reconstruct a comprehensive potential representation on the surface of the scalp, it is necessary to estimate the potential for all points in the map from the values measured at the electrode positions. The development of the interpolation algorithms is considered as a solution to calculate the potential data for each map pixel [2].

These algorithms are mathematical techniques to compute the most possible potential values on places where no measure was performed. They are principally based on the potential values on the electrodes and the distances between the points to be interpolated and the measuring points.

In this context, different studies have been conducted. The first ones have used the 2D interpolation algorithms such as the 2D K nearest neighbors [4], the polynomial interpolation [5] and the thin-plate splines [1, 6]. These two-dimensional methods require planar projections of the scalp.

Other works extended these techniques to three-dimensional brain mapping [1, 79]. For instance, in [8], the authors have exploited 3D barycentric interpolation techniques to accomplish the calculation of scalp potentials. They, also, have used the 3D polynomial interpolation and the spherical polynomial interpolation. However, these polynomial methods give unsatisfactory results, especially in the case of the smallest orders. Other methods are already used in many other works including the spherical spline method that is the most commonly used one [7, 8, 10].

The main objective of this work is to predict the evolution of the EEG signals both at spatial and at temporal characteristics of the electrical activity in order to get perceivable spatiotemporal representations of these signals. Starting from 19 recording electrodes of patients having different behavioral states, this work proposes to use not only 3D classical interpolation techniques belonging to two mathematical families (spline, barycentric) to obtain a 3D EEG mapping of 128 electrodes, but also a novel interpolation technique based on multiquadratic interpolation. To validate the robustness and the efficiency of these interpolation techniques, the normalized root mean squared error (RMSE) is calculated.

This paper is interested not only in providing the estimated potential distributions of different patients having various behavioral situations, but also in changing the Euclidean distances between the electrodes by the corresponding arc length. In addition to the development of the classical interpolation methods such as 3D global barycentric, 3D K nearest neighbor, 3D spline, spherical spline methods, the multiquadratic method was applied to the EEG because of its similarity of calculation with the 3D spline function.

First, to interpolate the EEG signals, a semi-sphere, which replaces the 3D head scalp, is implemented. Interpolation methods are used to establish the EEG activity at interpolated sites. The main purpose of this work at this level is to determine the distance between the electrodes using the arc length instead of the Euclidean distance. Once the potential is generated at different places, this work proceeds to the second step, which is to test the efficacy of the interpolation methods by calculating the RMSE and the processing time. Finally, a comparison of the proposed interpolation techniques will be given.

2 Methods

The interpolation technique proposed in this paper is composed of four blocks: the EEG pretreatment, the projection of the real scalp onto the semi-sphere, the application of interpolation methods and the calculation of the evaluation parameters such as RMSE and processing time.

2.1 Pretreatment of EEG signals

The useful frequencies in the EEG signal are in the range of 1–35 Hz (low frequencies), where delta, theta, alpha and beta waves are identified. In the high frequency, gamma bands are very interesting for the cognition study, but unfortunately the signal to noise in these bands is bad.

For this reason, a band-pass filter that comprises high-pass filter in cascade with a low-pass filter is developed. The high-pass filter is a Butterworth filter of order 6 with a cutoff frequency of 1 Hz. The low-pass filter is a Butterworth filter of order 6 whose cutoff frequency equals 35 Hz.

2.2 Projection of scalp electrode positions onto the semi-sphere

The spherical interpolation methods substitute the head scalp by a semi-sphere [7, 8, 11].

Let us denote:

  • r is the radius of the semi-sphere, which was given by using the Nelder–Mead simplex algorithm as described in [12].

  • (XYZ) the Cartesian coordinates of a scalp point.

  • \((R,\theta ,\phi )\) its spherical coordinates, where

    $$\begin{aligned} \left\{ \begin{array}{l} {\theta =\arctan \left( \frac{Y}{X}\right) }\\ {\phi =\arctan \left( \frac{\sqrt{X^{2} +Y^{2}}}{Z} \right) } \end{array}\right. \end{aligned}$$
    (1)

    So the Cartesian coordinates

  • (xyz) of the projection of this scalp point onto the semi-sphere is calculated by Eq. 2.

    $$\begin{aligned} \left\{ \begin{array}{l}{x=r\cdot \sin (\phi )\cdot \cos (\theta )}\\ {y=r\cdot \sin (\phi )\cdot \sin (\theta )} \\ {z=r\cdot \cos (\phi )}\end{array}\right. \end{aligned}$$
    (2)

2.3 Interpolation methods

Let us denote:

  • Es is a set of M real points \(es_{l} ,l=1\ldots M\), where real cerebral activity \({Vs}_{{l}}\) is measured.

  • E is a set of N virtual points \(e_{k} ,k=1\ldots N\), where interpolated potential value \({V}_{k}\) will be calculated.

  • \((xs_{l} ,ys_{l}, zs_{l})\) and \((x_{k} ,y_{k} ,z_{k})\) are, respectively, the \(es_{l}\) and \(e_{k}\) point coordinates.

2.3.1 Barycentric interpolation

The 3D global barycentric interpolation

The potential interpolated by the 3D global barycentric method at each point \(e_{k}\) is the weighted sum of the potentials attributed to each electrode of the \(E_{s}\) set. The weight attributed to each \(E_{s}\) electrode is a function of the Euclidean distance between the \(E_{s}\) electrode and the \(e_{k}\) point (Eq. 3).

(3)

where m is the interpolation order, \(d_{kl}\) is the Euclidean distance between the electrodes \(e_{k}\) and \(es_{l}\):

$$\begin{aligned} d_{kl} =\sqrt{(x_{k} -xs_{l} )^{2} +(y_{k} -ys_{l} )^{2} +(z_{k} -zs_{l} )^{2}} \end{aligned}$$
(4)

The 3D spherical barycentric interpolation

The formulae of the 3D global spherical barycentric method are the same as for the 3D global barycentric interpolation, except that the \(d_{kl}\) Euclidean distance between \(e_{k}\) and \(es_{l}\) is being replaced by the corresponding arc length. The formula of the arc length is calculated as follows:

$$\begin{aligned} \hbox {arclen}(e_{k} ,es_{l})=\theta \times r \end{aligned}$$
(5)

where:

$$\begin{aligned} \theta =\arccos \left( \frac{(x_{k} ,y_{k} ,z_{k} )^{t} \times (xs_{l} ,ys_{l} ,zs_{l})}{r^{2}}\right) \end{aligned}$$
(6)

2.3.2 Spline interpolation

The spherical spline interpolation

Let \(es_{l}^{p}\) and \(e_{k}^{p}\) denote, respectively, the projection of the \(es_{l}\) and \(e_{k}\) points on the semi-sphere. The spherical spline method assumes that the potential \(V_{k}\) at any point \(e_{k}\) on the surface of the semi-sphere can be defined by Eq. 7:

$$\begin{aligned} V_{k} =c_{0} +\sum _{l=1}^{M}c_{l}.g\left( \cos \left( e_{k}^{p} ,es_{l}^{p} \right) \right) \end{aligned}$$
(7)

where \(c_{l} ,l=1\ldots M,\) are C vector coefficients, determined by the following set of linear equations:

$$\begin{aligned}&Gc+tc_{0} = Vs \end{aligned}$$
(8)
$$\begin{aligned}&t^{t} c=0 \end{aligned}$$
(9)

Let us denote

$$\begin{aligned} t= & {} [1,1,\ldots ,1]^{t} \\ G= & {} [g_{ij} ]=g\left( \cos \left( e_{si}^{p} ,e_{sj}^{p} \right) \right) \end{aligned}$$

The function g is given by Eq. 10:

$$\begin{aligned} g(x)=\frac{1}{4\Pi } .\sum _{n=1}^{\infty }\frac{2n+1}{n^{m} (n+1)^{m} } .P_{n} (x) \end{aligned}$$
(10)

The integer m determines the order of the \(V_{s}\) spline. According to [7], the interpolation is better for order 4.

\(P_{n} (x)\) is the ordinary Legendre polynomials of order n which have been calculated recursively as follows:

$$\begin{aligned}&P_{0} (z)=1\nonumber \\&P_{1} (z)=z\nonumber \\&P_{l+1} (z)=\frac{1}{2l+1} [(2l+1)P_{l} (z)-lP_{l-1} (z)] \end{aligned}$$
(11)

The 3D spline interpolation

A more general category of spline function, called the spline surface, was inserted to the EEG research by [6]. Later, [1, 7, 13] extended this function to three dimensions by interpolating the EEG potential directly without the projection of the scalp surface into a plane [14]. The interpolated value \(V_{k}\) on the \(e_{k} \) point is determined by the 3D spline interpolation as follows [15]:

$$\begin{aligned} V_{k}= & {} \sum _{l=1}^{M} P_{l} h_{m} (x_{k} -xs_{l} ,y_{k} -ys_{l} ,z_{k} -zs_{l} ) \nonumber \\&+ \sum _{d=0}^{m-1}\sum _{f=0}^{d}\sum _{g=0}^{f}q_{dfg} \, \, x_{k} ^{d-f} \, \, y_{k} ^{f-g} \, \, z_{k} ^{g} \end{aligned}$$
(12)

where

  • $$\begin{aligned} h_{m} (r,s,t)=(r^{2} +s^{2} +t^{2} )^{\frac{2m-3}{2} } \end{aligned}$$
    (13)
  • \(P_{l}\) and \(q_{dfg}\) are given by solving the matrix form of Eq. 12 applied to source points:

    $$\begin{aligned} \left( \begin{array}{l} {H} \\ {F^{t} } \end{array}\right. \left. \begin{array}{l} {\, \, \, \, \, \, \, F} \\ {^{\, \, \, \, \, \, } 0} \end{array}\right) \left( \begin{array}{l} {P} \\ {Q} \end{array}\right) =\left( \begin{array}{l} {Vs} \\ {0} \end{array}\right) \end{aligned}$$
    (14)

with:

$$\begin{aligned} H= & {} (H_{ij} )_{1\le i,j\le M} =h_{m} (xs_{i} -xs_{j} ,ys_{i} -ys_{j} ,zs_{i} -zs_{j} )\nonumber \\\end{aligned}$$
(15)
$$\begin{aligned} F= & {} \left( \begin{array}{l} {1\, \, \,\quad xs_{1} \, \, \, \, \,\quad ys_{1} \, \, \, \, \, \,\quad zs_{1} \, \, \, \, \,\quad xs_{1}^{2} \, \, \, \, \, \,\quad xs_{1} \,\cdot ys_{1} \,\quad \ldots \, \, \,\quad zs_{1}^{m-1}} \\ {\vdots \, \, \, \, \, \,\quad \vdots \, \, \, \, \, \, \, \, \, \, \,\quad \vdots \, \, \, \, \, \, \, \, \, \, \, \,\quad \vdots \, \, \, \, \, \, \, \, \, \, \,\quad \vdots \, \, \, \, \, \, \, \, \, \, \, \, \, \, \, \,\quad \vdots \, \, \, \, \, \, \, \, \, \, \, \, \, \, \, \, \, \,\quad \ldots \, \, \, \, \, \, \, \,\quad \vdots } \\ {1\, \,\quad xs_{M} \, \,\quad ys_{M} \, \, \, \,\quad zs_{M} \, \,\quad xs_{M}^{2} \, \, \, \,\quad xs_{M} \cdot ys_{M} \,\quad \ldots \quad zs_{M}^{m-1}} \end{array}\right) \nonumber \\ \end{aligned}$$
(16)

The 3D spline interpolation using the arc length

The same procedure as the 3D spline interpolation method is used, but the Euclidean distance between the measuring electrode and the electrode to be interpolated is superseded by the corresponding arc length as described in Eq. 5.

The interpolated \(V_{k}\) is calculated by Eq. 17:

$$\begin{aligned} V_{k}= & {} \sum _{l=1}^{M}P_{l} h_{m}(\hbox {arclen} (e_{k} ,es_{l} ))\nonumber \\&+\sum _{d=0}^{m-1}\sum _{f=0}^{d}\sum _{g=0}^{f}q_{dfg} \, x_{k}^{d-f} \,\, y_{k} ^{f-g}\,\,z_{k}^{g} \end{aligned}$$
(17)

The \(h_{m}\) polynomial will be written as follows:

$$\begin{aligned} h_{m} (\hbox {arclen}\, \, (e_{k} ,es_{l} ))=(\hbox {arclen}\,(e_{k} ,es_{l} ))^{\frac{2m-3}{2} } \end{aligned}$$
(18)

\(P_{l}\) and \(q_{dfg}\) are given by solving the matrix form of Eq. 17 applied to source points , where:

$$\begin{aligned} H=(H_{ij} )_{1\le i,j\le M} =h_{m} (\hbox {arclen}(es_{i}, es_{j})) \end{aligned}$$
(19)

2.3.3 The multiquadratic interpolation

The multiquadric interpolation is composed of two terms. The first one is the derived function that has almost the same shape as the 3D spline. The second one is the radial basis function that comprises an arbitrary constant \(\beta \) where \(\beta >0\) [16]. The interpolated potential \(V_{k}\) calculated by the multiquadric interpolation is written as follows:

$$\begin{aligned} V_{k} =\sum _{l=1}^{M}B_{l}\sqrt{d_{kl}^{2} +\beta ^{2}} \end{aligned}$$
(20)

where \(d_{kl} \) is the Euclidean distance between the interpolated point and the measured point. The \(B_{l} , l=1 \dots M\), are B vector coefficients obtained by solving the following system:

$$\begin{aligned} { \left( \begin{array}{cccc} {\beta } &{} {\sqrt{d_{12}^{2} +\beta ^{2} } } &{} {\ldots } &{} {\sqrt{d_{1M}^{2} +\beta ^{2} } } \\ {\sqrt{d_{21}^{2} +\beta ^{2} } } &{} {\beta } &{} {\ldots } &{} {\sqrt{d_{2M}^{2} +\beta ^{2} } } \\ {\vdots } &{} {\vdots } &{} {\ddots } &{} {\vdots } \\ {\sqrt{d_{M1}^{2} +\beta ^{2} } } &{} {\sqrt{d_{M2}^{2} +\beta ^{2} } } &{} {\ldots } &{} {\beta } \end{array}\right) \left( \begin{array}{c} {B_{1} } \\ {B_{2} } \\ {\vdots } \\ {B_{M} } \end{array}\right) =\left( \begin{array}{l} {Vs_{1} } \\ {Vs_{2} } \\ {\vdots } \\ {Vs_{M} } \end{array}\right) } \end{aligned}$$
(21)

2.4 RMSE

To evaluate the results that are obtained by the 3D interpolation methods, the normalized root mean squared error (RMSE) is calculated. The RMSE measures the error between the real values and the estimated ones. For comparing the quality of the six interpolation methods (3D global barycentric interpolation (M1), spherical barycentric interpolation (M2), spherical spline interpolation (M3), 3D spline interpolation (M4), 3D spline interpolation using the arc length (M5), and multiquadric interpolation (M6)), it is necessary that the matching between the 109 measured values and their corresponding interpolated values should be compared. This matching is judged by calculating the RMSE.

Let Vr is a vector of the 109 real measured values and V is the corresponding interpolated values:

$$\begin{aligned} Vr= & {} (Vr_{1} ,Vr_{2} ,\ldots ,Vr_{n} )^{t}\\ V= & {} (V_{1} ,V_{2} ,\ldots ,V_{n} )^{t} \end{aligned}$$

The RMSE is given as follows:

$$\begin{aligned} \hbox {RMSE}=\frac{\left\| Vr-V\right\| }{\left\| Vr\right\| } \end{aligned}$$
(22)

with the superscript \({\parallel }{\parallel }\) denoting the Euclidean norm.

Table 1 Evaluation results of the interpolated methods
Fig. 1
figure 1

Example of brain mapping of a patient who underwent the third protocol generated by: a real recordings with 19 electrodes, b real recordings with 128 electrodes, c M1 method, d M2, e M3, f M4 (order 3), g M4 (order 2), h M5 (order 3), i M5 (order 2), j M6 (=1), k M6 (=0.5)

3 Materials

The EEG datasets of 60 healthy subjects (30 females and 30 males aged are between 20 and 45 years) were recorded by a 128 channel BioSemi system with a 256 Hz sampling frequency. Only 19 channels of the 128 electrodes were used to interpolate the EEG data. Each subject of the 60 participants took part in three recording protocols; each protocol is 10 min long.

In the first protocol, the subjects were asked to close their eyes for 2 min to make them feel comfortable and to avoid eye movements and muscle contractions which could disrupt the brain activity. Then, they were asked to open and close their eyes for 60 s to evaluate reactivity.

In the second protocol, all subjects were exposed to an external light simulation by using a photic strobe stimulator having various flash rates from 1 to 60 Hz with a 20-s rest period between flash frequencies. A flash lamp was positioned in front of the subject, 35 cm away and directed toward his/her eyes.

The data of the last protocol were recorded during rapid questions. Each subject was required to answer by pressing one of two buttons. If Yes, the subjects would press the right button and if No, they would press the left button.

4 Results and discussion

This section focuses on evaluating the results generated by the interpolation methods using two criteria. The first one is the RMSE mean that calculates the error between the real electrodes and the interpolated ones. The second one is the processing time mean of each interpolation method that is the time average of the calculating time method of the 60 subjects at the 3 behavioral states.

The analysis of the interpolation algorithms was tested using MATLAB on a laptop having Core 2 Duo CPU with a frequency of 2.00 GHz and a RAM of 2.93 Go.

Fig. 2
figure 2

Temporal representations of: a real EEG potential and interpolated EEG using the multiquadratic interpolation, b RMSE, of Fpz electrode of a patient who underwent the third protocol

Table 2 Multiquadratic performance comparison with others interpolation methods

Table 1 presents a comparative study of the six interpolation techniques.

According to Table 1, the barycentric family interpolations have, in all the three behavioral protocols, the highest RMSE mean by comparing them with the other interpolation methods. Although the substitution of the Euclidean distances by the corresponding arc length between the missing and the real electrodes decreases the RMSE mean of the barycentric families, these methods are less accurate compared with the spline interpolation families.

The spline family is characterized by the most minimal RMSE mean, in particular the 3D spline interpolation (order 3), relative to barycentric family. The statistical findings show that the order 3 in case of the 3D spline interpolation is to be preferred to order 2. Besides offering the closest interpolated map to the real EEG map (Fig. 1), the 3D spline method provides continuity peeping out the EEG potential map.

The results of this novel method based on multiquadric interpolation, especially in case is equal to 0.5, appear to be very satisfactory considering the mean of the RMSE (the RMS mean according to the three protocols is equal to 0.0921) and the processing time. Relative to the spline interpolation family, the multiquadric technique is quicker thanks to its simplicity. Furthermore, this method is very accurate. Its RMSE is very close to the 3D spline one. The features of these two interpolation techniques are very similar.

In the results presented in Table 1, the RMSE of the third functional brain state is the worst for all the interpolation techniques. These results are generated by the significant difference of the electrical activity in the reflection situation from one individual to another. In other words, each person has their own reflection principle as well as their response time. In that event, the electrical activity of the brain is more chaotic compared to other functional brain situations. Consequently, it is harder to treat and interpolate the EEG potentials in this behavioral situation. Thus, the behavioral state is an important factor to control the interpolation of the electrocortical activity.

The bioelectrical signals such as the EEG are characterized by their strong dynamic aspect [1]. For this reason, a temporal representation of the EEG data besides the spatial one provided.

Figure 2a illustrates the comparison between real EEG and interpolated EEG (by multiquadratic method) temporal representations of the Fpz electrode of a patient who underwent the third protocol. These EEG temporal descriptions are evaluated in term of RMSE (Fig. 2b).

As a general interpretation of these results, it was noted that the interpolated EEG temporal representation is very similar to the real EEG one. In fact, Fig. 2b shows a small RMSE, which is between 0 and 1.9, for a time period of 200 s.

Finally, a comparative study of the multiquadratic interpolation with five other interpolation methods reported in the literature [6, 8] is given in Table 2:

Table 2 indicates that interpolation methods reported in [6, 8] have high average RMSE with regard to our proposed multiquadratic method.

5 Conclusion

In conclusion, the aim of this present paper is to provide a 3D representation of the brain activity based on EEG records of healthy subjects in three different behavioral states. First, 3D classical interpolation techniques belonging to two mathematical families (barycentric, spline), which are in function of the Euclidean distance between the estimated and real electrodes, were developed. Second, these methods were changed by replacing the Euclidean distance with the corresponding arc length. However, the major contribution of this work is to apply the multiquadratic method to EEG. Finally, the different interpolation algorithms were compared by calculating the RMSE and processing time means. The results show that the multiquadratic and 3D spline techniques give the optimal representation models of the electrocortical activity, but the multiquadratic method has the minimal processing time. The approach outlined in this study could be performed by applying dimension reduction algorithms before the step of EEG interpolation in order to reduce the correlation between electrodes and ameliorate the signal-to-noise ratio (SNR).