Article | Open | Published:

# Accurate signal-source localization in brain slices by means of high-density microelectrode arrays

## Abstract

Extracellular recordings by means of high-density microelectrode arrays (HD-MEAs) have become a powerful tool to resolve subcellular details of single neurons in active networks grown from dissociated cells. To extend the application of this technology to slice preparations, we developed models describing how extracellular signals, produced by neuronal cells in slices, are detected by microelectrode arrays. The models help to analyze and understand the electrical-potential landscape in an in vitro HD-MEA-recording scenario based on point-current sources. We employed two modeling schemes, (i) a simple analytical approach, based on the method of images (MoI), and (ii) an approach, based on finite-element methods (FEM). We compared and validated the models with large-scale, high-spatiotemporal-resolution recordings of slice preparations by means of HD-MEAs. We then developed a model-based localization algorithm and compared the performance of MoI and FEM models. Both models provided accurate localization results and a comparable and negligible systematic error, when the point source was in saline, a condition similar to cell-culture experiments. Moreover, the relative random error in the x-y-z-localization amounted only up to 4.3% for z-distances up to 200 μm from the HD-MEA surface. In tissue, the systematic errors of both, MoI and FEM models were significantly higher, and a pre-calibration was required. Nevertheless, the FEM values proved to be closer to the tissue experimental results, yielding 5.2 μm systematic mean error, compared to 22.0 μm obtained with MoI. These results suggest that the medium volume or “saline height”, the brain slice thickness and anisotropy, and the location of the reference electrode, which were included in the FEM model, considerably affect the extracellular signal and localization performance, when the signal source is at larger distance to the array. After pre-calibration, the relative random error of the z-localization in tissue was only 3% for z-distances up to 200 μm. We then applied the model and related detailed understanding of extracellular recordings to achieve an electrically-guided navigation of a stimulating micropipette, solely based on the measured HD-MEA signals, and managed to target spontaneously active neurons in an acute brain slice for electroporation.

## Introduction

Extracellular recording by means of in vitro high-density microelectrode arrays (HD-MEAs)1,2,3,4,5,6,7,8,9 has become a powerful tool to resolve subcellular details of single neurons in active networks, grown from dissociated cells, using the spatial information of extracellular action potentials (EAPs). Culturing cells directly on the electrode array allows for detection of neuronal signals along a 2-dimensional plane at high signal-to-noise ratio, so that small axonal signals propagating along axonal arbors can be tracked10,11,12,13. In brain-slice microelectrode-array (MEA) experiments, however, the active neurons of interest are inside the tissue slab and feature a 3D arrangement, while the viable cells are a few tens of micrometers away from the electrodes14,15. Localization of extracellularly recorded active units or neurons in brain tissue is a known challenge, both experimentally and computationally16,17,18. An accurate localization of the detected cells in brain slices could facilitate the classification of the respective cell types and allow for manipulation of target cells by e.g., electroporation, electrical stimulation, local pharmacology application, or other interventions. In this work, we study how signal sources in brain slices can be detected by HD-MEAs in order to establish an accurate localization method of the signal sources. We used a known and simple source in all experiments and models—a point-current source.

To understand the correlation between brain slice signals and HD-MEA data, we developed models of the HD-MEA recording environment and, importantly, we compared the models with actual high-spatial-resolution experimental data obtained from HD-MEAs. Previous work by Ness et al. presented a modeling-only study, which included slices on traditional MEAs19. Assuming an insulating MEA surface, the method of images (MoI)20,21,22 was applied to the volume-conductor theory20 in order to analytically compute the electric potentials on the MEA surface. The MoI model was then compared to finite-element-method (FEM) simulations. We here extended the proposed MoI and FEM models by considering factors that we could control in our experimental setup, such as the height of the saline bath, the conductivity of the saline, the location of acute cerebellar slice layers with respect to the point source, and the location of the reference electrode. To compare and validate the models, we performed experiments with both, saline only and acute brain slices in culture solution by using HD-MEAs with 11,011 electrodes (3,150 electrodes per mm2)1 for recording and a stimulating glass micropipette as a point-current source.

Several factors affect the electrical potential landscape on MEAs in general, whether the signal is coming from a simple point source or from a complex source, such as a neuron. For cell-culture experiments, the amplitude of neuronal signals was observed to increase when mineral oil—a non-conductive fluid normally used to prevent evaporation of culture medium—was poured onto the MEA dish (unpublished data). Similarly, it has been shown that a sheet of glia can serve as an insulator layer and increase the spike amplitude of cultured cells23. Microtunnels made of poly(dimethylsiloxane) or PDMS also amplify action potentials propagating along axons24,25,26. In this study, we analyzed how different saline heights, with the saline-to-air interface acting as an insulator, affect the amplitude of MEA signals. For acute brain slice experiments, the reduced conductivity of brain tissue with respect to saline has to be considered and substantially affects the amplitude of the recorded signals. Brain tissue has been mostly considered and modeled as homogeneous and resistive material21,27,28.

A thorough understanding of the HD-MEA extracellular environment is a requirement for accurate localization of signal sources in brain slices. In detail, we studied if a realistic HD-MEA model could improve the accuracy (see definition in Methods) of localizing the micropipette in saline and in an acute brain slice. We separated the localization problem into two parts: (a) x-y localization and (b) z localization. We used 2D Gaussian fitting for the x-y localization, assuming the brain slice being homogeneous in the x-y direction, and MoI and FEM models to assess the z-distance (distance between the source and the HD-MEA surface) of the point source in saline and in the presence of an acute brain slice. We fitted the measured potential distribution to the simulated potential distributions of both MoI and FEM models to estimate the z-distances.

To demonstrate an application and the performance of the localization algorithm, we targeted single spontaneously active neurons in acute cerebellar slices for electroporation with a micropipette using a micromanipulator. This experiment served as a proof of concept for solely using the signals of HD-MEAs to steer micropipettes with high accuracy and to demonstrate that an all-electrical electrophysiology and micropipette control system could be realized. Instead of using a microscope to visualize the cells and the micropipette tip, the HD-MEA acted as an electrical-imaging camera to localize both, the electrically active cells and the micropipette. The combined micropipette-HD-MEA approach offers prospects of an electrically guided automated patch-clamp29, in contrast to blind30,31,32 and visually33 guided approaches. Future applications of this method aim towards high-throughput single-cell manipulation and analysis.

## Results

We developed a localization method that allows for accurate identification of the 3D position of a micropipette, representing a point source, above the HD-MEA surface in the presence of saline or acute brain slices. For simplicity, we separated the localization problem into two parts: x-y localization and z localization. In this way, we were able to extract the x-y location of the point source independently of its z location. Estimating the x-y location is straightforward, based on the peak potential, and we will show that accurate localization can be achieved by Gaussian fitting. For z localization, we performed the following steps: First, we acquired a large experimental HD-MEA data set by recording the signal characteristics and potential landscape of a stimulating micropipette located at various defined z-distances in saline above the microelectrode array. The obtained data were then used to derive an experimentally determined point spread function (PSF), and served as a basis for finding the best HD-MEA model for use with the localization algorithm. Second, we modeled the recorded HD-MEA signals by using two methods19, (1) analytical equations based on volume-conductor theory and the method of images (MoI), and (2) a finite-element method (FEM). Using these two methods, we explored different parameters that can affect the HD-MEA signals. Third, we determined parameters in the MoI and FEM models that best described our experimental conditions, such as saline column height, tissue thickness and ground location. We then generated data sets for each model by simulating the electrical potential landscape of a stimulating micropipette at z-distances between 1 and 1000 μm at 1 μm increments. Finally, we acquired HD-MEA recording data, while the position of the stimulating micropipette was tracked by the micromanipulator software and confirmed by using microscopy whenever possible (i.e., when the micropipette tip was not inside the slice tissue). We used all these recordings to determine the accuracy of the developed localization method. In a last step, we applied the localization method to target and electroporate individual, spontaneously active neurons in acute slice preparations.

### In-plane localization of micropipettes

To utilize the HD-MEA for locating the position of a micropipette, this micropipette needs to produce an electrical signal, which can be detected by the electrode array. Upon injecting a periodic voltage or current signal (sine or square wave), the micropipette generates an electric field in the conductive medium (saline or culture medium), the potential distribution of which can be measured by the 2D planar electrode array. The signal amplitude on each electrode can be extracted by using fast Fourier transformation (FFT) or demodulation. We applied either sinusoidal or square-wave current signals at 1 kHz frequency, where the tissue shows predominantly Ohmic behavior34. We chose this frequency, as it is close to the action-potential (AP) frequency, and as the signal-to-noise ratio (SNR) performance of the HD-MEA is optimized for the AP range1. We considered the micropipette tip as a point source35 and then imaged the electric potential landscape induced by the micropipette.

