Using a structured-light 3D scanner to improve EEG source modeling with more accurate electrode positions

BACKGROUND
In this study, we evaluated the use of a structured-light 3D scanner for EEG electrode digitization. We tested its accuracy, robustness and evaluated its practical feasibility. Furthermore, we assessed how 3D scanning of EEG electrode positions affects the accuracy of EEG volume conduction models and source localization.


NEW METHOD
To assess the improvement in electrode positions and source results, we compared the electrode positions both at the scalp level and by quantifying source model accuracy between the 3D scanner, generic template, and cap-specific electrode positions.


RESULTS AND COMPARISON WITH EXISTING METHODS
The use of the 3D scanner significantly improves the accuracy of EEG electrode positions to a median error of 9.4 mm and maximal error of 32.8 mm, relative to the custom (median error of 10.9 mm, maximal error 39.1 mm) and manufacturer's template positions (median error of 13.8 mm, maximal error 57.0 mm). The relative difference measure (RDM) of the EEG source model averaged over the brain improves from 0.18 to 0.11. The dipole localization error averaged over the brain improves from 11.4 mm to 7.0 mm.


CONCLUSION
A structured-light 3D scanner improves the electrode position accuracy and thereby the EEG source model accuracy. It is more affordable than systems currently used for this, and allows for robust and fast digitization. Therefore, we consider it a cost and time-efficient way to improve EEG source reconstruction.