The conductor volume above the array surface and its conduction properties shape the electrical field. A homogeneous isotropic medium (e.g., saline or culture medium) will yield a potential that decreases uniformly in all directions (i.e., a symmetric circular potential spread across the MEA), while an inhomogeneous anisotropic medium (e.g., a brain slice) will distort the symmetry of the electric field and result in more complex potential patterns. Figure 1c,e shows amplitude maps measured under different conditions. A sketch of the micropipette above an HD-MEA electrode is shown in Fig. 1a. An upright microscope was used to confirm the location of the micropipette with respect to the HD-MEA surface in saline (Fig. 1b) and in the presence of an acute cerebellar slice (Fig. 1d). Acute brain slices of 200 μm thickness were obtained from a 5-week old GAD67-GFP knock-in mouse, in which a large fraction of GABAergic neurons, such as cerebellar Purkinje cells, were GFP positive36. The use of this specific mouse type allowed for identification of the different cerebellar layers in the slice. Amplitude maps, obtained by recording from the full microelectrode array, are shown in Fig. 1c for a micropipette in saline and Fig. 1e for a micropipette in an acute brain slice at two different layers. The square-wave stimulation signal was 50 nA at 1 kHz in all instances. The signal patterns in Fig. 1e were recorded by the electrode array, while the micropipette was in the molecular layer (ML) and granular cell layer (GCL), and evidenced different tissue anisotropies of the cerebellar layers. The location of the peak potential reflects the x-y position of the micropipette tip.

We localized the x-y position of the micropipette using two-dimensional Gaussian fitting. Since the search was only for the location of the peak amplitude, a 2D Gaussian least-squares fit was considered sufficient, despite the residuals in the fitting. The results are shown in Fig. 2a. The measured x-y location of the micropipette for each data point corresponds to the programmed micromanipulator position and was confirmed by visual inspection. The target positions were chosen randomly above the electrode array such that the positions were not directly on top of an electrode. We used square-wave (50 nA, 1 kHz) stimulation and recorded for 10 s per location. The data were then analyzed offline to estimate the x-y location from the electrical recordings. We computed the x-y localization errors by subtracting the measured x-y coordinates (microscope and/or micromanipulator data) of the micropipette from the x-y location estimated from the electrode data. The mean and standard deviation (s.d.) of the errors are as follows. When the pipette z-distance was between 5 and 50 μm (N = 51), the mean ± s.d. values were 0.01 ± 0.31 μm and 0.03 ± 0.44 μm, for x and y respectively. The errors increased slightly for pipette z-distances between 50 to 200 μm (N = 106), where the mean ± s.d. were −0.08 ± 0.70 μm for x and −0.04 ± 0.73 μm for y. As expected, the systematic error for these measurements was negligibly small for the full range of z-distances considered, i.e., the mean errors were close to zero. Overall, a single x-y location estimate in saline can be expected to be precise within ±1.46 μm, with 95% confidence.

For experiments with an acute brain slice, we localized the micropipette within the tissue (≤200 μm). In order for the micropipette to move smoothly through the tissue, the micromanipulator was adjusted to approach the HD-MEA surface perpendicularly, i.e., at a 90° angle. The x-y positions were determined only according to micromanipulator movements after calibration. The x-y error results are shown in Fig. 2b, where the mean values ± s.d. amounted to −0.14 ± 0.81 μm and −0.04 ± 0.70 μm for x and y, respectively. On the other hand, for z-distances between 50 to 200 μm, the errors were −0.06 ± 1.01 μm for x and 0.22 ± 0.94 μm for y. Similar to the saline-only case, the systematic error for these measurements in tissue was small (<0.25 μm). Moreover, the precision of x-y localization in tissue is ±2.02 μm, with 95% confidence. To simplify the x-y localization algorithm in brain slices, we assumed homogeneous conductor properties of the tissue in the x-y directions and used 2D Gaussian fitting. The inhomogeneity of the tissue does not create abrupt changes in the potential distribution according to the 2D features of the potential distribution that were observed in cerebellar slice experiments (see also Fig. 1e). The x-y localization errors were low considering the size of the electrodes (10.2 × 8.6 μm2) and the distance between electrodes of 17.8 μm. If the x-y localization method will be applied to target single cells, the localization errors are small with respect to the diameter of cell somas (approximately 10 to 30 μm).

### Localization of micropipettes along the z-axis

Aside from estimating the x-y location of the micropipette on the array, the electrical potential distribution reflects the z-distance of the signal source. In order to obtain a point spread function (PSF) on the HD-MEA, we measured the electrical potential distribution for z-distances ranging from 20 to 1000 μm. Figure 3a (z-distance of 50 μm) and b (all z-distances) show the electrical-potential-spatial-decay curves obtained from the experiments. An electrical potential spatial decay comprises of all extracted electrical potential values, plotted as a function of the radial distance of the recording electrode (along the x-y plane) to the location of the maximum amplitude. The potential spatial decays were normalized to the maximum potential for each z-distance. We compared the potential spatial decays obtained from the experiments to the modeling results and show the residuals in Fig. 3c (see next subsections for the description of the models).

We quantified the steepness of the potential spatial decay curves by computing the area under the curve (denoted as “Area”). The Area under each curve was obtained by numerical integration of the amplitude values in an interval of 1 to 1000 μm distance from the peak amplitude. When the slope of the curve is infinite, the Area is one; on the other hand, if the Area value is 1000, the curve is flat (zero slope). This approach allows for generalizing the potential spread in dependence of the z-distance, irrespectively of the magnitude of the signal amplitude. Figure 3d,e present the Area results under saline conditions.

#### HD-MEA models: method of images

The method of images (MoI) provides an analytical solution to the potential in a volume conductor involving boundary surfaces, which apply to HD-MEA measurements19,20,21,22,35. We will introduce details of the MoI concept in the Methods section and we summarized the equations used in this work in Tables 1 and 2. In brief, MoI replaces the boundaries with virtual point current sources located at appropriate positions to meet the respective boundary conditions. We refer the readers to literature19,37 for a more detailed discussion and derivations of the equations. We first considered the following cases. The HD-MEA surface was modeled as an electrical insulator with the following boundary conditions: (i) a semi-infinite conductor model in the z-direction considering the insulating electrode array surface (Equation 2) and (ii) a bounded model with two boundaries, i.e., the insulating array surface and the liquid-to-air interface (Equation 3). The potential ϕse, induced by a point current source I located at (x, y, z), can be calculated at any point (x′, y′, 0) on the electrode array using the equations in Table 1. The conductivity σs refers to saline medium. For all simulations based on the described models, we used the same current amplitude I as in the experiments, 50 nA. The conductivity values used in all MoI models are given in Table 3.

Adding an acute brain tissue on top of the HD-MEA introduces inhomogeneity in the volume conductor. A tissue slice features inhomogeneous and anisotropic conductivity. Nevertheless, in a first-order approximation, we modeled the slice as a homogeneous tissue volume and introduced changes in conductivity at the boundaries of the slice. The x-y dimensions of a brain slice are typically much larger than its z-dimension, and measurements are mostly conducted near the center area of the slice, which is sufficiently far away from the tissue volume lateral boundaries. We therefore assumed a slice of infinite extension in x-y dimension and only included interface boundaries in the z direction. Similar to the saline case above, we considered two boundaries: the HD-MEA surface and the tissue-saline interface. The effect of a third interface, which represented the saline-air interface, was assumed to be a constant value C in the tissue MoI model. We present the MoI models for a brain tissue conductor in Table 2. The main difference between the bounded MoI models for saline (Equation 3) and for tissue (Equation 4 and Equation 6) included the conductivity changes at the tissue-saline boundary. In Equation 3, the weighting factor, WSA, is a constant value equivalent to 1 for the saline-air interface, while in Equation 4 the factor for a tissue-saline interface has negative values for all odd n’s and positive values for all even n’s. Therefore, the series rapidly converges for the tissue-saline bounded MoI model, and a finite number of terms for the summation can be chosen19. In this work we summed, similar to Ness et al., over 20 terms for bounded MoI models with tissue conductor. The effect of the tissue-saline boundary becomes negligible when the z-distance becomes hT.

#### HD-MEA models: finite-element method

For an even more realistic HD-MEA representation, including the effects of grounding and the shape of the chamber hosting the liquid, we created a finite-element-method (FEM) model using COMSOL Multiphysics version 5.2 and COMSOL with Matlab. A descriptive sketch of the HD-MEA FEM model is shown in Supplementary Fig. S03a. The 3D model geometry consisted of the saline bath (Supplementary Fig. S03b) and the acute brain slice (Supplementary Fig. S03c). Two versions of the acute slice model were created, one that was isotropic and another one, which was anisotropic and inhomogeneous. The HD-MEA surface, at which the electrical-potential distribution and voltage signal amplitudes were computed, was placed in the center of the chamber.