Introduction
Electroencephalography (EEG) is a valuable method to study brain function for cognitive research (e.g. for studying memory (Klimesch, 1999), perception (Busch et al., 2009) or attention (Klimesch et al., 1998)) and clinical diagnosis of patients (e.g. for epilepsy (Smith, 2005) or Alzheimer's disease (Jeong, 2004)). EEG allows to record and monitor electrical brain activity with a high temporal resolution from a number of electrodes placed on the scalp. The number and placement of electrodes vary: for clinical purposes, it might be 21 electrodes placed according to the "10-20" scheme (Jasper, 1958;Sinha et al., 2016), or for research purposes, it may be higher density electrode arrays placed according to extensions of the 10-20 scheme (Keil et al., 2014) or more uniformly dense and approximately equidistant arrangements (e.g. the EGI Geodesic Net, EasyCap Equidistant Layout, BrainProducts R-Net).
The EEG potential that we measure at each scalp electrode is a superposition of the activity of multiple neural sources, whose locations and temporal behaviors are not easy to distinguish. Being able to characterize the sources provides better insight into how the brain works, such as how it processes stimuli, which specific brain regions are involved, and whether the processing is sequential or parallel. Source reconstruction aims to both identify the sources and disentangle the time course of simultaneous activity (Scherg and Picton, 1991).
EEG sources can be reconstructed using models that relate the signal generators (simplified as equivalent current dipoles or as distributed dipole models) to the potentials on the electrodes. These models describe the conduction of the electrical currents through the intermediate tissues of the head. Realistic volume conduction models use anatomical data of the head such as an individual's magnetic resonance imaging (MRI) scan (Vorwerk et al., 2014) to make a geometrical description of the different tissue types with their different conductive properties. Source reconstruction also requires the location of the electrodes on the scalp to be specified in the model. Individual electrode positions can be measured with a stylus-shaped digitizer, e.g. using an electromagnetic digitizer (Polhemus, Colchester, VT) or an optical digitizer (NDI Polaris, Ontario, Canada). However, both the MRI T and the electrode digitizer are expensive in terms of equipment and are time-consuming procedures.
Consistent placement of electrodes allows for EEG recordings that are comparable over subjects or multiple recordings within one subject for channel level analysis. In 1958, Jasper (1958 described the international standard 10-20 system, which described a procedure to determine electrode positions using external anatomical landmarks. The motivation was to make scalp EEG recordings more comparable between subjects; source reconstruction methods did not yet exist. The 10-20 scheme places the electrodes according to a pre-specified model with distances of 10% and 20% over the scalp, relative to anatomical landmarks. The 10-20 procedure (or extension thereof) can also be applied to computer models of the scalp to determine electrode positions on a volume conduction model of the head (Jurcak et al., 2007), but this does not take the limited accuracy of the anatomical landmarks into account: especially the inion is not always easy to identify in an anatomical MRI. Another problem in the (extended) 10-20 electrode placement procedure is that many researchers use caps from a flexible fabric with electrodes mounted at fixed locations, where the cap manufacturer has placed the electrodes approximately at the locations of the 10-20 system. Although these caps exist for different head circumferences (usually in steps of 2 cm, i.e. 54, 56, 58, and 60 cm) and have some flexibility, the expected average difference between a subject's head circumference and the best fitting cap is still 0.5 cm. Furthermore, caps are designed and manufactured to fit a typical head, whereas individuals' head shapes differ. Consequently, when EEG caps are used to position electrodes on the scalp of an individual, the position of the electrodes can deviate from the ideal position according to the 10-20 system.
As the practical application of the 10-20 procedure using a measuring tape has limited accuracy, researchers have been developing and implementing different solutions for more accurate placement of the electrodes. For example, in 1981 Ary et al. (1981) used a Plexiglas helmet to capture the conformation of the head. To create this helmet, they placed a swimming cap on the subject and pushed a bowl of fast setting gel around the head while the subject's head was upside down. After some further processing, this resulted in a hard Plexiglas helmet that fits the subject's head. As the last step, they used a rotating protractor device to draw contours on the helmet that were used to reproducibly locate electrode positions on the helmet. A method using more recent technology is described by Song et al. (2018), who demonstrate how augmented reality can be used to improve placement and replacement of EEG electrodes.
Although the consistent placement of electrodes over subjects is relevant for group studies and meta-analysis of scalp-level EEG results, the holy grail of EEG consists of source reconstruction and interpreting results at the level of the cortical activity. For this, it is not a necessity to have electrodes placed according to some pre-specified scheme, only that electrode positions are correctly modeled. Hence, rather than placing the electrodes on the scalp as accurately as possible according to the 10-20 scheme, researchers have developed methods to measure the actual position of the electrodes after placement. De Munck et al. (1991 described the use of a caliper to manually measure the relative distances between the electrodes and to use these distances to fit electrode positions to a spherical model. Localizing electrode positions with this procedure was however very time consuming, hence Le et al. (1998) proposed to measure the distance between fewer points and to interpolate the remaining positions (see also He and Estepp (2013)). However, these manual measurement techniques remain laborious and require experience, fine motor skills, and patience of both researcher and subject.
Since the early '90 s, the Polhemus (Raab et al., 1979;Williamson et al., 1991;Swerdloff et al., 1993) electromagnetic digitizer has been in use by many EEG laboratories. This tool comprises a transmitter that produces an electromagnetic field at multiple frequencies, and one or multiple probes that act as the receiver. The position of the receiver is localized relative to the transmitter based on the distribution of the electromagnetic fields. To our knowledge, the first implementation of this device for the measurement of electrodes positions is described by Gevins et al. (1990). The Polhemus Fastrak costs around 8000 USD (list price in 2019), which is an investment that not all EEG labs can or are willing to make. Furthermore, large metal objects need to be sufficiently far away from the recording setup, as they distort the electromagnetic fields. Echallier et al. (1992) evaluated a computer-assisted placement of electrodes with an ultrasound system to localize electrodes and compared it to the 10-20 placement procedure. They reported that the ultrasound system has a higher reproducibility of electrode positions than the 10-20 placement procedure. However, the ultrasound measurements through air are affected by environmental factors that impose limits on the practical value of this technique, e.g. the speed of sound through air is influenced by humidity and room temperature, acoustic reflections from nearby walls can interfere with the localization, and it requires a direct line of sight between transmitter and receiver.
Another way to localize electrode positions, is using contrast-rich markers which are visible in MRI, e.g. capsules filled with a fatty substance such as Vaseline (Lagerlund et al., 1993) or vitamin E. However, this requires the availability of an MRI scanner close to the EEG setup, which makes this approach time-consuming, costly and not widely available to EEG researchers. Furthermore, it is procedurally not trivial to ensure that the MR markers are on the identical position as the EEG electrodes.
A relatively new approach to localize electrodes is based on photogrammetry. Using several photos taken from different angles, a 3D model of the head with the EEG cap can be constructed and subsequently used to localize electrode positions. Bauer et al. (2000), for instance, used a dome with 12 cameras, whereas Clausner et al. (2017) used a single DSLR camera to localize electrodes, and Reis and Lochmann et al. (Reis and Lochmann, 2015) used an infrared light motion capture system (IR-MOCAP) with 8 cameras. The challenges with these techniques are the ambient light conditions and camera quality. Furthermore, a system consisting of several cameras can still be expensive and take considerable space in the EEG lab. Koessler et al. (2011) used an industrial 3D scanner (EXAscan 3D scanner from Creafrom, Lévis, Canada). They attached reflective targets to the sensors and thereby were able to automatically digitize and label EEG electrode positions. The scanner itself is not produced anymore, but similar products of the same company range from 30.000 to 100.000 CAD.
In this study, we evaluated a low-cost structured-light based 3D scanner (Rocchini et al., 2001). Structured-light sensors are nowadays found in consumer products, e.g. in the Kinect camera used with the Xbox for gaming and in the iPhone X to unlock the phone using the facial details of the owner. The specific 3D scanner we used is the Structure Sensor from Occipital (Boulder, CO), which is designed to be mounted on an iPad tablet and through an app integrates with the iPad camera and accelerometer and costs 399 USD. Specifically, we want to quantify the accuracy and robustness of localizing EEG electrodes and the corresponding influence on source estimates. We do not anticipate the 3D scanner to reach the high accuracy of some of the other hardware methods, but we hypothesize it to be an improvement over template-based electrode positions and expect that it might be more easily adopted in EEG labs due to its lower cost and faster procedure. Furthermore, the insights gained from 3D scanned head surfaces may also be of relevance for improved co-registration between MEG and anatomical MRI (Troebinger et al., 2014).

Subjects
Most other studies on electrode localization that we reviewed used a single or few subjects (Le et al., 1998;He and Estepp, 2013;Echallier et al., 1992;Lagerlund et al., 1993). In contrast, we planned for a large sample of subjects to allow an evaluation of the procedural robustness and the time that it takes to scan the electrode positions. We included 50 subjects in our study (29 males /21 females, mean age 25.32 and, STD 8.74, RANGE: 18-63) from whom we acquired EEG electrode positions and anatomical MRIs. The experimental procedure was approved by the local ethics board and all subjects gave informed consent. The initial plan was to acquire data from 31 subjects for evaluation (30 subjects for evaluation, 1 for construction of a template), but after quality control checks early in the analysis pipeline (see below) we excluded the data of 19 subjects from the analysis and supplemented these with another 19 subjects. The results on the excluded subjects are detailed in the supplementary material.

Data
For this study, we acquired T1 weighted anatomical MRIs, Polhemus recordings, and 3D scans of the subjects wearing an EEG cap. The MR data were acquired on different MR scanners in our center: Siemens Skyra 3 T, Prisma 3 T, Prisma fit 3 T, and Avanto 1.5 T. The MR data on the different scanners were acquired consistently with an MP RAGE (Brant-Zawadzki et al., 1992) sequence and an isotropic resolution of 1 mm. We used the Polhemus Fastrak (Polhemus, Colchester, VT, USA) with the Electrode Digitizer software v1.2a (CTF MEG, Cocquitlam, BC, Canada). The 3D scanner we used was the Structure Sensor (Occipital Inc., Boulder, CA), combined with an Apple iPad mini 4 (Apple, Cupertino, CA). The EEG caps that we used were from Easycap (Easycap GmbH, Hersching, Germany) with the "M10" equidistant 61 electrode layout and with electrode holders for the ActiCap EEG system (BrainProducts, Gilching, Germany).

Attaching cap
We measured the subject's head circumference with a flexible measuring tape. From the available cap sizes (54, 56, 58, and 60 cm) we selected the one with the closest head circumference. We applied the cap to the subject and measured the distance from nasion to inion and from left to right preauricular points. We made sure that the electrode holders along the midline from anterior to posterior were on a straight line. Subsequently, we checked that the electrode holders along the central line from left to right were on a straight line. If necessary, small adjustments were done by manually correcting the cap and reevaluating the positions. The cap was applied without any electrodes inserted into the electrode holders.

3D scanner procedure
Following cap placement, we used a felt-tip marker to mark the position of the nasion and the preauricular points for later co-registration to the Polhemus and anatomical MRI. After this, we instructed the subject to sit still and scanned the head shape and electrodes. The procedure can be seen in detail on a video presented on YouTube (https://youtu.be/d6FZlZTf-Hg) with a subject that was not part of the current study. An example of a result can be seen in Fig. 2.

Polhemus procedure
We used the Polhemus with one transmitter and two receivers. The transmitter is permanently attached to the back of a wooden chair, just below the subject's left shoulder. One of the receivers is attached to plastic goggles that the subject wears during the scanning, the other receiver is stylus-shaped and used to click on each electrode position. The use of two receivers, where one is fixed to the subject, allows the subject to make small movements during the scanning without affecting the localization accuracy. We asked the subject to sit comfortably and refrain from moving during acquisition. We digitized the position of the nasion, the left and right preauricular points, and subsequently of all 62 electrodes, starting at the vertex at location 1 (green) and circling outwards (see Fig. 1).

MRI procedure
We acquired a T1 weighted MRI from each subject or, where possible, used an already available T1 weighted MRI.

Experimental design
In our experimental design, we varied the method to digitize electrode positions: -the Polhemus applied to each subject (POL) -the 3D scanner applied to each subject (3D) -a custom template for the electrode positions that we recorded ourselves (CT)  For the CT, we used the Polhemus to acquire electrode positions from one representative subject that acted as the template. For the MT, we downloaded the electrode positions from the Easycap website (Wayback Machine, 2019). We consider this approach similar to using template electrode positions that are included in EEG analysis software, such as EEGLAB (Delorme and Makeig, 2004, RRID:SCR_007292), FieldTrip (Oostenveld et al., 2011, RRID:SCR_004849) or BESA (Besa GmbH, Gräfelfing, Germany, RRID:SCR_009530); the developers of the respective software packages also rely on template positions that they either download or create themselves (EEGLAB, 2019; Template 3-D electrode sets -FieldTrip toolbox, 2019c; Source Analysis Head Models -BESA, 2019).
We consider the combination of POL and an individual's MRI as the most accurate and hence the golden standard model. We compared the individual's golden standard reference model to three other models based on 3D, CT, and MT combined with the individual's MRI to see the effect of accurately determining the electrode positions.

Quality control and robustness
To quantify the robustness of Polhemus and 3D scanner, we counted the datasets that were fully usable in all pipelines. The criteria we set were (1) a correctly placed EEG cap, (2) a usable 3D scan dataset, (3) a usable Polhemus dataset.
The first criterion (correct cap placement) was not explicitly planned but was decided upon during the data acquisition period. Visual inspections of the initial batch of acquired data revealed that for some subjects the cap was not optimally placed. Specifically, the cap was not sufficiently pulled down over the forehead, leading to electrodes that were systematically displaced. While this would be no problem in comparing the Polhemus and 3D scanner-based electrode positions, it would lead to a considerable difference with the template electrode positions and hence unfavorable results for the templates compared to the measured positions. The influence of this can be seen in the supplemental material. To decide whether or not to include a dataset in the main analysis, we visually verified for each 3D scanned head surface that the subset of the 10-20 positions in the M10 electrode cap matched computer-generated 10-20 electrode positions using the ft_electrodeplacement function in the FieldTrip toolbox, which implements a virtual 10-20 electrode placement procedure (Jurcak et al., 2007).
For the quality assessment, we report on 49 out of the 50 subjects. We excluded the data of the single subject that was selected a priori to be used for the template construction, since for that subject we explicitly ensured throughout all procedures to have correct cap placement and good data quality.

Quantification of electrode position accuracy
To quantify the accuracy of electrodes, we computed the Euclidean distance between POL to 3D, CT, and MT for all electrodes that we recorded for all subjects. As there is no influence of the position of the ground electrode on source reconstruction, we did not include it in the analysis. Furthermore, we excluded the two electrodes close to the eyes, which in our EEG lab procedures are used to derive a bipolar horizontal EOG channel that is used to clean the data, but that is not used in source reconstruction.
We used the Kruskal-Wallis test to evaluate whether the electrode positions recorded with the different techniques have the same distribution.

Quantification of forward model accuracy
For this study we did not acquire actual EEG data, the focus is rather on the geometrical modeling related to source reconstruction. Since our interest is not in a particular EEG paradigm with activity in a specific cortical region, but rather for EEG generators that may be distributed over the whole cortex, including the acquisition of EEG would have increased the complexity of the data acquisition and would have limited the results to the specific experimental stimulation and/or task paradigm.
To quantify the effect of inaccurate electrode placement on source reconstruction, we created a source model for each subject derived from the FreeSurfer cortical sheet (Dale et al., 1999, RRID:SCR_001847). This allows us to place dipolar sources with an orientation orthogonal to the surface, compute the scalp potentials for the different electrode positions, and visualize how electrode position errors translate to errors at the source level. The cortical sheet is modeled using approximately equally sized triangles, resulting in an approximately uniform distribution of dipoles over the cortex. Dipoles were placed at the vertices of the cortical sheet. The orientation of the dipole was computed by taking a surface-weighted average of the orientation of the adjacent triangles. The FreeSurfer meshes allow for a one-to-one mapping between the triangulated cortical sheets of different subjects. This allows us to average over subjects.
We investigated the effect of electrode positions using EEG forward models. A forward model is a mathematical description of how electrical currents flow through the volume conductor and are visible as potential difference on the scalp. We used the relative difference measure (RDM, (Meijs et al., 1989;Güllmar et al., 2010)) to quantify differences in scalp potentials based on previous studies using it on forward models (Wolters et al., 2006;Mosher et al., 1999;Gramfort et al., 2010). The RDM expresses the difference between normalized spatial distributions u ref and u as a scalar ranging from 0 (equal distributions) to 2 (opposite distributions). In our case, the spatial distributions u ref and u are vectors of length N with the potential at the N electrodes for a given source. Double vertical bars around a vector indicate its Euclidean norm.
To quantify the differences, we computed the RDM between the scalp potential distribution of POL and 3D, CT and MT respectively. The RDM between scalp potential distributions is computed for each dipole position on the cortical sheet; hence, the RDM can be topographically displayed on the cortical sheet.
To evaluate the global differences in the scalp potential for all dipoles distributed over the cortical sheet, we averaged the distribution of RDM values over the cortex to obtain a single value per subject and model comparison. We used a paired t-test to evaluate whether the RDM averaged over the cortex of POL compared to 3D, CT, and MT are the same. As this involves three pair-wise comparisons, we applied a Bonferroni correction and set the threshold at 5% divided by three.

Quantification of dipole localization accuracy
We also investigated the effect of electrode position on dipole localization errors. We computed for each dipole the potentials on the electrode locations of POL. Subsequently we used these potential distributions to localize a dipole using the electrode locations 3D, MT, and CT. We quantified the localization error as the Euclidean distance between the initial and fitted dipole position for each vertex of the cortical sheet. Similar to the forward model quantification, the dipole localization errors can be topographically mapped and averaged over subjects.
To evaluate the global localization error for all dipoles over the cortical sheet, we averaged the localization error over the cortex to obtain a single value per subject and per model comparison. We used a paired t-test to evaluate whether the dipole localization error averaged over the cortex of POL compared to 3D, CT, and MT are the same, again with a Bonferroni correction for the three pair-wise comparisons.

Quality control and robustness
The data from the 3D scanner passed the quality criteria and were fully usable in 48 of 49 subjects. For one subject, the acquisition itself showed no malfunction, but the data transmission from the iPad failed: this was identified only upon inspection of the data on the analysis computer after the subject had already left.
The data from the Polhemus digitizer passed the quality criteria in 48 out of 49 subjects. The one failing dataset had four electrodes with locations that were multiple centimeters away from the scalp. This was not detected during data acquisition, but only after the subject had already left.
The quality of the cap placement met our criteria in 30 out of 49 subjects. Based on visual inspection of the difference of the automatically placed and the measured electrodes, we excluded 19 subjects from the main analysis. For these subjects especially the frontal electrodes showed a discrepancy, indicating that the cap was not properly pulled down over the forehead and that electrode 3 was not at location Fpz. The results from the excluded subjects are summarized in the supplementary material.
Summarizing the quality control procedure left us with 29 (5 subjects for creating and optimizing the analysis pipeline, 24 subjects for the subsequent analysis) out of 49 subjects for further analysis, plus one subject that was selected a priori to create the template models. The spatial distribution of the electrode position accuracy is displayed in Fig. 4. For 3D the errors are overall low, with a small increase over the back. The CT errors are visible in the front, the central and the back part of the head. For MT there is a similar error distribution as for 3D, but errors are larger, especially over the back part of the head.

Forward model accuracy
The effect that electrode position errors have on forward-computed EEG scalp potential is shown in Fig. 5. The forward model differences in 3D are overall low, with a small increase in the back. The RDM values for CT are overall larger than for 3D. For MT we see the same pattern as for 3D, but with higher RDM values at the back.
The individual subjects' averaged RDM for the differences between POL and 3D, CT, and MT can be seen in Fig. 6. Forward model accuracy with 3D (average RDM of 0.11) is significantly better than MT (average RDM of 0.18, t(23) = −7.54, p < 0.001) and is strictly better for all individual subjects. Forward model accuracy with CT (average RDM of 0.13) is significantly better than MT (t(23) = −7.62, p < 0.001) and is better for all individual subjects except one. Forward model accuracy with 3D is not significantly better than CT (t(23) = −2.31, p = 0.03).

Dipole localization accuracy
The effect that the electrode position has on dipole localization error is shown in Fig. 7. The dipole localization errors for 3D are overall low, with a small increase in the back. The localization errors in CT are overall larger than 3D. For MT the localization error is overall larger than 3D, and CT, especially at the back. The pattern of dipole localization errors resembles that of the RDM errors in Fig. 5.
The averaged dipole localization error between POL and 3D, CT, and MT can be seen for the individual subjects in Fig. 8. Dipole localization accuracy with 3D (average localization error of 7.0 mm) is   significantly better than MT (average localization error of 11.4 mm, t (23) = −5.03, p < 0.001). Localization error for CT (average localization error of 8.6 mm) is significantly better than MT (t(23) = −5.00, p < 0.001). Localization error with 3D is not significantly better than CT (t(23) = −1.47, p = 0.077). The pair-wise comparisons of dipole localization error correspond to the results for forward model accuracy.

Procedure timing
We did not perform a formal and precise assessment of the time required for both techniques, since that time includes not only the actual recording procedure, but also bringing the subject to the lab where the Polhemus is located, seating the subject, giving the subject instructions, and putting on the goggles (for the Polhemus). Since we performed the two recordings immediately in succession in a single procedure, we cannot specify the time for either one separately. Having performed the procedure 50 times for both techniques, we estimate that for the Polhemus it takes 7 min (which scales with the number of electrodes, 62 in our case) and for the 3D scanner it takes 2 min (which is independent of the number of electrodes).

Summary and discussion
The goal of this study was to compare EEG electrode localization accuracy, forward model errors, and source localization errors using a structured-light 3D scanner, an electromagnetic digitizer, and templates.
The robustness of the experimental procedure was for both the 3D scanner and the Polhemus in general positive, but not flawless. Both techniques failed once out of the 49 subjects; in one of the Polhemus measurements four electrodes were clearly not on the scalp, and in one of the 3D scanner measurements the data was corrupted during transmission from the iPad to the desktop computer.
Comparing the accuracy of the electrode positions, we found that the 3D scanner better corresponded to the Polhemus with a median error of 9.4 mm, maximal error of 32.8 mm, relative to the custom template positions (median error of 10.9 mm, maximal error 39.1 mm) and the manufacturer's template positions (median error of 13.8 mm, maximal error 57.0 mm). The forward model accuracy with the 3D scanner (average RDM of 0.11) and the custom template (average RDM of 0.13) are both significantly better than with the manufacturer's template (average RDM of 0.11). Also the dipole localization accuracy with the 3D scanner (average localization error of 7.0 mm) and the custom template (average localization error of 8.6 mm) are both significantly better than with the manufacturer's template (average localization error of 11.4 mm).
The 3D scanner still has quite some mismatch to the electrode  positions measured with the Polhemus (our golden standard), but the 3D scanner is closer to the Polhemus than either template method. The use of the manufacturer's template electrode positions diminishes the quality of the source estimates and therefore the potential to provide accurate insights into brain activity. In our opinion, actual electrode digitization is generally superior to electrode position templates. Another observation is the time and cost-efficiency of a 3D scanner over the Polhemus. The 3D scanner that we employed here costs less than 1000 Euro in combination with an iPad and requires 2 min for a semi-skilled user (see also Taberna et al. (2019)) who report similar acquisition times), while a Polhemus Fastrak system costs about 8000 Euro and takes 3.5 times longer. There is a trade-off between procedural time and accuracy. For certain populations, e.g. infants, the total experimental time in the lab is limited; longer EEG preparation time results in less time remaining for the actual experiment. However, for a measurement with the 3D scanner, the subject has to remain still during the 2-minute acquisition, which may limit the usability in certain populations.
Due to their ease of use, template electrode positions provided by EEG hardware manufacturers or with EEG analysis software might provide a good alternative to individual electrode digitization. However, this requires that manufacturers provide actual electrode position measurements for all caps that they produce, rather than spherical coordinates. Increased data sharing between labs and proper metadata annotation of cap manufacturer, model and size would contribute to the availability of good templates, e.g. using the BIDS structure (Pernet et al., 2019).
Over the last years, there have been significant improvements on the accuracy of volume conduction models (Vorwerk et al., 2014) and these models have become more widely available (Vorwerk et al., 2018). However, improvements in the quality and availability of data have not necessarily kept up with these algorithmic developments. In our study we see that moving from a manufacturer's template for electrode positions (average RDM of 0.18, average dipole localization error of 11.4 mm) to a 3D scanner based digitization (average RDM of 0.11, average dipole localization error of 7.0 mm); this roughly corresponds to the improvements observed when moving from a 4-compartment to a 6-compartment Finite Element Method (FEM) volume conduction model (Vorwerk et al., 2014). Although the RDM improvements due to electrode digitization or due to more detailed FEM modeling are of the same magnitude, they differ quite in the investments required to exploit them: creating sophisticated FEM models requires individual subject MRIs and considerable amounts of work for every subject, and hence do not scale very well for studies that include larger numbers of subjects. Consequently, we believe that for most cognitive neuroscience labs it is currently challenging to exploit the advantages of sophisticated FEM models. However, we do think that for many labs it is feasible to get more complete EEG data acquisition, including electrode positions. The 3D scanner we demonstrate in this study could benefit EEG source analysis to a similar amount as sophisticated FEM models.
Our evaluation of the manufacturer's electrode positions template shows a pronounced inaccuracy at the back of the head. This corresponds to the tail of the distribution of the electrode errors (Fig. 3, up to 57.0 mm). Even when averaged over subjects, this mismatch at the back remains high. Presumably, the main reason for this is that the template electrodes were provided in spherical coordinates. Since the head is not a sphere, after co-registration, scaling, rotation, and translation, there are still errors in electrode placement on the template head surface. Furthermore, it is difficult to identify the inion with the co-registration software. Due to the limited accuracy of the template electrode positions and co-registration, at this moment we recommend not to use EEG cap manufacturer's templates for studies that focus on occipital brain activity using source reconstruction techniques. To resolve the inaccuracy at the back, we propose that EEG cap manufacturers provide realistic templates based on actual measurements or that researchers share their measured electrode positions.
For labs that are not doing source reconstruction, we want to highlight that electrode positions will inevitably vary over subjects, even when placed with a cap and/or according to a specific placement scheme. The mismatch in electrode positions will result in variance in the measured potentials over subjects. To tackle this variance, an electrode digitizer could be used in combination with the interpolation of the EEG of single subjects onto common electrode positions.
We also identified some disadvantages in the use of the 3D scanner. External cables can block the visibility of electrodes. This problem can be avoided with caps that have the wires closely attached to, or underneath the top-most fabric layer, or with caps that have thin black wires, which do not reflect the IR light of the 3D sensor. Furthermore, we noticed that the texture mapping between the 3D geometry and the photograph is often imprecise. Although the colors make the 3D mesh look more realistic, we only used the bumps in the 3D geometry and not the colors for localizing the electrodes. Furthermore, the 3D scanner acquires facial details that are problematic from a data-sharing perspective: to protect research participants, the identifiable features need to be removed from the mesh prior to sharing of raw data, or only the processed EEG electrode positions should be shared as a point cloud.

Conclusion
In this study, we investigated the utility of a 3D scanner for the measurement of electrode positions and for improving EEG source reconstruction. It is a low-cost (less than 1000 Euro) and a fast alternative to using a Polhemus digitizer. It is more accurate than template electrode models and results in better forward solutions and smaller dipole localization errors. Our recommendation is to localize electrode positions with a Polhemus digitizer or a device with similar accuracy, or to use a structured-light 3D scanner to improve on electrode positions and source reconstructions.
The 3D scanner we investigated here might also be considered for co-registration of other types of sensors placed on the head surface. Specifically, it might be useful for the OPM-based on-scalp MEG recordings which comprise magnetic field sensors that are mounted on the head in a very similar way as EEG electrodes (Boto et al., 2018;Zetter et al., 2019), or to record the position of NIRS optodes (Piper et al., 2014).

Data availability
The data used in this manuscript and all scripts used in computation of the results are available from http://hdl.handle.net/11633/aacfpuja.

Declaration of Competing Interest
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.

Acknowledgment
This work was supported by the Innovative Training Network, ChildBrain, funded by the Marie Curie Actions of the European Commission (H2020-MSCA-ITN-2014). We acknowledge the constructive comments that we received from the reviewers on earlier versions of this manuscript. So the funding source can be found under: https://cordis.europa.eu/project/rcn/193844/factsheet/en.

Appendix A. Supplementary data
Supplementary material related to this article can be found, in the online version, at doi:10.1016/j.jneumeth.2019.108378.