We set the electrical conductivity of the saline and tissue domains in the model based on measured conductivity values and literature. We summarized the conductivity values used for MoI and FEM simulations in Table 3. For saline, we used a 4-pole conductivity probe (SevenGo SG23 with InLab 738-ISM, Mettler Toledo, Ohio, US) to measure the conductivity of the solution (phosphate-buffered saline, PBS) to σS = 1.31 ± 0.20 S/m. The entire chamber (4 mm height, 8.5 mm radius) was filled with saline in the FEM model as in the experiments. For the acute-slice model, we also measured the conductivity of the saline covering the slice (artificial cerebrospinal fluid, ACSF), which was σS = 1.18 ± 0.13 S/m. We simplified our cerebellar-slice model by creating two adjoining boxes corresponding to two cerebellar layers, the granular-cell layer (GCL) and molecular layer (ML). The thickness of the boxes was 0.2 mm, which was the same thickness as that of the slices in the experiments. However, the conductivity and anisotropy of the acute cerebellar slices dissected from mice were unknown. For both the MoI and FEM models, we used values based on previous measurements of the tissue conductivity in turtle38 and cat39 cerebellar cortices. We show in Supplementary Fig. S06 that FEM simulations using the conductivity values in Table 3 come very close to the experimental data.

The stimulating micropipette was considered a point-current source. The micropipette itself was not modeled, as we considered the associated effects to be minimal. In our acute slice experiments, we initially identified the relative location of the point source with respect to the cerebellar layers and the HD-MEA. This allowed us to model the location of the point source in the tissue as accurate as possible.

We defined the liquid-air interface and MEA chamber surface as electric insulators. The inner wall of the chamber was set to ground (boundary condition: ϕ = 0), as a platinum ring attached to the chamber wall was used as the reference electrode in the experimental setup.

The MEA surface itself is mostly insulating in nature (Si3N4), but a significant fraction (28%) consists of highly conductive microelectrodes. Important to note here is, that the electrodes are connected to recording amplifiers with a high input impedance of >40MΩ at 1 kHz, which limits the actual current following through the amplifier. In addition, we used only 126 connected electrodes of the HD-MEA at any time, leaving the other electrodes floating. Therefore, the effective conducting area is reduced to 0.3% with a total impedance of above 320 kΩ. In consequence, we considered the electrode array as an insulator in the FEM model.

#### Effect of liquid height on the potential spatial distribution

We used the bounded MoI to investigate the effect of the liquid column height to the potential spatial distribution of a point source on the HD-MEA. We computed the potential spatial decay for different z-distances (from 10 to 1000 μm) and increasing liquid column height (1, 2, 4, 8 mm). The potential offsets in the bounded MoI are a consequence of the second part of Equation 3, wherein the denominators are dominated by the liquid column height hs. It is important to note that Equation 3 involves a summation of a harmonic series, which diverges40,41. All MoI equations assume the reference electrode or ground being at infinite distance from the point source and from the electrode locations, where the potential amplitudes were simulated. Analytically, the infinite number of terms, summed in Equation 3, corresponds to the assumption of a ground electrode at infinite distance, around a disk-shape volume of conducting medium, sandwiched between two insulator surfaces. Practically, however, the HD-MEA chamber’s physical dimensions entail that the ground electrode is within millimeters from the point source. The assumption of an infinitely distant ground electrode does not hold. In order to introduce the grounding effect, the potential at the chamber ring, ϕring, can be subtracted from the potential values across the spatial extension. With this analytical solution for the grounding effect, a high number of terms can be chosen, e.g., 100 terms. We tested this procedure for a z-distance of 50 μm and obtained a potential distribution with values that were similar to those obtained with FEM. We applied the grounding effect to all bounded-MoI results.

We compared the bounded-MoI results with that of a semi-infinite MoI featuring infinite liquid column height. The results are presented in Fig. 4. We first illustrate the electric fields simulated using different analytical models: infinite (no HD-MEA), semi-infinite MoI, and bounded MoI (Fig. 4a). The magnitude of the potential, measured at a certain location on the electrode array surface, increased when an additional boundary was introduced. As expected from Equation 3, the potential values increased upon lowering the liquid height. In Fig. 4b, we present the potential spatial decays simulated for a z-distance of the point source of 50 μm. The increase in potential due to lowering the liquid column height was found to be nearly constant across the lateral distance range on the array surface (Fig. 4c). This means that the potential spatial decay only differed by an offset, while the shape of the curves was very similar. The modeling indicated that the spatial features of the recorded neuronal EAPs by HD-MEAs seem to be largely independent of the liquid column height.

#### Effect of brain tissue to the potential spatial distribution

The placement of an acute brain slice on the HD-MEA introduces a less conductive layer between the HD-MEA surface and the saline. The electrical potential distribution obtained from a point-current source within the tissue is illustrated in Fig. 5a. The tissue exhibits larger resistivity and different dielectric properties as compared to saline. Therefore, the electrical potential distribution, detected at the HD-MEA surface, is different from that in the presence of a highly conductive culture medium or saline. The first brain-tissue effect we observed was the increase in potential measured by the HD-MEA and originating from the stimulating micropipette. We compared the maximum potential, recorded by the HD-MEA, when the micropipette was placed at different z-distances in pure saline and in an acute brain slice with a saline cover (Fig. 5b). As the micropipette reached the tissue (z = 200 μm), the potential, detected by the HD-MEA, increased to approximately twice the potential measured in saline. The increase in magnitude of the measured potential grew exponentially as the micropipette was positioned deeper into the tissue, closer to the electrode array surface.

We further investigated, if the increase in potential due to the brain tissue was constant across the array, or if the steepness of the potential spatial decay was affected. The potential spatial decays based on experiments and extracted from both models, MoI and FEM, are shown in Fig. 5c. We used the bounded MoI model in two versions: (i) with the point source being above the tissue, in which the MoI lower and upper boundaries included the HD-MEA surface and the liquid-air interface, and (ii) with the point source being within the tissue, in which the MoI lower and upper boundaries were the HD-MEA surface and the tissue-saline interface, respectively. Similar to the saline case in Fig. 5, we computed the area under the curve or “Area” for all the potential spatial decays obtained from experiments and models. Interestingly, when the point source was within the tissue, the Area values were lower compared to just saline (Fig. 5d, left panel), indicating a steeper potential decay in the tissue. An example is presented in Fig. 5d (center panel) for z-distance at 100 μm, showing a sharper potential spatial decay when the point source was in tissue as compared to saline. When the point source was above the tissue, the Area values were also lower compared to saline Fig. 5d (right panel). This means that the acute brain slice, which adds an interface boundary in the volume conductor close to the HD-MEA surface, introduces a ‘focusing effect’ on the potential spatial decay.

We illustrate the ‘focusing effect’ of the brain slice in Supplementary Fig. S05. This ‘focusing effect’ can analytically be explained using the concept of MoI. The second interface boundary, i.e. tissue-to-saline interface, leads to additional mirrored point sources above the MEA surface (see ϒTS in Equation 4 and Supplementary Fig. S05a). The first set of additional mirrored point sources is within 600 μm from the array surface for a brain slice thickness of 200 μm. For example, the mirrored equivalent point sources due to the tissue-to-saline boundary for a point source, located at z = 50 μm, are located at z-distances of 350 μm (2hT − z) and 450 μm (2hT + z), where hT is the height of the tissue. The potential due to the mirrored point sources is added to the potential due to the point-current source with a weight WTS. The weight is dependent on the conductivity of tissue σT and saline σS, such that WTS = (σT − σS)/(σT + σS). Since σT is less than σS, WTSn in the first term and all odd terms (n = 1, 3, 5, …) is negative. At even iterations (n = 2, 4, 6, etc.), WTSn is positive. In the first iteration, the potential due to mirrored point sources is subtracted from the potential of the main point source. Interestingly, the resulting potential-spatial-decay curve sharpens, as the potential surrounding the peak gets significantly reduced (see Supplementary Fig. S05b). This effect leads to reduced background activity from active neurons >150 μm away from the recording electrode. As an example, we applied MoI and simulated two point sources, representing two neurons within a tissue at 150 μm lateral distance from each other and both at a z-distance of 30 μm from the array. Assuming an electrode being directly below one neuron, hereon termed neuron A, we calculated the SNR at this electrode considering only one other neuron, neuron B, as the source of background noise. At 150 μm lateral distance, the measured potential at the electrode originating from neuron B is approximately 20% of the peak potential in a semi-infinite tissue, while this value is reduced to 14% in a 200 μm-thick slice. In this simplified computation, in which the noise only comes from background activity (at 150 μm lateral distance), the SNR for a 200 μm-thick slice (double boundaries) is approximately 40% better than the SNR for a semi-infinite tissue (single boundary).

#### Performance of different HD-MEA models for z localization

We applied the least-squares fitting method to estimate the z-distance using the model-based potential spatial decay curves. The z localization algorithm is discussed in the Methods section. The results for the MoI model are shown in Fig. 6a (saline) and c (acute slice), while the results for FEM are displayed in Fig. 6b (saline) and d (acute slice). We plotted the estimated z-distances against the measured z-distances. Moreover, we performed a simple linear regression analysis (least squares) on the datasets, and the fitted regression lines demonstrate that MoI and FEM-based estimates were comparable for the saline-only case, whereas FEM-based estimates were closer to the measurement values in the presence of an acute brain slice.

A summary of the accuracy of the z-localization method is shown in Fig. 6e (mean ± s.d. of the difference between estimated and measured z-distances). For z-distances below 50 μm, the results for saline are 0.35 ± 1.28 μm and 0.31 ± 1.17 μm for MoI and FEM models, respectively. In the brain slices, the z-errors are 6.43 ± 1.80 μm for MoI and 4.14 ± 2.21 μm for FEM. For z-distances above 50 μm, the results are similar for both models in saline; the MoI and FEM z-errors are 1.58 ± 3.26 μm and 1.54 ± 3.05 μm, respectively. In tissue, the errors increased, and we obtained 21.96 ± 6.81 μm for MoI and 5.18 ± 3.22 μm for FEM. From the tissue results, we found that the systematic errors for both, MoI and FEM models are significant, however the values obtained with the FEM model were closer to the experimental results as compared to the MoI model. Thus, a pre-calibration step is recommended for z-localization using these models. We show the errors after the pre-calibration in Fig. 6e, last column. In summary, for z-distances considered in this study, the relative systematic error after pre-calibration is less than 1%, and the relative random error amounted to 3% for both, MoI and FEM. With 95% confidence, the z-localization predictions by both models will lie within ±4.4 μm from the expected value for z-distances below 50 μm and within ±6.6 μm for z-distances above 50 μm. The measured z-distances in tissue were based on micromanipulator movements only, so that it could be possible that the calibrated micromanipulator readings were off by a constant value. The linear regression analysis of the FEM (tissue) results indeed exhibited an approximate constant offset of 4 μm in the estimated z-distances between 5 to 200 μm. Nevertheless, z localization with a precision of <2 μm (standard deviation) for z-distances below 50 μm is sufficient for advanced electrophysiology experiments in acute slices. Such experiments may include combined patch-clamp and extracellular recordings or electroporation of extracellularly detected cells, as will be shown in the next section.

### Localization enables electroporation of spontaneously active cells

We used the localization method to augment acute-brain-slice extracellular electrophysiology. As mentioned in the introduction, subcellular resolution analysis of neuronal and neuronal network function can be achieved through HD-MEAs. To advance this technique for elucidating the function of single neurons, such as dendritic/axonal computation and the role of various genes in development, it is necessary to image a single neuron and to be able to locally deliver genes and plasmids to the same neuron, while recording from it. Electroporation has been used to efficiently transfect single cells for different applications, e.g., to deliver calcium indicators, dyes and activity modulators, such as channelrhodopsin-2, or ChR242,43,44, to knock down gene expression via RNA interference45,46, or to trace monosynaptic inputs in neuronal networks47. A common single-cell electroporation protocol involves filling a micropipette with a plasmid solution, placing the micropipette close to the cell membrane, and stimulating with large voltage pulses (>5 V)48. Performing this procedure manually on neurons during HD-MEA recording requires skills and time.

We used the localization method to guide a micropipette towards active neurons on an HD-MEA for electroporation. To approximate the position of the soma of active neurons, we analyzed HD-MEA extracellular recordings. We extracted the EAP amplitude map of two spontaneously active Purkinje cells in an acute cerebellar slice shown in Fig. 7a. The EAPs were obtained by spike-triggered averaging over 600 spikes, triggered at the electrode with the largest spike amplitude, using a threshold of 9 times the baseline noise level (calculated as the root mean square or RMS of the voltage)11. In parasagittal cerebellar slices, the Purkinje cells are the most prominent actively spiking cells and are aligned along the Purkinje cell layer (PCL). We correlated the EAP amplitude maps with the fluorescence microscopy image of the acute cerebellar slice, wherein most of the Purkinje cells were GFP positive (GAD67 − GFP+). From our results, we noticed that the largest negative spike was located at a few micrometers below the PCL (Fig. 7b), suggesting the source to be the axonal initial segment49. With this finding, we were able to estimate the location of the PCL based on the obtained activity map across an acute cerebellar slice. An example activity map shown in Fig. 7c consists of the mean of the largest negative spikes, i.e., the top 90% in terms of amplitude detected per electrode.

We targeted areas in the activity map with large spike amplitudes, so-called areas of interest. We blindly navigated the micropipette by using HD-MEA assisted localization to then electroporate cells. We localized the (x,y,z) position of the micropipette by issuing current signals through the pipette and analyzing the produced HD-MEA signals. A sample potential distribution plot used for localization is shown in Fig. 7d. While the pipette was still in saline above the slice, we used a high-amplitude signal for localization (50 nA, 1000 Hz). When the pipette reached a z-distance of 200 μm, we switched to low-amplitude pulses in voltage-clamp mode (50 mVpp, 1000 Hz. The same signal was used to monitor the impedance changes at the pipette tip. By delivering constant voltage pulses of 50 mV peak-to-peak amplitude, the current measured by the patch amplifier depended on the impedance of the pipette tip. Thus, as the pipette tip touched a cell membrane, the impedance change was detected as a reduction in the patch amplifier current readout.

For this proof-of-concept work, we aimed at approaching individual spontaneously spiking neurons in the PCL. Above 250 μm, we navigated the pipette in the x-y direction until it reached an area of interest. Once the pipette was detected by the HD-MEA to be in the area of interest (large amplitude spikes), we moved the pipette down to the tissue until the pipette reached the cells. We also estimated the z-distance of the pipette within the tissue to prevent the pipette from touching the array surface and to target cells within 70 μm distance from the array. We monitored the signal detected at the pipette tip through the patch-clamp software (PClamp), while the micropipette approached the cell membrane of a target neuron and stopped the approach when a 20–30% change in impedance was observed. The 20–30% increase in pipette impedance indicated that the pipette was on-cell. We then checked whether spontaneous extracellular spikes could be detected by the micropipette and only proceeded with the electroporation if spontaneous spikes were observed. Otherwise, we retracted the pipette tip and searched for another cell. We stopped every trial at a minimum z-distance of 30 μm and retracted the pipette back up to a z-distance of 250 μm to start a new approach if no cell was found (no change in pipette tip impedance). A summary of the electroporation method is illustrated in Fig. 7e, and an example case is shown in Supplementary Fig. S07.

We performed electroporation by stimulating the micropipette with current pulses between 0.5 and 2 s (100 nA, 200 Hz). Since we only electroporated spiking cells, we assumed that we most likely approached cerebellar Purkinje cells. We visually checked the electroporated cells afterwards by using fluorescence microscopy, and all the stained neurons exhibited morphologies that were typical for Purkinje cells. We assessed the electroporation and staining quality and also evaluated the response of the neuron to electrical stimulation. Examples of electroporated cells can be seen in Fig. 7f. Electroporation was considered successful if intracellular signals could be observed through the micropipette immediately after issuing stimulation signals by means of the micropipette (7 out of 11 cells). Cells that exhibited intracellular and intracellular-like signals (large positive spikes) usually were stained well with the dendrites being clearly visible and distinguishable. In the cases that we could only record extracellular spikes or no spikes through the micropipette after electroporation, the electroporation was considered unsuccessful, and the cells also turned out to not have been stained properly upon subsequent inspection by means of a fluorescence microscope (4 out of 11 cells).

## Discussion

We have shown that blind 3D localization of micropipettes can be done using HD-MEAs. To realize such localization, we used 2D Gaussian fitting for the x-y localization. While a Gaussian curve is neither equal to MoI (Equation 2), nor FEM-based potential spatial decay curves, it proved to be suited for accurate position estimates, as we only needed to find the peak of the potential distribution. Due to the large number of measurement electrodes, located at precisely defined locations that are defined by the lithographic process, the resulting random error was significantly below 1 μm, which is much less than the center-to-center pitch of the electrodes. The x-y localization method was found to be precise within ±2 μm, with 95% confidence, for z-distances up to 200 μm in both, saline and tissue samples.

For the z localization, we devised HD-MEA models based on MoI and FEM. We compared the potential spatial decay curves, extracted from the models, to the decay curves obtained from experiments. The MoI model provided an approximation of the HD-MEA point spread function, however, FEM results proved to better match the experimental data, especially for z-distances above 50 μm. In summary, results obtained with both, MoI and FEM models were comparable to experimental results in saline with relative systematic errors amounting to −1.5% and −1.2% for MoI and FEM, respectively. Similarly, both models provided precise z-localization results, with relative random errors <5%. With 95% confidence, the z-localization predictions by both models will lie within ±2.6 μm from the expected value for z-distances below 50 μm and within ±6.6 μm for z-distances higher than 50 μm. For the tissue case, the FEM-model results with −5.2% relative systematic error, were closer to the measurement values compared to −17.6% systematic error of MoI. Thus, a pre-calibration step is recommended for both models, so that they can be used for accurate z-localization. After pre-calibration, the systematic errors were significantly reduced to −0.7% and −0.5% for MoI and FEM, respectively. In terms of precision, the relative random errors were also below 5% for both models. After pre-calibration, the precision of both, MoI and FEM for z-localization in tissue became comparable. The localization results were within ±4.4 μm for z-distances below 50 μm, and ±6.6 μm for distances above 50 μm with 95% confidence. These results show that the method proposed here is sufficiently accurate to target cell somas with typical diameters of 10 to 30 μm.

Using the models, we also quantified different factors shaping the electrical field on HD-MEAs. Insulating boundaries in the model were found to increase the amplitude of the signal detected by the HD-MEA: the presence of an insulator HD-MEA surface doubled the magnitude of the potential, and the presence of a liquid-air interface increased the magnitude further, approximated by an added constant value for liquid heights above 1 mm. A similar effect could be attained through an additional insulating plane close to the HD-MEA surface, such as a resistive sheet of glial cells for cell cultures23, axonal tunnels24,25,26, a layer of mineral oil or a glass slide on top of the preparation. The potential increase can be approximated by using a bounded MoI (Equation 3).

The effects of grounding constitute another factor that influences the potential-spatial-decay curves. The grounding effect more and more decreases the measured potential upon approaching the actual location of the ground structure. We illustrate this effect in Supplementary Fig. S04. For our experiments, we placed the ground at the chamber ring, which was also included in the FEM models. To include the grounding effect in MoI models, it is possible to compute the potential at the ring radius (ϕring = 8.5 mm) and subtract the obtained constant value from the potential across the spatial extension of the bounded MoI model. We tested this analytical solution for the potential spatial distribution of a point-source at a z-distance of 50 μm. The resulting potential distribution was similar to that obtained with FEM, (see Fig. 3a). Subtracting a constant value, equivalent to ϕring, works when the point source is close to the center of the chamber, and the ground is equidistantly far away. However, if the ground is closer to the electrode array, the grounding effect will be shaped depending on the location of the point source with respect to the ground. In this case, the grounding effect is no more constant across the potential decay curve, if the point source is, e.g., located at the corner of the electrode array.

For the localization of neural activity, MoI will work well even without considering the grounding effect. Due to current conservation laws, the grounding effect is, in this case, negligible. The potential distribution of extracellular action potentials is localized, so that, e.g., in the case of a dipole, the potential decays quickly unlike the potential of a point source. Any neuron, irrespective of its location with respect to ground, can, therefore, be localized accurately using MoI.

For HD-MEA recording of neuronal signals, the signal-to-noise ratio (SNR) is an important factor for identifying and discriminating active units50,51. Insulating boundaries increase the electrical potential, detected by the array, and improve the detection of very small signals but at the expenses of increasing background noise. However, the effect of the tissue-to-saline boundary is different. The “focusing effect” potentially improves the localization of a signal within a tissue slice, as detected by the HD-MEA.

In our localization experiments, we kept the signal source fixed at a certain position, while we recorded for 10 s. We used high enough current stimulation amplitudes (50 nA, 1 kHz), to have sufficient SNR for pipette localization. The major noise sources in HD-MEA recordings include the electrodes and the amplification read-out chain. We measured a noise level of 4.7 μVrms (AP band: 300–3000 Hz) by making recordings in the same experimental HD-MEA setup without any signal source, however, in the presence of a micropipette in the HD-MEA dish. Depending on the localization experiment, the integration time can be adjusted so that a longer integration time would yield more accurate results, whereas a shorter integration time would enable faster feedback for live tracking purposes. In our tissue experiments, the applied stimulation amplitude and frequency had no perceivable effects on the viability of spontaneously spiking cells during the localization procedure.

The localization method can be applied to control moving micropipettes for advanced electrophysiology experiments by combining HD-MEA recordings with single-cell-targeted experiments, such as local puffing of compounds52,53,54, electrically-guided automated intracellular recordings30,31,32,55, virus-stamping56, single-cell electroporation44,45,46, and other single-cell-based methods. Other advanced single-cell experiments, such as Patch-seq, can be easily implemented together with HD-MEA extracellular recording. Patch-seq involves whole-cell patch-clamp recordings, single-cell RNA sequencing, and morphological cell characterization57. Such combination techniques will enable a detailed analysis of single cells in functional neuronal networks.

Moreover, combining HD-MEAs with pipette-based dye-loading58 or single-cell electroporation allows for obtaining morphologies of recorded cells on the HD-MEAs. This way, comprehensive information can be acquired for developing precise and realistic multi-compartment models. The density of membrane current sources in a neuron can be computationally approached through the extracellular potential landscape by using a method called “current-source-density (CSD)” analysis59,60 (see reviews61,62). If the shape or morphology of a neuron is given, the membrane currents of the neuron can be estimated by backward estimation based on spatial EAPs obtained from HD-MEA recordings14,21,63. Realistic neuronal models provide insights on the function of the cell and facilitate the identification and localization of specific neuronal types in HD-MEA experiments in vitro and in vivo16,17,18. The developed technique may also find applications outside the field of electrophysiology, for localizing and guiding an electrically conducting point source inside a volume conductor without using optical means.

## Materials and Methods

### HD-MEA

We used a CMOS-based high-density microelectrode array (HD-MEA)1,14 for localization experiments and extracellular neuronal recordings (Supplementary Fig. S01). The HD-MEA features 11,011 electrodes in an area of 1.99 × 1.75 mm2 (17.8 μm center-to-center pitch, 3′161 electrodes/mm2 density). The size of each platinum electrode size is 10.2 × 8.6 μm2. Platinum black was deposited on the electrodes to lower their impedance. Any subset of electrodes could be flexibly routed to 126 channels for recording. The sampling rate per channel was 20 kS/s at 8-bit resolution. All recorded signals were amplified 1450-fold and filtered (high-pass: ~4 Hz, low-pass: 3.7 kHz) using on-chip circuitry. We characterized the relative gain variability (at 1 kHz) across all electrodes for each HD-MEA, which was approximately ~5%. In order to compensate for this effect in all localization experiments, we multiplied the recorded signals with a compensation factor (determined earlier for each electrode) offline before data analysis. To accommodate micropipette stimulation and upright microscopy, we used HD-MEAs with 4 mm and 8 mm chamber heights. An external platinum wire attached to the inner wall of the HD-MEA chamber served as the reference electrode.

### Solutions

All chemicals were obtained from Wako Chemicals (Japan) and Sigma (St. Louis, MO). Saline solution: PBS tablet dissolved in 200 ml of MilliQ purified water, which yielded 10 mM phosphate buffer, 2.7 mM KCl, and 137 mM NaCl. Standard artificial cerebrospinal fluid (ACSF): 125 mM NaCl, 2.5 mM KCl, 1.25 mM NaH2PO4, 1.9 mM MgSO4, 20 mM Glucose, 25 mM NaHCO3, 2 mM CaCl2. Dissection ACSF: standard ACSF without CaCl2.

### Acute slice preparation and recording

All animals were obtained from the Laboratory for Animal Resources and Genetic Engineering at RIKEN Center for Developmental Biology in Kobe, Japan. All experimental procedures were approved by the local authorities (Animal Care and Use Committee of RIKEN; QAH24-01) and executed in accordance to RIKEN Guidelines.

Adolescent wild-type CD-1 and GAD67-eGFP36 mice (P18 to P35) were deeply anaesthetized by isoflurane inhalation and then decapitated. Brains were dissected out and immediately immersed in ice-cold dissection ACSF. Cerebellar tissues were harvested. The cerebellum was glued onto the vibratome tray along its sagittal plane. The tissues were kept in ice-cold dissection ACSF, bubbled with carbogen (95% O2 and 5% CO2) during slicing. Parasagittal cerebellar slices (200 μm thick) were cut using a Leica vibratome VT-1200S. The slices were transferred to carbogen-bubbled warm ACSF (35 °C) and were allowed to recover for at least 40 minutes before placement on the HD-MEA.

Slices were carefully positioned flat on the HD-MEA surface for recording. A custom-made weight kept the slices in place. Slices were superfused with carbogen-bubbled standard ACSF at 36 °C. Spontaneous electrical activity detected by the HD-MEA in this setup persisted up to 6 hours after incubation.

### Localization experiments

#### Experimental set-up

Borosilicate glass micropipettes with filaments were pulled using a P-97 pipette puller (Sutter Instruments, Novarto CA, USA) to have tip resistances between 5–7 MΩ. The tip resistance and output current were monitored with the Clampex software (Molecular Devices, Sunnyvale, USA). A glass micropipette was filled with either saline solution or standard ACSF, connected to a patch amplifier (MultiClamp 700B, Molecular Devices, Sunnyvale, USA), and mounted on a micromanipulator (Patch-star, Scientifica, East Sussex, UK). The patch amplifier controlled the stimulation amplitude. The pipette was positioned atop the HD-MEA by using the micromanipulator, and its distance from the array surface was confirmed using a microscope (Olympus BX61 with a 40x water immersion objective). A schematic of the setup is shown in Supplementary Fig. S02. The micromanipulator software (LinLab, Scientifica, East Sussex, UK) was used to control the micropipette movement at 0.25 μm precision. The micropipette was stimulated with a sine- or square-wave featuring a peak-to-peak output current of 50 nA at 1 kHz. The signals were recorded using the HD-MEA.

#### Amplitude extraction

We extracted the magnitude of the potential, detected by each electrode, from the discrete Fourier transform (DFT) of the recorded signal, computed using a fast Fourier transform algorithm in Matlab R2015b (FFTW library). We obtained the peak voltage between 990 to 1010 Hz from the single-sided amplitude spectrum. For square-wave signals, we only extracted the first harmonic and divided the amplitude by 2/π to get an equivalent value to sine-wave stimulation.

#### Localization algorithm

For simplicity, we separated the localization problem into two parts: x-y localization and z localization. In this way, we were able to extract the x-y location of the point source independently of its z location.

x-y localization:In search of the location of the peak amplitude, we fitted the measured potential values to a standard 2D Gaussian distribution of the form:

$$f(x,y)=A\,\exp (-\,\frac{{(x-{x}_{0})}^{2}}{2{\delta }_{x}^{2}}-\frac{{(y-{y}_{0})}^{2}}{2{\delta }_{y}^{2}}),$$

where A was the amplitude of the distribution, (x0, y0) was the center of the distribution or the estimated x-y location of the micropipette, and (δx, δy) were the standard deviations that define the width of the ‘bell curve’. We used least-squares curve fitting (lsqcurvefit function in Matlab R2015b). The Gaussian curve was only used to find the peak irrespective of the z-distance of the point source.

z localization:We simulated the potential spatial decay curves using different models (semi-infinite MoI for saline, bounded MoI for acute slice, and FEM) for z-distances between 1 and 1000 μm, with a step size of 1 μm. We limited our search to 1000 μm z-distance, as all measurements were only conducted up to this z-distance. We searched for the closest spatial decay curve fit per measurement by applying the least squares method. For each experiment, we first converted the measured potential values to a potential spatial decay curve. We used the estimated x-y location as the peak of the curve, where the radial distance is zero. Then, we computed the sum of squared residuals (Sz) between a single experimental decay curve and each of the model decay curves for all z-distances. The z-distance was estimated to be at z where Sz is closest to zero.

### Modeling HD-MEA signals

We modeled the HD-MEA signals by: (i) applying method of images (MoI) to volume conductor theory and (ii) using a finite-element method (FEM). The basic principles regarding the electric field of a signal source in a conductive volume is well established27. Properties of the extracellular space shape the electric field also in the electrode-array plane. Assuming an infinitely high input impedance of the amplifier circuits and point–like electrodes, the electric potential in the liquid phase can be calculated independently of the electrode properties. In this work, we focus on the signal shaping from the signal source to the recording electrode.

#### Volume conductor theory

At the frequency bands considered for neuronal activity detection (<5000 Hz), the brain tissue can be considered as purely Ohmic (i.e., no capacitive component) and the transmission of signals in the tissue can be modeled by using quasi-static Maxwell equations64,65,66. The volume conductor regime in an HD-MEA experiment refers to the passive region above the electrode array (e.g., saline, tissue, or culture media) where the electric field is present. To analyze the signal of a point current source that is recorded by a point electrode, volume conductor theory can be applied27,67,68. The potential ϕ, recorded at an electrode located at a distance r′ = (x′, y,′ z′) from a point current source I, located at r = (x, y, z), assuming an infinite, homogeneous, and isotropic volume conductor with conductivity σ, is given by:

$${\rm{\varphi }}({\rm{x}}^{\prime} ,{\rm{y}}^{\prime} ,{\rm{z}}^{\prime} )=\frac{{\rm{I}}}{4{\rm{\pi }}{\rm{\sigma }}\sqrt{{({\rm{x}}^{\prime} -{\rm{x}})}^{2}+{({\rm{y}}^{\prime} -{\rm{y}})}^{2}+{({\rm{z}}^{\prime} -{\rm{z}})}^{2}}}.$$

In vitro experiments using HD-MEAs require an extension of this equation to include the electrode-array plane. Moreover, the conductivity distribution in the brain tissue, including properties such as anisotropy and inhomogeneity, and the boundaries at the interfaces (e.g. tissue to saline, saline to air) need to be considered for a more accurate model.

#### Semi-infinite MoI model

MoI provides an analytical solution to the potential in a volume conductor involving boundary surfaces, which apply to HD-MEA measurements19,20,21,22,35. Inhomogeneity of the conductor in the z-direction can be introduced to the volume conductor equation for ϕ using MoI. The HD-MEA surface and the liquid-to-air interface cause inhomogeneity in the z-direction. The interfaces between different conductors are considered as boundaries.

MoI replaces the boundaries with virtual point current sources, located at appropriate positions, to meet the respective boundary conditions. As an example, an equivalent solution to the effect of an infinite insulating plane on the potential at point r due to a point current source at point r′ is to simulate an identical point current source, positioned at exactly the same distance on the opposite side of the boundary, and to remove the insulator. The contribution of this virtual point current source to the potential at any point in the volume conductor is then scaled with the conductivity factor W12 = (σ1σ2)/(σ1 + σ2) in reference to the real source19,69. σ1 refers to the conductivity of the region, where the real point current source is; σ2 refers to that of the virtual point source. In the case where a point current source is in a homogeneous and isotropic medium atop an insulating plane (i.e., in a first-order assumption in saline on a HD-MEA), the conductivity at the insulator is zero (σ2 = 0, W12 = 1), and the potential at the electrode surface simply doubles compared to the infinite volume conductor situation. This is accounted for in the following equation:

$${\varphi }_{se}(x^{\prime} ,y^{\prime} ,0)=2\ast \varphi (x^{\prime} ,y^{\prime} ,0)$$

where σ = σ1.

#### Bounded MoI model

The semi-infinite MoI model can be further extended to consider two boundaries, in order to include the effects of the liquid-air boundary. For a point current source, located within two boundaries, where h is the height of the liquid, the following equation can be used:

$${\varphi }_{bo}(x^{\prime} ,y^{\prime} ,0)={\varphi }_{se}(x^{\prime} ,y^{\prime} ,0)+2\sum _{n=1}^{\infty }\,{W}_{AB}^{n}[\varphi (x^{\prime} ,y^{\prime} ,-\,2nh)+\varphi (x^{\prime} ,y^{\prime} ,2nh)]$$

with WAB = (σA − σB)/(σA + σB), where σA is the conductivity of the saline and σB is zero (WAB = 1).

All the above equations can also be converted to use line-sources instead of point sources19, in order to estimate transmembrane currents from neurons21,28,70,71.

#### Finite Element Method

FEM simulations were performed using COMSOL Multiphysics version 5.2 and COMSOL with Matlab. The FEM model used here included the insulating boundaries, i.e., the liquid-air interface, chamber wall, and HD-MEA surface. A reference electrode was also included, either placed along the inner chamber wall or as a separate rectangular frame electrode surrounding the electrode array area. Two tissue models were created, isotropic tissue and anisotropic cerebellar tissue (see Supplementary Fig. S03 for more details). The point source was placed at different locations atop the electrode array. The electrode array was modeled as an insulator.

#### Electrode Size

We modeled the spatial averaging effect due to electrode size by modeling ϕ at 100 random points within an electrode area, centered around specific x′, y′ locations, and then obtained the average of all ϕ-values for each simulated electrode.

### Accuracy

We used the terminology accuracy as a general parameter to characterize the quality of the localization method, as it describes the closeness of a measurement to the true value while it includes components of (i) systematic error and (ii) random error. The systematic error is reflected in the trueness of the localization result. We used the mean error or a relative measure, the mean percentage error (MPE) to describe the trueness of the localization method. The MPE is the computed average of relative errors in percent, by which the results, obtained with the models, differ from experimental values. The equation for MPE is as follows:

$$MPE=\frac{100 \% }{n}\sum _{t=1}^{n}\frac{{e}_{t}-{m}_{t}}{{e}_{t}}$$

where et corresponds to an experimental data point, mt is the data point obtained with either the MoI or FEM model, and n is the number of trials. The precision, on the other hand, indicates the random error of the localization results. We quantified the precision using the standard deviation (s.d) of the errors, both, in μm and as a relative measure in percent. To specify the prediction interval, we used a 95% confidence level, so that 95% of the readings were within the interval of mean value ± (2 × s.d.).

## Data Availability

The data sets and code generated during the current study are available from the corresponding author on reasonable request.

Publisher’s note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## References

1. 1.

Frey, U. et al. Switch-Matrix-Based High-Density Microelectrode Array in CMOSTechnology. Solid-State Circuits, IEEE J. 45, 467–482 (2010).

2. 2.

Ballini, M. et al. A 1024-Channel CMOS Microelectrode Array With 26,400 Electrodes for Recording and Stimulation of Electrogenic Cells In Vitro. IEEE J. Solid-State Circuits 49, 2705–2719 (2014).

3. 3.

Berdondini, L. et al. Active pixel sensor array for high spatio-temporal resolution electrophysiological recordings from single cell to large scale neuronal networks. Lab Chip 9, 2644–51 (2009).

4. 4.

Bertotti, G. et al. A Capacitively-Coupled CMOS-MEA with 4225 Recording Sites and 1024 Stimulation Sites. In Proceedings of the 9th International Meeting on Substrate-Integrated Microelectrode Arrays 247–250 (2014).

5. 5.

Eversmann, B. et al. A 128 × 128 cmos biosensor array for extracellular recording of neural activity. IEEE J. Solid-State Circuits 38, 2306–2317 (2003).

6. 6.

Huys, R. et al. Single-cell recording and stimulation with a 16k micro-nail electrode array integrated on a 0.18 μm CMOS chip. Lab Chip 12, 1274–80 (2012).

7. 7.

Johnson, B., Peace, S. T., Cleland, T. A & Molnar, A. A 50 µm pitch, 1120-channel, 20kHz frame rate microelectrode array for slice recording. in 2013 IEEE Biomedical Circuits and Systems Conference (BioCAS) 109–112, https://doi.org/10.1109/BioCAS.2013.6679651 (2013).

8. 8.

Tsai, D., John, E., Chari, T., Yuste, R. & Shepard, K. High - channel - count, high - density microelectrode array for closed - loop investigation of neuronal networks. in 37th Annual International Conference of the IEEE EMBS 7510–7513 (2015).

9. 9.

Tsai, D., Yuste, R. & Shepard, K. L. Statistically Reconstructed Multiplexing for Very Dense, High-Channel-Count Acquisition Systems. IEEE Trans. Biomed. Circuits Syst. 1–11, https://doi.org/10.1109/TBCAS.2017.2750484 (2017).

10. 10.

Radivojevic, M. et al. Tracking individual action potentials throughout mammalian axonal arbors. Elife 6, 1–23 (2017).

11. 11.

Bakkum, D. J. et al. Tracking axonal action potential propagation on a high-density microelectrode array across hundreds of sites. Nat. Commun. 4, 2181 (2013).

12. 12.

Zeck, G., Lambacher, A. & Fromherz, P. Axonal transmission in the retina introduces a small dispersion of relative timing in the ganglion cell population response. PLoS One 6, e20810 (2011).

13. 13.

Radivojevic, M. et al. Electrical Identification and Selective Microstimulation of Neuronal Compartments Based on Features of Extracellular Action Potentials. Sci. Rep. 6, 31332 (2016).

14. 14.

Frey, U., Egert, U., Heer, F., Hafizovic, S. & Hierlemann, A. Microelectronic system for high-resolution mapping of extracellular electric fields applied to brain slices. Biosens. Bioelectron. 24, 2191–2198 (2009).

15. 15.

Ferrea, E. et al. Large-scale, high-resolution electrophysiological imaging of field potentials in brain slices with microelectronic multielectrode arrays. Front. Neural Circuits 6, 80 (2012).

16. 16.

Ruz, I. D., Schultz, S. R., Delgado Ruz, I. & Schultz, S. R. Localising and classifying neurons from high density MEA recordings. J. Neurosci. Methods 233C, 115–128 (2014).

17. 17.

Somogyvári, Z., Zalányi, L., Ulbert, I. & Erdi, P. Model-based source localization of extracellular action potentials. J. Neurosci. Methods 147, 126–37 (2005).

18. 18.

Somogyvári, Z., Cserpán, D., Ulbert, I. & Erdi, P. Localization of single-cell current sources based on extracellular potential patterns: the spike CSD method. Eur. J. Neurosci. 36, 3299–313 (2012).

19. 19.

Ness, T. V. et al. Modelling and Analysis of Electrical Potentials Recorded in Microelectrode Arrays (MEAs). Neuroinformatics, https://doi.org/10.1007/s12021-015-9265-6 (2015).

20. 20.

Jackson, J. D. Classical Electrodynamics, 3rd ed. Am. J. Phys. 67, 841 (1999).

21. 21.

Gold, C. et al. On the origin of the extracellular action potential waveform: A modeling study. J. Neurophysiol. 95, 3113–28 (2006).

22. 22.

Pettersen, K. H., Devor, A., Ulbert, I., Dale, A. M. & Einevoll, G. T. Current-source density estimation based on inversion of electrostatic forward solution: Effects of finite extent of neuronal activity and conductivity discontinuities. J. Neurosci. Methods 154, 116–133 (2006).

23. 23.

Matsumura, R., Yamamoto, H., Niwano, M. & Hirano-Iwata, A. An electrically resistive sheet of glial cells for amplifying signals of neuronal extracellular recordings. Appl. Phys. Lett. 108, 23701 (2016).

24. 24.

Lewandowska, M. K., Bakkum, D. J., Rompani, S. B. & Hierlemann, A. Recording Large Extracellular Spikes in Microchannels along Many Axonal Sites from Individual Neurons. PLoS One 10, e0118514 (2015).

25. 25.

Lewandowska, M. K., Bakkum, D. J. & Hierlemann, A. Axon-Isolating Channels on a High Density Microelectrode Array. in Proceedings of the 9th International Meeting on Substrate-Integrated Microelectrode Arrays 176–177 (2014).

26. 26.

Habibey, R. et al. A multielectrode array microchannel platform reveals both transient and slow changes in axonal conduction velocity. Sci. Rep. 7, 1–14 (2017).

27. 27.

Nunez, P. L. & Srinivasan, R. Electric Fields of the Brain: The Neurophysics of EEG. at http://books.google.co.jp/books?id=fUv54as56_8C (Oxford University Press, 2006).

28. 28.

Lindén, H. et al. Modeling the spatial reach of the LFP. Neuron 72, 859–72 (2011).

29. 29.

Annecchino, L. A. & Schultz, S. R. Progress in automating patch clamp cellular physiology, https://doi.org/10.1177/2398212818776561 (2018).

30. 30.

Kodandaramaiah, S. B. et al. The Multipatcher: A Robot for High Density Measurement of Intracellular Recordings In Vivo. In Proceedings of the Biomedical Engineering Society (BMES) (2014).

31. 31.

Kodandaramaiah, S. B., Franzesi, G. T., Chow, B. Y., Boyden, E. S. & Forest, C. R. Automated whole-cell patch-clamp electrophysiology of neurons in vivo. Nat. Methods 9, 585–7 (2012).

32. 32.

Annecchino, L. A. et al. Robotic Automation of In Vivo Two-Photon Targeted Whole-Cell Patch-Clamp Electrophysiology. Neuron 95, 1048–1055.e3 (2017).

33. 33.

Wu, Q. et al. Integration of autopatching with automated pipette and cell detection in vitro. J. Neurophysiol. 116, 1564–1578 (2016).

34. 34.

Miceli, S., Ness, T. V., Einevoll, G. T. & Schubert, D. Impedance Spectrum in Cortical Tissue: Implications for Propagation of LFP Signals on the Microscopic Level. eNeuro 4, e0291–16.2016 (2017).

35. 35.

Obien, M. E. J., Hierlemann, A. & Frey, U. Factors Affecting Blind Localization of a Glass Micropipette Using a High-Density Microelectrode Array. In Proceedings of IEEE Sensors 2013, 932–935, https://doi.org/10.1109/ICSENS.2013.6688361 (2013).

36. 36.

Tamamaki, N. et al. Green Fluorescent Protein Expression and Colocalization with Calretinin, Parvalbumin, and Somatostatin in the GAD67-GFP Knock-In Mouse. J. Comp. Neurol. 467, 60–79 (2003).

37. 37.

Jennings, P. J. & Jones, R. O. Beyond the method of images—the interaction of charged particles with real surfaces. Adv. Phys. 37, 341–358 (1988).

38. 38.

Okada, Y. C., Huang, J. C., Rice, M. E., Tranchina, D. & Nicholson, C. Origin of the apparent tissue conductivity in the molecular and granular layers of the in vitro turtle cerebellum and the interpretation of current source-density analysis. J. Neurophysiol. 72, 742–53 (1994).

39. 39.

Yedlin, M., Kwan, H., Murphy, J. T., Nguyen-Huu, H. & Wong, Y. C. Electrical conductivity in cat cerebellar cortex. Exp. Neurol. 43, 555–569 (1974).

40. 40.

Arfken, G. B. & Weber, H. J. Mathematical methods for physicists (1999).

41. 41.

Beyer, W. H. CRC standard mathematical tables. West Palm Beach, Fl. Chem. Rubber Co., 1978, 25th ed., Ed. by Beyer, William H. (1978).

42. 42.

Judkewitz, B., Rizzi, M., Kitamura, K. & Häusser, M. Targeted single-cell electroporation of mammalian neurons in vivo. Nat. Protoc. 4, 862–869 (2009).

43. 43.

Kitamura, K., Judkewitz, B., Kano, M., Denk, W. & Häusser, M. Targeted patch-clamp recordings and single-cell electroporation of unlabeled neurons in vivo. Nat. Methods 5, 61–67 (2008).

44. 44.

Nevian, T. & Helmchen, F. Calcium indicator loading of neurons using single-cell electroporation. Pflugers Arch. Eur. J. Physiol. 454, 675–688 (2007).

45. 45.

Boudes, M., Pieraut, S., Valmier, J., Carroll, P. & Scamps, F. Single-cell electroporation of adult sensory neurons for gene screening with RNA interference mechanism. J. Neurosci. Methods 170, 204–211 (2008).

46. 46.

Tanaka, M., Yanagawa, Y. & Hirashima, N. Transfer of small interfering RNA by single-cell electroporation in cerebellar cell cultures. J. Neurosci. Methods 178, 80–86 (2009).

47. 47.

Marshel, J. H., Mori, T., Nielsen, K. J. & Callaway, E. M. Targeting single neuronal networks for gene expression and cell labeling in vivo. Neuron 67, 562–574 (2010).

48. 48.

Wang, M., Orwar, O., Olofsson, J. & Weber, S. G. Single-cell electroporation. Anal. Bioanal. Chem. 397, 3235–3248 (2010).

49. 49.

Bakkum, D. J. et al. The axon initial segment drives the neuron’s extracellular action potential. bioRXiv Prepr. 1–30, https://doi.org/10.1101/266734 (2018).

50. 50.

Buzsáki, G. Large-scale recording of neuronal ensembles. Nat. Neurosci. 7, 446–51 (2004).

51. 51.

Harris, K. D., Quiroga, R. Q., Freeman, J. & Smith, S. L. Improving data quality in neuronal population recordings. Nat. Neurosci. 19, 1165–1174 (2016).

52. 52.

Sasaki, T. The axon as a unique computational unit in neurons. Neurosci. Res. 75, 83–88 (2013).

53. 53.

Sasaki, T., Matsuki, N. & Ikegaya, Y. Action-potential modulation during axonal conduction. Science 331, 599–601 (2011).

54. 54.

Engle, S. E., Broderick, H. J. & Drenan, R. M. Local application of drugs to study nicotinic acetylcholine receptor function in mouse brain slices. J. Vis. Exp. e50034, https://doi.org/10.3791/50034 (2012).

55. 55.

Suk, H.-J. et al. Closed-Loop Real-Time Imaging Enables Fully Automated Cell-Targeted Patch-Clamp Neural Recording In Vivo. Neuron 95, 1037–1047.e11 (2017).

56. 56.

Schubert, R. et al. Virus stamping for targeted single-cell infection in vitro and in vivo. Nat. Biotechnol. 36, 81 (2018).

57. 57.

Cadwell, C. R. et al. Electrophysiological, transcriptomic and morphologic profiling of single neurons using Patch-seq. Nat. Biotechnol. 34, 199–203 (2016).

58. 58.

Eilers, J. & Konnerth, A. Dye loading with patch pipettes. Cold Spring Harb. Protoc. 2009, pdb.prot5201 (2009).

59. 59.

Nicholson, C. & Freeman, J. A. Theory of current source-density analysis and determination of conductivity tensor for anuran cerebellum. J. Neurophysiol. 38, 356 (1975).

60. 60.

Mitzdorf, U. Current source-density method and application in cat cerebral cortex: investigation of evoked potentials and EEG phenomena. Physiol. Rev. 65, 37–100 (1985).

61. 61.

Buzsáki, G., Anastassiou, C. A. & Koch, C. The origin of extracellular fields and currents–EEG, ECoG, LFP and spikes. Nat. Rev. Neurosci. 13, 407–20 (2012).

62. 62.

Einevoll, G. T., Kayser, C., Logothetis, N. K. & Panzeri, S. Modelling and analysis of local field potentials for studying the function of cortical circuits. Nat. Rev. Neurosci. 14, 770–85 (2013).

63. 63.

Gold, C., Henze, D. A. & Koch, C. Using extracellular action potential recordings to constrain compartmental models. J. Comput. Neurosci. 23, 39–58 (2007).

64. 64.

de Munck, J. C. & van Dijk, B. W. Symmetry considerations in the quasi-static approximation of volume conductor theory. Phys. Med. Biol. 36, 521–529 (1991).

65. 65.

Plonsey, R. & Heppner, D. B. Considerations of quasi-stationarity in electrophysiological systems. Bull. Math. Biophys. 29, 657–664 (1967).

66. 66.

Sarvas, J. Basic mathematical and electromagnetic concepts of the biomagnetic inverse problem. Phys. Med. Biol. 32, 11–22 (1987).

67. 67.

Rall, W. Electrophysiology of a Dendritic Neuron Model. Biophys. J. 2, 145–167 (1962).

68. 68.

Rall, W. & Shepherd, G. M. Theoretical reconstruction of field potentials and dendrodendritic synaptic interactions in olfactory bulb. J. Neurophysiol. 31, 884–915 (1968).

69. 69.

Barrera, R. G. Point charge in a three-dielectric medium with planar interfaces. Am. J. Phys. 46, 1172 (1978).

70. 70.

Holt, G. R. & Koch, C. Electrical interactions via the extracellular potential near cell bodies. J. Comput. Neurosci. 6, 169–84 (1999).

71. 71.

Pettersen, K. H. & Einevoll, G. T. Amplitude variability and extracellular low-pass filtering of neuronal spikes. Biophys. J. 94, 784–802 (2008).

72. 72.

Wait, J. R. Current flow into a three-dimensionally anisotropic conductor. Radio Sci. 25, 689–694 (1990).

73. 73.

Eskola, L. Reflections on the electrostatic characteristics of direct current in an anisotropic medium. Geoexploration 25, 211–217 (1988).

## Acknowledgements

This work was supported by the Japan Society for Promotion of Science (JSPS) under Grants-in-Aid for Young Scientists (B) No. 25730183, the Swiss National Science Foundation through Grant 205321_157092/1 (“Axons”), as well as by the European Community through the European Research Council Advanced Grant 694829 ‘neuroXscales’. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript. We thank Alexander Stettler for post-processing CMOS chips and the D-BSSE support staff for help with experiments.

## Author information

### Affiliations

1. #### Department of Biosystems Science and Engineering, ETH Zurich, Basel, Switzerland

• Marie Engelene J. Obien
• , Andreas Hierlemann
•  & Urs Frey
2. #### RIKEN Quantitative Biology Center, Kobe, Japan

• Marie Engelene J. Obien
•  & Urs Frey
3. #### MaxWell Biosystems AG, Basel, Switzerland

• Marie Engelene J. Obien
•  & Urs Frey

### Contributions

Experimental design was performed by M.E.J.O. and U.F.; M.E.J.O. performed all experiments and data analysis. A.H. and U.F. coordinated the project supervision. The manuscript was written and reviewed by all the authors.

### Competing Interests

M.E.J.O. and U.F. are co-founders of MaxWell Biosystems AG, Mattenstrasse 26, Basel, Switzerland.

### Corresponding author

Correspondence to Marie Engelene J. Obien.