# A Computational Model for Real-Time Calculation of Electric Field due to Transcranial Magnetic Stimulation in Clinics

Authors: Alessandra   Paffi; Francesca  Camera; Filippo  Carducci; Gianluigi  Rubino; Paolo Tampieri; Micaela  Liberti; Francesca  Apollonio
Journal: International Journal of Antennas and Propagation
 (2015)

---

## Abstract

The aim of this paper is to propose an approach for an accurate and fast (real-time) computation of the electric field induced inside the whole brain volume during a transcranial magnetic stimulation (TMS) procedure. The numerical solution implements the admittance method for a discretized realistic brain model derived from Magnetic Resonance Imaging (MRI). Results are in a good agreement with those obtained using commercial codes and require much less computational time. An integration of the developed code with neuronavigation tools will permit real-time evaluation of the stimulated brain regions during the TMS delivery, thus improving the efficacy of clinical applications.


---

## Body

## 1. Introduction

Transcranial magnetic stimulation (TMS) is a noninvasive and painless technique that delivers brain stimulations via externally applied magnetic fields generated by a coil positioned above the patient’s scalp surface [1]. The coil, fed by a current pulse, generates a time varying magnetic field that penetrates into the head’s tissues placed in the near field zone of the coil. According to Faraday’s induction law, rapid variations of magnetic field induce an electric (E→) field in the brain interacting with the neuronal cells of the cortex. From a macroscopic point of view, brain activation occurs in the regions where the induced E→ reaches a certain threshold.In the last years, TMS has become an important tool not only in research and diagnostic fields, but also in clinical applications, being a promising alternative treatment for a broad range of neurological and psychiatric disorders including strokes, Parkinson’s disease, tinnitus, epilepsy, and depression [2].Despite the efficacy of many TMS clinical applications, as for all stimulation techniques of the nervous system, more research is needed on dosimetry [3, 4]. In fact, knowledge of the induced E→ field distribution is fundamental for evaluating position, level, and extent of the stimulation. In addition dosimetry, when coupled with biophysical neuronal models [5–7], is useful for interpreting experimental results, designing more efficient applicators [8–10], and clarifying possible mechanisms of action of electromagnetic fields on the brain [11].The need for an accurate calculation has led to the development of increasingly realistic brain models, starting from simple homogenous spheres [12–14] up to recent patient specific models obtained from Magnetic Resonance images. The patient specific models include a realistic number of tissues [15–17] and even an anisotropic behavior of white matter [18–20].Various computational methods have been used to solve the problem, based on either differential or integral equations. They are the finite difference time domain (FDTD) method [21, 22], the finite element method (FEM) [19, 23–27], the impedance method (IM) [15, 18, 28, 29], the boundary element method (BEM) [16, 30], and the surface integral equation (SIE) [31].Due to the high wavelength of the stimulating field with respect to the head size, the majority of these methods applied to TMS use quasistatic approximation to determine the distribution of theE→ field induced in the human brain [12, 15–17, 27, 32–40]. Conversely, some authors [31] recently proposed a more realistic physical description of the problem including the electromagnetic field propagation.In recent years, the calculation of theE→ field distribution inside the brain has assumed a further fundamental role. In fact, the increasing use of computer-aided neuronavigation tools requires a correct coil positioning with respect to specific brain region identified by MRI patient specific images [30, 41–43], thus enhancing the necessity of exact E→ field knowledge.Such an application requires a very fast calculation, in order to furnish real-time results during the coil displacements over the scalp.To fulfill the real-time requirement, most of the existing online TMS navigation tools estimate the inducedE→ field using spherical conductor models [41, 42]. Recently, Nummenmaa et al. [30] presented an efficient BEM approach for realistic brain model. If 1-layer BEM is considered, the computational time was comparable to that consumed when a locally fitting spherical model of the brain is considered [30]. However, the E→ field was calculated only on the brain surface, neglecting its penetration in deeper regions. In fact, methods such as BEM and SIE deal with fully populated matrices resulting in high storage requirements and long computational time for fine spatial resolution [40].In this paper we propose a tool for the calculation of theE→ field within the whole brain based on an improved revision of the admittance method [22, 44, 45], aimed at solving the real-time requirement introduced by the neuronavigation computer-assisted technologies. The admittance method is fast and appropriate for this kind of near field, quasistatic approximation and does not require meshing codes, needed when using FEM methods, since the regular 3D grid for the brain model is directly extractable from MRI images [40].Real-time calculation is achieved by decoupling the coil domain, where theA→ magnetic potential is calculated only once to build up a library file for each considered coil, from the brain domain, where the E→ field is calculated for each new coil position. This procedure allows us to recalculate in a few seconds the E→ field due to the real-time positioning of the coil, using a rototranslation operation that dynamically maps one domain into the other. The E→ field calculation, compliant with the strict time requirement, is obtained with acceptable spatial resolution and good accuracy, evaluated by comparison with commercial codes.Such a strategy allows (i) considering different kinds of TMS coils, that is, an easily expandable “Coil Library”; (ii) obtaining a fast and reliable solution, in agreement with real-time requirements of clinical applications; (iii) calculating theE→ field distribution within a whole realistic brain volume using a spatial resolution of a few mm. Therefore, the developed tool can be efficiently integrated with available neuronavigation systems.


## 2. Models and Methods

### 2.1. The Solution Approach: DecouplingA→ and E→ Calculation Domains

The coil is modeled as a discrete sequence of segments carrying a sinusoidal current (Section2.2) in a discretized analysis volume (coil domain). Under the quasistatic hypothesis we obtain the magnetic vector potential A→ by solving the discrete Poisson vector equation in the coil domain (Section 2.3).As for the brain, we consider both homogeneous and inhomogeneous models. The homogeneous model is a realistically shaped volume completely filled with grey matter (GM) and immersed in the cerebrospinal fluid (CSF); the inhomogeneous one accounts for both GM and white matter (WM) (Section2.4).The brain domain is discretized using a 3 mm spatial step. This choice allows us to significantly reduce calculation time and memory occupation while maintaining an acceptable spatial resolution.The electric fieldE→ is calculated in the brain domain by the superimposition of the primary and the secondary fields, using the expression (1)E→=-jωA→-∇V,where A→ and V are the magnetic vector potential and the electric scalar potential, respectively. The electric scalar potential V is obtained using the admittance method (Section 2.5) in the brain domain.The overall strategy used to fulfill versatility and fast calculation, while maintaining an acceptable spatial resolution, is summarized in the flowchart of Figure1. For each coil considered, the A→ distribution is calculated in an analysis volume surrounding the coil, discretized using a Cartesian cubic grid 3 mm on a side. Since the analysis domain must be large enough (at least 1.75 times the brain size) to include the whole brain volume for any realistic position of the coil, this calculation is generally time-consuming, but it is carried out offline only once. The A→ fields are then stored in “ad hoc” library files. This library, together with the file containing the brain model, becomes the input of the revisited admittance method whose engine is devoted to the real-time E→ field calculation (Figure 1). To change the coil position, the brain domain is dynamically mapped (rototranslated) into the coil domain (Section 2.5) on the basis of the coordinates of three fiducial points of the coil given in the brain Cartesian reference system (Figure 3).Figure 1
Flowchart summarizing the overall strategy adopted to perform real-timeE→ field calculation.To further reduce the computational time,V and thus the E→ field are evaluated in an analysis domain, whose external boundaries are placed at a “cut-off” distance from the brain, outside which the influence of the brain-CSF interface on E→ becomes negligible. Here, this cut-off distance has been fixed to 9 mm, that is, 3 mesh cells (Figure 3).Since the admittance method works in the frequency domain, to avoid time-consuming spectral decomposition, the biphasic TMS stimulus is replaced with the best approximating monochromatic signal (Section2.2) [18].The possibility of carrying out a real-timeE→ calculation relies on the adopted strategy that provides:(i)
reading of theA→ distribution in the coil domain from a library file;(ii)
V and E→ calculation in the domain within the cut-off distance from the brain surface, suitably rototranslated with respect to the coil domain.In addition, a 3 mm spatial resolution and the monochromatic assumption have been considered to speed up calculation while maintaining an acceptable accuracy, as shown in Results. The procedure described in Figure 1 is implemented in C++ environment.


### 2.2. Source Model

In this study we consider the figure-of-eight commercial coil MAG-9925-00 (Magstim). However, thanks to the modular code implementation (Figure1), as many coils as one wants can be added to the library without changing the fast engine E→ calculation.Under the assumption of dimensionless transversal section of the wire, the coil is discretized in a sequence of 2721 segmentsΔl→, describing the current path (Figure 2), using a MATLAB tool suitably developed. Each segment is identified by the coordinates of its central point in the coil reference system (Figure 3).Figure 2
MATLAB model of the MAG-9925-00 coil with the associated Cartesian reference system.Figure 3
Sketch showing the rototranslation operation of coil and brain domains.The current flowing in the MAG-9925-00 coil energized with the biphasic stimulator Magstim Rapid2 was measured using a Tektronix DPO 2024 (200 MHz; 1 GS/s) digital oscilloscope equipped with amperometric probes Tektronix TCT 0030 A (120 MHz; 30 A).In agreement with theoretical predictions, the measured current time course is well fitted by a damped sinusoid with periodT=340 μs, amplitude 100 A (stimulator set at the 1% of the maximum deliverable power), and attenuation constant α=2000 s−1.Since theE→ field induced in the brain reaches its maximum value at the time instants where the time derivative of the current is maximum (i.e., at the beginning of the stimulus), generally the current signal is assimilated to a pure sinusoid that has the same slope of the damped sinusoid at the origin [18]. This slope, calculated in the first 20 μs, is perfectly approximated (error < 1%) by a pure sine wave with frequency f=2.94 kHz and amplitude I=86.6 A.Therefore, the code for theE→ field calculation works at the approximated frequency of 3 kHz; the current amplitude is an input variable that can be changed depending on the power level set on the stimulator.


### 2.3.A→ and B→ Fields Calculation

Under the quasistatic approximation, assuming a uniform current density over the coil cross section [31] and considering the meshed coil, the magnetic vector potential A→ at any space point r→ can be calculated as the superimposition of all contributions from linear segments Δl→ used to discretize the coil model:(2)A→r→=μ0I4π∑lΔl→r→-r→′,where μ0 is the free space permeability,I and Δl→ are the intensity and direction of the current flowing through the coil, and |r→-r→′| is the distance from the observation point to the source point on the coil.The uniform current density is a plausible assumption since the wire thickness does not exceed two times the skin depth at the considered frequencies.TheA→ distributions stored in the library files are calculated for I=1 A. Due to the linear relationship between I and A→, the actual distributions are simply multiplied by a factor equal to the current intensityI.A
→ values, stored in the library files, are used to calculate the E→ distribution.Using the same assumption, magnetic flux densityB→ has been also calculated for comparison with results from commercial codes, in order to validate the coil modeling.B
→ at any space point is calculated using the discretized version of the Biot-Savart law:(3)B→r→=μ0I4π∑lΔl→×r0→r→-r→′3,where r0→ is the unit vector of r→.


### 2.4. Human Brain Model

The developed code is able to operate with any patient specific voxeled brain model coming from MRI.In this paper the brain model is obtained from the Virtual Population member Duke (v.1.0, Zurich Med Tech AG, Zurich, Switzerland, [46]), that is, a 1 mm resolution voxeled male model in which a number from 1 to 77 encodes for 77 different tissues. We consider only a box of 183×219×182 mm3 containing all the brain structures; this box is processed in order to have a simplified model consisting of only three materials, that is, GM (that takes into account the cortex and all the nuclei like thalamus, hypothalamus, etc.), WM (that includes the structures that can be assimilated to nerve fibers), and CSF (that incorporates all the other tissues).In this paper we consider both the three-tissue model, referred to as inhomogeneous, and a further simplified model where all tissues in the brain are treated as GM (homogeneous).To speed up the solution process while keeping an acceptable spatial resolution in a real-time clinic framework, the brain model is undersampled and discretized in cubic cells 3 mm on a side.Due to the fact that biological tissues do not possess magnetic properties, the permeability values are taken to beμ0, that is, the free space permeability.All materials are considered as lossy ones with complex conductivity equal to(4)σ∗=σ+j2πfε0εr,where σ and εr are the electric conductivity and the relative permittivity, respectively, ε0 is the permittivity of the free space, and f is the operating frequency of 3 kHz.The used values areεr = 6.7 × 104, σ=0.1 S/m for the GM and εr=109, σ=2 S/m for the CSF [47]. WM is considered isotropic with εr = 3.01 × 104, σ = 0.065 S/m [47].


### 2.5. Calculation of the InducedE→ Field

#### 2.5.1. The Admittance Method

Among different numerical approaches for theE→ field calculation inside the brain we chose to adopt the admittance method since it allowed us to explore the whole brain volume with reduced computational time [22, 44, 45].The admittance method is based on a finite difference (FD) approach to the solution of Maxwell’s equations in the frequency domain in quasistatic condition [48], which is considered valid at the typical frequency of a biphasic TMS pulse (≤3 kHz).The analysis domain is divided intoN homogeneous cells (Δx×Δy×Δz) centered at the point of coordinates (x,y,z) in a Cartesian grid that can be represented as a network of lumped electrical elements (see Figure 2 of [45] for a simplified 2D representation) [45, 49, 50].Applying the Kirchhoff law at each node (x,y,z) of the network leads to a linear system whose equations are given by(5)Vx,y,z=1Yx-+Yx++Yy-+Yy++Yz-+Yz-Yx+Vx+Δx,y,z+Yx-Vx-Δx,y,z+Yy+Vx,y+Δy,z+Yy-Vx,y-Δy,z+Yz+Vx,y,z+Δz+Yz-Vx,y,z-Δz-Yx-ΔxjωAx-+Yx+ΔxjωAx+-Yy-ΔyjωAy-+Yy+ΔyjωAy+-Yz-ΔzjωAz-+Yz+ΔzjωAz+,where Vx,y,z is the unknown scalar electric potential at each network node, Yi and Ai (i=x-,x+,y-,y+,z-,z+) are the admittance and the vector potential components at each surface of the discretizing cell, and ω is the operating angular frequency.The admittance values are calculated from the complex conductivity of (4) as (6)Yx+=2σx∗σx+Δx∗σx∗+σx+Δx∗ΔyΔzΔx.The linear system of (5) is solved using the overrelaxation iterative technique [22, 44, 45]. This choice is based on the best compromise among easy implementation, computer memory occupation, and speed of convergence [51, 52]: (7)Vn+1x,y,z=Vnx,y,z+αVx,y,z-Vnx,y,zwith convergence factor α between 1 and 2.The iterative procedure ends when the error at thenth step (left side of (8)) falls down below a defined tolerance levele:(8)∑i=1NVin+1-Vin∑i=1NVin<e.In this work e is fixed to 1 × 10−7.


#### 2.5.2. Rototranslation

Rototranslation is a fundamental operation for theE→ field calculation: it permits a dynamical mapping of the brain domain into the coil domain.If (Cx,Cy,Cz) are the coordinates of the origin of the coil Cartesian reference system (local system) with respect to the brain Cartesian reference system (global system), and (u1x,u1y,u1z), (u2x,u2y,u2z), and (u3x,u3y,u3z) are the coordinates of the unitary vectors u1,u2,u3 identifying the local system with respect to the global one, the one-to-one correspondence between the coordinates of any point in the local system (x,y,z) and the correspondent point in the global system (x1,y1,z1) is given by the linear relationship: (9)x1y1z1=CxCyCz+u1xu2xu3xu1yu2yu3yu1zu2zu3zxyz,where the coefficients Cx,Cy,Cz,u1x,u2x,u3x,u1y,u2y,u3y, u1z,u2z, and u3z are calculated from the coordinates of three fiducial points (C,H,L) on the coil (Figure 3 shows a simplified sketch of the operation).In the two discretized domains the correspondence between cells is not necessary one to one, since the rototranslation operation is not conformal, but the maximum committed error is equal to the cell size (3 mm); thus, it is inside the accepted tolerance.


## 2.1. The Solution Approach: DecouplingA→ and E→ Calculation Domains

The coil is modeled as a discrete sequence of segments carrying a sinusoidal current (Section2.2) in a discretized analysis volume (coil domain). Under the quasistatic hypothesis we obtain the magnetic vector potential A→ by solving the discrete Poisson vector equation in the coil domain (Section 2.3).As for the brain, we consider both homogeneous and inhomogeneous models. The homogeneous model is a realistically shaped volume completely filled with grey matter (GM) and immersed in the cerebrospinal fluid (CSF); the inhomogeneous one accounts for both GM and white matter (WM) (Section2.4).The brain domain is discretized using a 3 mm spatial step. This choice allows us to significantly reduce calculation time and memory occupation while maintaining an acceptable spatial resolution.The electric fieldE→ is calculated in the brain domain by the superimposition of the primary and the secondary fields, using the expression (1)E→=-jωA→-∇V,where A→ and V are the magnetic vector potential and the electric scalar potential, respectively. The electric scalar potential V is obtained using the admittance method (Section 2.5) in the brain domain.The overall strategy used to fulfill versatility and fast calculation, while maintaining an acceptable spatial resolution, is summarized in the flowchart of Figure1. For each coil considered, the A→ distribution is calculated in an analysis volume surrounding the coil, discretized using a Cartesian cubic grid 3 mm on a side. Since the analysis domain must be large enough (at least 1.75 times the brain size) to include the whole brain volume for any realistic position of the coil, this calculation is generally time-consuming, but it is carried out offline only once. The A→ fields are then stored in “ad hoc” library files. This library, together with the file containing the brain model, becomes the input of the revisited admittance method whose engine is devoted to the real-time E→ field calculation (Figure 1). To change the coil position, the brain domain is dynamically mapped (rototranslated) into the coil domain (Section 2.5) on the basis of the coordinates of three fiducial points of the coil given in the brain Cartesian reference system (Figure 3).Figure 1
Flowchart summarizing the overall strategy adopted to perform real-timeE→ field calculation.To further reduce the computational time,V and thus the E→ field are evaluated in an analysis domain, whose external boundaries are placed at a “cut-off” distance from the brain, outside which the influence of the brain-CSF interface on E→ becomes negligible. Here, this cut-off distance has been fixed to 9 mm, that is, 3 mesh cells (Figure 3).Since the admittance method works in the frequency domain, to avoid time-consuming spectral decomposition, the biphasic TMS stimulus is replaced with the best approximating monochromatic signal (Section2.2) [18].The possibility of carrying out a real-timeE→ calculation relies on the adopted strategy that provides:(i)
reading of theA→ distribution in the coil domain from a library file;(ii)
V and E→ calculation in the domain within the cut-off distance from the brain surface, suitably rototranslated with respect to the coil domain.In addition, a 3 mm spatial resolution and the monochromatic assumption have been considered to speed up calculation while maintaining an acceptable accuracy, as shown in Results. The procedure described in Figure 1 is implemented in C++ environment.


## 2.2. Source Model

In this study we consider the figure-of-eight commercial coil MAG-9925-00 (Magstim). However, thanks to the modular code implementation (Figure1), as many coils as one wants can be added to the library without changing the fast engine E→ calculation.Under the assumption of dimensionless transversal section of the wire, the coil is discretized in a sequence of 2721 segmentsΔl→, describing the current path (Figure 2), using a MATLAB tool suitably developed. Each segment is identified by the coordinates of its central point in the coil reference system (Figure 3).Figure 2
MATLAB model of the MAG-9925-00 coil with the associated Cartesian reference system.Figure 3
Sketch showing the rototranslation operation of coil and brain domains.The current flowing in the MAG-9925-00 coil energized with the biphasic stimulator Magstim Rapid2 was measured using a Tektronix DPO 2024 (200 MHz; 1 GS/s) digital oscilloscope equipped with amperometric probes Tektronix TCT 0030 A (120 MHz; 30 A).In agreement with theoretical predictions, the measured current time course is well fitted by a damped sinusoid with periodT=340 μs, amplitude 100 A (stimulator set at the 1% of the maximum deliverable power), and attenuation constant α=2000 s−1.Since theE→ field induced in the brain reaches its maximum value at the time instants where the time derivative of the current is maximum (i.e., at the beginning of the stimulus), generally the current signal is assimilated to a pure sinusoid that has the same slope of the damped sinusoid at the origin [18]. This slope, calculated in the first 20 μs, is perfectly approximated (error < 1%) by a pure sine wave with frequency f=2.94 kHz and amplitude I=86.6 A.Therefore, the code for theE→ field calculation works at the approximated frequency of 3 kHz; the current amplitude is an input variable that can be changed depending on the power level set on the stimulator.


## 2.3.A→ and B→ Fields Calculation

Under the quasistatic approximation, assuming a uniform current density over the coil cross section [31] and considering the meshed coil, the magnetic vector potential A→ at any space point r→ can be calculated as the superimposition of all contributions from linear segments Δl→ used to discretize the coil model:(2)A→r→=μ0I4π∑lΔl→r→-r→′,where μ0 is the free space permeability,I and Δl→ are the intensity and direction of the current flowing through the coil, and |r→-r→′| is the distance from the observation point to the source point on the coil.The uniform current density is a plausible assumption since the wire thickness does not exceed two times the skin depth at the considered frequencies.TheA→ distributions stored in the library files are calculated for I=1 A. Due to the linear relationship between I and A→, the actual distributions are simply multiplied by a factor equal to the current intensityI.A
→ values, stored in the library files, are used to calculate the E→ distribution.Using the same assumption, magnetic flux densityB→ has been also calculated for comparison with results from commercial codes, in order to validate the coil modeling.B
→ at any space point is calculated using the discretized version of the Biot-Savart law:(3)B→r→=μ0I4π∑lΔl→×r0→r→-r→′3,where r0→ is the unit vector of r→.


## 2.4. Human Brain Model

The developed code is able to operate with any patient specific voxeled brain model coming from MRI.In this paper the brain model is obtained from the Virtual Population member Duke (v.1.0, Zurich Med Tech AG, Zurich, Switzerland, [46]), that is, a 1 mm resolution voxeled male model in which a number from 1 to 77 encodes for 77 different tissues. We consider only a box of 183×219×182 mm3 containing all the brain structures; this box is processed in order to have a simplified model consisting of only three materials, that is, GM (that takes into account the cortex and all the nuclei like thalamus, hypothalamus, etc.), WM (that includes the structures that can be assimilated to nerve fibers), and CSF (that incorporates all the other tissues).In this paper we consider both the three-tissue model, referred to as inhomogeneous, and a further simplified model where all tissues in the brain are treated as GM (homogeneous).To speed up the solution process while keeping an acceptable spatial resolution in a real-time clinic framework, the brain model is undersampled and discretized in cubic cells 3 mm on a side.Due to the fact that biological tissues do not possess magnetic properties, the permeability values are taken to beμ0, that is, the free space permeability.All materials are considered as lossy ones with complex conductivity equal to(4)σ∗=σ+j2πfε0εr,where σ and εr are the electric conductivity and the relative permittivity, respectively, ε0 is the permittivity of the free space, and f is the operating frequency of 3 kHz.The used values areεr = 6.7 × 104, σ=0.1 S/m for the GM and εr=109, σ=2 S/m for the CSF [47]. WM is considered isotropic with εr = 3.01 × 104, σ = 0.065 S/m [47].


## 2.5. Calculation of the InducedE→ Field

### 2.5.1. The Admittance Method

Among different numerical approaches for theE→ field calculation inside the brain we chose to adopt the admittance method since it allowed us to explore the whole brain volume with reduced computational time [22, 44, 45].The admittance method is based on a finite difference (FD) approach to the solution of Maxwell’s equations in the frequency domain in quasistatic condition [48], which is considered valid at the typical frequency of a biphasic TMS pulse (≤3 kHz).The analysis domain is divided intoN homogeneous cells (Δx×Δy×Δz) centered at the point of coordinates (x,y,z) in a Cartesian grid that can be represented as a network of lumped electrical elements (see Figure 2 of [45] for a simplified 2D representation) [45, 49, 50].Applying the Kirchhoff law at each node (x,y,z) of the network leads to a linear system whose equations are given by(5)Vx,y,z=1Yx-+Yx++Yy-+Yy++Yz-+Yz-Yx+Vx+Δx,y,z+Yx-Vx-Δx,y,z+Yy+Vx,y+Δy,z+Yy-Vx,y-Δy,z+Yz+Vx,y,z+Δz+Yz-Vx,y,z-Δz-Yx-ΔxjωAx-+Yx+ΔxjωAx+-Yy-ΔyjωAy-+Yy+ΔyjωAy+-Yz-ΔzjωAz-+Yz+ΔzjωAz+,where Vx,y,z is the unknown scalar electric potential at each network node, Yi and Ai (i=x-,x+,y-,y+,z-,z+) are the admittance and the vector potential components at each surface of the discretizing cell, and ω is the operating angular frequency.The admittance values are calculated from the complex conductivity of (4) as (6)Yx+=2σx∗σx+Δx∗σx∗+σx+Δx∗ΔyΔzΔx.The linear system of (5) is solved using the overrelaxation iterative technique [22, 44, 45]. This choice is based on the best compromise among easy implementation, computer memory occupation, and speed of convergence [51, 52]: (7)Vn+1x,y,z=Vnx,y,z+αVx,y,z-Vnx,y,zwith convergence factor α between 1 and 2.The iterative procedure ends when the error at thenth step (left side of (8)) falls down below a defined tolerance levele:(8)∑i=1NVin+1-Vin∑i=1NVin<e.In this work e is fixed to 1 × 10−7.


### 2.5.2. Rototranslation

Rototranslation is a fundamental operation for theE→ field calculation: it permits a dynamical mapping of the brain domain into the coil domain.If (Cx,Cy,Cz) are the coordinates of the origin of the coil Cartesian reference system (local system) with respect to the brain Cartesian reference system (global system), and (u1x,u1y,u1z), (u2x,u2y,u2z), and (u3x,u3y,u3z) are the coordinates of the unitary vectors u1,u2,u3 identifying the local system with respect to the global one, the one-to-one correspondence between the coordinates of any point in the local system (x,y,z) and the correspondent point in the global system (x1,y1,z1) is given by the linear relationship: (9)x1y1z1=CxCyCz+u1xu2xu3xu1yu2yu3yu1zu2zu3zxyz,where the coefficients Cx,Cy,Cz,u1x,u2x,u3x,u1y,u2y,u3y, u1z,u2z, and u3z are calculated from the coordinates of three fiducial points (C,H,L) on the coil (Figure 3 shows a simplified sketch of the operation).In the two discretized domains the correspondence between cells is not necessary one to one, since the rototranslation operation is not conformal, but the maximum committed error is equal to the cell size (3 mm); thus, it is inside the accepted tolerance.


## 2.5.1. The Admittance Method

Among different numerical approaches for theE→ field calculation inside the brain we chose to adopt the admittance method since it allowed us to explore the whole brain volume with reduced computational time [22, 44, 45].The admittance method is based on a finite difference (FD) approach to the solution of Maxwell’s equations in the frequency domain in quasistatic condition [48], which is considered valid at the typical frequency of a biphasic TMS pulse (≤3 kHz).The analysis domain is divided intoN homogeneous cells (Δx×Δy×Δz) centered at the point of coordinates (x,y,z) in a Cartesian grid that can be represented as a network of lumped electrical elements (see Figure 2 of [45] for a simplified 2D representation) [45, 49, 50].Applying the Kirchhoff law at each node (x,y,z) of the network leads to a linear system whose equations are given by(5)Vx,y,z=1Yx-+Yx++Yy-+Yy++Yz-+Yz-Yx+Vx+Δx,y,z+Yx-Vx-Δx,y,z+Yy+Vx,y+Δy,z+Yy-Vx,y-Δy,z+Yz+Vx,y,z+Δz+Yz-Vx,y,z-Δz-Yx-ΔxjωAx-+Yx+ΔxjωAx+-Yy-ΔyjωAy-+Yy+ΔyjωAy+-Yz-ΔzjωAz-+Yz+ΔzjωAz+,where Vx,y,z is the unknown scalar electric potential at each network node, Yi and Ai (i=x-,x+,y-,y+,z-,z+) are the admittance and the vector potential components at each surface of the discretizing cell, and ω is the operating angular frequency.The admittance values are calculated from the complex conductivity of (4) as (6)Yx+=2σx∗σx+Δx∗σx∗+σx+Δx∗ΔyΔzΔx.The linear system of (5) is solved using the overrelaxation iterative technique [22, 44, 45]. This choice is based on the best compromise among easy implementation, computer memory occupation, and speed of convergence [51, 52]: (7)Vn+1x,y,z=Vnx,y,z+αVx,y,z-Vnx,y,zwith convergence factor α between 1 and 2.The iterative procedure ends when the error at thenth step (left side of (8)) falls down below a defined tolerance levele:(8)∑i=1NVin+1-Vin∑i=1NVin<e.In this work e is fixed to 1 × 10−7.


## 2.5.2. Rototranslation

Rototranslation is a fundamental operation for theE→ field calculation: it permits a dynamical mapping of the brain domain into the coil domain.If (Cx,Cy,Cz) are the coordinates of the origin of the coil Cartesian reference system (local system) with respect to the brain Cartesian reference system (global system), and (u1x,u1y,u1z), (u2x,u2y,u2z), and (u3x,u3y,u3z) are the coordinates of the unitary vectors u1,u2,u3 identifying the local system with respect to the global one, the one-to-one correspondence between the coordinates of any point in the local system (x,y,z) and the correspondent point in the global system (x1,y1,z1) is given by the linear relationship: (9)x1y1z1=CxCyCz+u1xu2xu3xu1yu2yu3yu1zu2zu3zxyz,where the coefficients Cx,Cy,Cz,u1x,u2x,u3x,u1y,u2y,u3y, u1z,u2z, and u3z are calculated from the coordinates of three fiducial points (C,H,L) on the coil (Figure 3 shows a simplified sketch of the operation).In the two discretized domains the correspondence between cells is not necessary one to one, since the rototranslation operation is not conformal, but the maximum committed error is equal to the cell size (3 mm); thus, it is inside the accepted tolerance.


## 3. Numerical Results

### 3.1. Accuracy Evaluation

In this section we want to evaluate how much the assumption of homogeneous brain, the spatial resolution of 3 mm, and the thickness of the shell around the brain (3 mesh cells), adopted in our code to speed up calculation, can affect the accuracy of results and how much it can be considered well acceptable within the approximation of a real-time clinical use. Moreover, to validate the used method, we compare our results with those obtained using a commercial software (SIM4LIFE, ZMT Zurich MedTech AG), based on a different solution method, on an inhomogeneous brain model with 1 mm spatial resolution. In this last comparison, to reduce possible truncation errors at the domain boundary, we solved the admittance method on a volume including a CSF shell of 10 mesh cells around the brain.SIM4LIFE is a simulation platform developed for modeling of interactions between physical stimuli and the human body. In particular, this software can deal with medical image data obtained from MRI. The simulation platform includes many physics solvers; we chose to work with the Magneto Quasistatic module included in the Quasistatic EM Solvers (P-EM-QS) that solves problems in static or quasistatic EM regimes applying the FEM method on graded voxel meshes. To compare results on the same mesh grid we decided to work with SIM4LIFE by setting a regular mesh constituted of cubic voxels 1 mm on a side.The stimulation is the MAG-9925-00 coil placed horizontally with center coordinates in cm (9.1, 10.9, and 18.4) and handle orthogonal to the coronal plane (Figure3), modeled in SIM4LIFE as a bidimensional sketch, using the same MATLAB file developed for the C++ code.A first comparison onB→ field distributions generated by the coil within the brain volume reveals that differences between our method and SIM4LIFE solution are always below 0.1%.Moving to the calculatedE→ field, Figure 4 reports the distributions of the induced E→ field on the top surface of the brain (a, b, c, and d) and on a coronal section at y=10.9 cm (e, f, g, and h).Figure 4
E
→ (V/m) distributions induced in different brain models and/or different methods by MAG-9925-00 coil fed by a sinusoidal current 3 kHz, 3 kA. Distributions on the top surface (upper row) and on a coronal section at y=10.9 cm (lower row), respectively, for the homogeneous brain model with 3 mm resolution (a) and (e), for the inhomogeneous brain model with 3 mm resolution (b) and (f), and for the inhomogeneous brain model with 1 mm resolution (c) and (g), calculated with the commercial code SIM4LIFE for the inhomogeneous brain model with 1 mm resolution (d) and (h).
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)Figure4 shows that in all cases the same stimulated regions are predicted under the coil center, with E→ distributions dependent on the shape of the cortical surface. There is no significant difference between homogeneous and inhomogeneous brain with 3 mm of resolution, whereas induced E→ is higher under the coil and goes deeper inside the cortex for 1 mm resolution.Moving to a quantitative analysis, we will consider observables suitable to compare intensity, spread, and localization of the estimated stimulation. The stimulation intensity is measured by the maximumE→ field (EMAX) induced in the brain. To have a robust localization of the stimulation position, useful in clinical practice, we define the stimulation center (SC) as a sort of center of mass of the volume extension of the stimulation, where geometric coordinates are weighted by the E→ intensity at each node [30]. Such a volume has been considered as the space where E→ overcomes the 80% of its maximum value (VOL80). Moreover, another comparison between the results obtained with the admittance method and SIM4LIFE was performed computing the Symmetric Mean Absolute Percentage Error (SMAPE) [53, 54] between the E→ values inside the same volume VOL80.The SMAPE is calculated as follows:(10)SMAPE=1N∑k=1NEk_adm-Ek_simEk_adm+Ek_sim/2·100,where k denotes the kth cell, N is the number of cells inside VOL80, and Ek_adm and Ek_sim are the E→ field magnitudes inside VOL80 calculated with the admittance method and SIM4LIFE, respectively.Table1 summarizes EMAX, SC coordinates, and SMAPE, obtained for the E→ distributions calculated using SIM4LIFE and the admittance code in the inhomogeneous brain model, 1 mm of spatial resolution.Table 1
Maximum|E→| (EMAX), stimulation center (SC) coordinates, and SMAPE calculated for the inhomogeneous brain model with 1 mm resolution and a shell of 10 mesh cells and calculated with the commercial code SIM4LIFE for the inhomogeneous brain model with a regular 1 mm mesh size.
E
MAX (V/m)
SC coordinates (cm)
SMAPE
Admittance inhomogeneous 1 mm(10 cells shell)
310.78
(9.35; 11.60; 14.57)
6.91%
SIM4LIFE inhomogeneous 1 mm
307.21
(9.30; 11.62; 14.53)Table1 shows that results on EMAX obtained with the same brain model (inhomogeneous 1 mm) but using the two different approaches (admittance and SIM4LIFE) differ only by 1.2%, with a distance below 1 mm between the estimated SCs. The similarity of the results obtained with the two methods is also confirmed by the SMAPE that, for the volume chosen, is less than 7%.The observed variability of results is well below that obtained using the same SIM4LIFE software with different mesh settings; thus, such results confirm the goodness of our solution method.When considering the solution obtained with the admittance method in the brain domain used to speed up calculation (homogeneous, 3 mm of resolution, and CSF layer of 3 mesh cells), the calculatedEMAX is underestimated by 26% with respect to the solutions obtained with SIM4LIFE, gridded with the same 3 mm resolution. Still the results, at this spatial resolution, remain consistent and the SMAPE at 80% is calculated as 14.58%.It seems evident that the implemented methodology can estimate the stimulated regions in good agreement with those calculated by the commercial code SIM4LIFE using a realistic inhomogeneous brain model with resolution of 1 mm. Therefore when more accurate offline computations are desired (e.g., for planning TMS therapy sessions) our methodology used with the detailed brain model is confirmed to be affordable.Moreover, when real-time results are required for navigation during experiments or clinic therapy, we have to calculate theE→ field in a brain model using 3 mm of resolution and a surrounding CSF layer of only 3 cells. In this case, results are obtained within 20 seconds on a PC 2.8 GHz Intel Core i7, both for the homogeneous and the inhomogeneous models. Nevertheless this coarse resolution does not affect significantly the brain region targeting, introducing an underestimation less than 30% of the maximum E→ level that can still be acceptable in real-time applications [30].The use of homogeneous or inhomogeneous brain models with 3 mm resolution affects neither computational times nor accuracy of the stimulation estimate. Thus one can choose to use a simple homogeneous model to represent different patients brains (general purpose) or a more realistic inhomogeneous one for patient specific applications [18].


### 3.2. Application of the Solution Strategy

In this section we want to show an example on how the developed code can operate online during a TMS section, following the flowchart of Figure1. To fulfill the real-time requirement we use the homogeneous brain model discretized using 3 mm spatial step and we apply the admittance method for the E→ field calculation inside a conductor volume including the brain and a CSF surrounding layer of 3 mesh cells thick (Section 2.1).At the beginning of the TMS session the operator chooses the coil and the current intensity. Then, after loading the library files corresponding to the brain model and the vector potentialA→ generated by the coil, the code asks for the coordinates of three fiducial points identifying the coil positioning. After giving results on E→ distribution inside the brain volume and on the stimulation center, the code asks for a new coil positioning until the end of the section.In this example the coil is the MAG-9925-00 with a current of 3 kA flowing through it. The operator moves the coil in four positions identified by the following coordinates (in cm) of the three fiducial points (C, H, and L in Figure 3) with respect to the brain:(1)
C (9.1,10.9,18.4),H (9.1,9.9,18.4), andL (10.1,10.9,18.4), corresponding to the MAG-9925-00 coil placed horizontally at the top of the brain (Figures 5(a) and 5(e));(2)
C (13.1,10.9,16.4),H (13.1,9.9,16.4), andL (13.97,10.9,15.9), corresponding to the coil translation of Δx=4 cm, Δy=0 cm, and Δz=-2 cm with respect to position (1) and a rotation of 30° around the axis through the center of the coil parallel to the y-axis (Figures 5(b) and 5(f));(3)
C (16.1,10.9,14.4),H (16.1,9.9,14.4), andL (16.6,10.9,13.53), corresponding to the coil translation of Δx=7 cm, Δy=0 cm, and Δz=-4 cm with respect to position (1) and a rotation of 60° around the axis through the center of the coil parallel to the y-axis (Figures 5(c) and 5(g));(4)
C (18.1,10.9,9.4),H (18.1,9.9,9.4), andL (18.1,10.9,8.4), corresponding to the coil translation of Δx=9 cm, Δy=0 cm, and Δz=-9 cm with respect to position (1) and a rotation of 90° around the axis through the center of the coil parallel to the y-axis (Figures 5(d) and 5(h)).During the offline step, loading of files containing the A→ distribution in the coil domain takes 6 s. This time depends only on the size of the coil domain.Figure 5
E
→ (V/m) distributions calculated with the admittance method using a homogeneous brain model 3 mm of resolution for the horizontal MAG-9925-00 coil on the top surface (a) and on a coronal section at y=10.9 cm (e), the shifted and rotated (30°) MAG-9925-00 coil on the top surface (b) and on a coronal section at y=10.9 cm (f), the shifted and rotated (60°) MAG-9925-00 coil on the top surface (c) and on a coronal section at y=10.9 cm (g), and the shifted and rotated (90°) MAG-9925-00 coil on the top surface (d) and on a coronal section at y=10.9 cm (h). The white crosses are the projections of calculated SCs on the maps.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)For each position, the fast engineE→ calculation takes 14 s to calculate the E→ distribution inside the brain and the coordinates of the stimulation center (Figure 5). This time does not depend on the specific position but only on the number of cells discretizing the calculation volume.During the whole TMS session, the developed code requires only 62 s to calculate theE→ maps and the stimulation centers for all the coil positions, around 15 seconds per position (Figure 5 and Table 2). As expected, the stimulated region is always under the coil center, with distributions dependent on the geometry of the brain surface.Table 2
Maximum|E→| (EMAX) and stimulation center (SC) coordinates calculated for the MAG-9925-00 coil in four different positions with respect to the brain.
Coil position
E
MAX (V/m)
SC coordinates (cm)
Horizontal
162.61
(8.36; 12.85; 15.70)
Shifted/tilted (30°)
228.43
(11.31; 12.10; 15.32)
Shifted/tilted (60°)
195.57
(15.10; 10.00; 12.70)
Shifted/tilted (90°)
142.88
(15.30; 10.31; 9.07)Table2 summarizes EMAX and SC calculated in each position.Results of Table2 confirm that the stimulation centers are located in the brain cortex under the axis of the coil passing through its center. The higher values of EMAX calculated in positions 30° and 60° are due to coil closer to the brain surface.


## 3.1. Accuracy Evaluation

In this section we want to evaluate how much the assumption of homogeneous brain, the spatial resolution of 3 mm, and the thickness of the shell around the brain (3 mesh cells), adopted in our code to speed up calculation, can affect the accuracy of results and how much it can be considered well acceptable within the approximation of a real-time clinical use. Moreover, to validate the used method, we compare our results with those obtained using a commercial software (SIM4LIFE, ZMT Zurich MedTech AG), based on a different solution method, on an inhomogeneous brain model with 1 mm spatial resolution. In this last comparison, to reduce possible truncation errors at the domain boundary, we solved the admittance method on a volume including a CSF shell of 10 mesh cells around the brain.SIM4LIFE is a simulation platform developed for modeling of interactions between physical stimuli and the human body. In particular, this software can deal with medical image data obtained from MRI. The simulation platform includes many physics solvers; we chose to work with the Magneto Quasistatic module included in the Quasistatic EM Solvers (P-EM-QS) that solves problems in static or quasistatic EM regimes applying the FEM method on graded voxel meshes. To compare results on the same mesh grid we decided to work with SIM4LIFE by setting a regular mesh constituted of cubic voxels 1 mm on a side.The stimulation is the MAG-9925-00 coil placed horizontally with center coordinates in cm (9.1, 10.9, and 18.4) and handle orthogonal to the coronal plane (Figure3), modeled in SIM4LIFE as a bidimensional sketch, using the same MATLAB file developed for the C++ code.A first comparison onB→ field distributions generated by the coil within the brain volume reveals that differences between our method and SIM4LIFE solution are always below 0.1%.Moving to the calculatedE→ field, Figure 4 reports the distributions of the induced E→ field on the top surface of the brain (a, b, c, and d) and on a coronal section at y=10.9 cm (e, f, g, and h).Figure 4
E
→ (V/m) distributions induced in different brain models and/or different methods by MAG-9925-00 coil fed by a sinusoidal current 3 kHz, 3 kA. Distributions on the top surface (upper row) and on a coronal section at y=10.9 cm (lower row), respectively, for the homogeneous brain model with 3 mm resolution (a) and (e), for the inhomogeneous brain model with 3 mm resolution (b) and (f), and for the inhomogeneous brain model with 1 mm resolution (c) and (g), calculated with the commercial code SIM4LIFE for the inhomogeneous brain model with 1 mm resolution (d) and (h).
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)Figure4 shows that in all cases the same stimulated regions are predicted under the coil center, with E→ distributions dependent on the shape of the cortical surface. There is no significant difference between homogeneous and inhomogeneous brain with 3 mm of resolution, whereas induced E→ is higher under the coil and goes deeper inside the cortex for 1 mm resolution.Moving to a quantitative analysis, we will consider observables suitable to compare intensity, spread, and localization of the estimated stimulation. The stimulation intensity is measured by the maximumE→ field (EMAX) induced in the brain. To have a robust localization of the stimulation position, useful in clinical practice, we define the stimulation center (SC) as a sort of center of mass of the volume extension of the stimulation, where geometric coordinates are weighted by the E→ intensity at each node [30]. Such a volume has been considered as the space where E→ overcomes the 80% of its maximum value (VOL80). Moreover, another comparison between the results obtained with the admittance method and SIM4LIFE was performed computing the Symmetric Mean Absolute Percentage Error (SMAPE) [53, 54] between the E→ values inside the same volume VOL80.The SMAPE is calculated as follows:(10)SMAPE=1N∑k=1NEk_adm-Ek_simEk_adm+Ek_sim/2·100,where k denotes the kth cell, N is the number of cells inside VOL80, and Ek_adm and Ek_sim are the E→ field magnitudes inside VOL80 calculated with the admittance method and SIM4LIFE, respectively.Table1 summarizes EMAX, SC coordinates, and SMAPE, obtained for the E→ distributions calculated using SIM4LIFE and the admittance code in the inhomogeneous brain model, 1 mm of spatial resolution.Table 1
Maximum|E→| (EMAX), stimulation center (SC) coordinates, and SMAPE calculated for the inhomogeneous brain model with 1 mm resolution and a shell of 10 mesh cells and calculated with the commercial code SIM4LIFE for the inhomogeneous brain model with a regular 1 mm mesh size.
E
MAX (V/m)
SC coordinates (cm)
SMAPE
Admittance inhomogeneous 1 mm(10 cells shell)
310.78
(9.35; 11.60; 14.57)
6.91%
SIM4LIFE inhomogeneous 1 mm
307.21
(9.30; 11.62; 14.53)Table1 shows that results on EMAX obtained with the same brain model (inhomogeneous 1 mm) but using the two different approaches (admittance and SIM4LIFE) differ only by 1.2%, with a distance below 1 mm between the estimated SCs. The similarity of the results obtained with the two methods is also confirmed by the SMAPE that, for the volume chosen, is less than 7%.The observed variability of results is well below that obtained using the same SIM4LIFE software with different mesh settings; thus, such results confirm the goodness of our solution method.When considering the solution obtained with the admittance method in the brain domain used to speed up calculation (homogeneous, 3 mm of resolution, and CSF layer of 3 mesh cells), the calculatedEMAX is underestimated by 26% with respect to the solutions obtained with SIM4LIFE, gridded with the same 3 mm resolution. Still the results, at this spatial resolution, remain consistent and the SMAPE at 80% is calculated as 14.58%.It seems evident that the implemented methodology can estimate the stimulated regions in good agreement with those calculated by the commercial code SIM4LIFE using a realistic inhomogeneous brain model with resolution of 1 mm. Therefore when more accurate offline computations are desired (e.g., for planning TMS therapy sessions) our methodology used with the detailed brain model is confirmed to be affordable.Moreover, when real-time results are required for navigation during experiments or clinic therapy, we have to calculate theE→ field in a brain model using 3 mm of resolution and a surrounding CSF layer of only 3 cells. In this case, results are obtained within 20 seconds on a PC 2.8 GHz Intel Core i7, both for the homogeneous and the inhomogeneous models. Nevertheless this coarse resolution does not affect significantly the brain region targeting, introducing an underestimation less than 30% of the maximum E→ level that can still be acceptable in real-time applications [30].The use of homogeneous or inhomogeneous brain models with 3 mm resolution affects neither computational times nor accuracy of the stimulation estimate. Thus one can choose to use a simple homogeneous model to represent different patients brains (general purpose) or a more realistic inhomogeneous one for patient specific applications [18].


## 3.2. Application of the Solution Strategy

In this section we want to show an example on how the developed code can operate online during a TMS section, following the flowchart of Figure1. To fulfill the real-time requirement we use the homogeneous brain model discretized using 3 mm spatial step and we apply the admittance method for the E→ field calculation inside a conductor volume including the brain and a CSF surrounding layer of 3 mesh cells thick (Section 2.1).At the beginning of the TMS session the operator chooses the coil and the current intensity. Then, after loading the library files corresponding to the brain model and the vector potentialA→ generated by the coil, the code asks for the coordinates of three fiducial points identifying the coil positioning. After giving results on E→ distribution inside the brain volume and on the stimulation center, the code asks for a new coil positioning until the end of the section.In this example the coil is the MAG-9925-00 with a current of 3 kA flowing through it. The operator moves the coil in four positions identified by the following coordinates (in cm) of the three fiducial points (C, H, and L in Figure 3) with respect to the brain:(1)
C (9.1,10.9,18.4),H (9.1,9.9,18.4), andL (10.1,10.9,18.4), corresponding to the MAG-9925-00 coil placed horizontally at the top of the brain (Figures 5(a) and 5(e));(2)
C (13.1,10.9,16.4),H (13.1,9.9,16.4), andL (13.97,10.9,15.9), corresponding to the coil translation of Δx=4 cm, Δy=0 cm, and Δz=-2 cm with respect to position (1) and a rotation of 30° around the axis through the center of the coil parallel to the y-axis (Figures 5(b) and 5(f));(3)
C (16.1,10.9,14.4),H (16.1,9.9,14.4), andL (16.6,10.9,13.53), corresponding to the coil translation of Δx=7 cm, Δy=0 cm, and Δz=-4 cm with respect to position (1) and a rotation of 60° around the axis through the center of the coil parallel to the y-axis (Figures 5(c) and 5(g));(4)
C (18.1,10.9,9.4),H (18.1,9.9,9.4), andL (18.1,10.9,8.4), corresponding to the coil translation of Δx=9 cm, Δy=0 cm, and Δz=-9 cm with respect to position (1) and a rotation of 90° around the axis through the center of the coil parallel to the y-axis (Figures 5(d) and 5(h)).During the offline step, loading of files containing the A→ distribution in the coil domain takes 6 s. This time depends only on the size of the coil domain.Figure 5
E
→ (V/m) distributions calculated with the admittance method using a homogeneous brain model 3 mm of resolution for the horizontal MAG-9925-00 coil on the top surface (a) and on a coronal section at y=10.9 cm (e), the shifted and rotated (30°) MAG-9925-00 coil on the top surface (b) and on a coronal section at y=10.9 cm (f), the shifted and rotated (60°) MAG-9925-00 coil on the top surface (c) and on a coronal section at y=10.9 cm (g), and the shifted and rotated (90°) MAG-9925-00 coil on the top surface (d) and on a coronal section at y=10.9 cm (h). The white crosses are the projections of calculated SCs on the maps.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)For each position, the fast engineE→ calculation takes 14 s to calculate the E→ distribution inside the brain and the coordinates of the stimulation center (Figure 5). This time does not depend on the specific position but only on the number of cells discretizing the calculation volume.During the whole TMS session, the developed code requires only 62 s to calculate theE→ maps and the stimulation centers for all the coil positions, around 15 seconds per position (Figure 5 and Table 2). As expected, the stimulated region is always under the coil center, with distributions dependent on the geometry of the brain surface.Table 2
Maximum|E→| (EMAX) and stimulation center (SC) coordinates calculated for the MAG-9925-00 coil in four different positions with respect to the brain.
Coil position
E
MAX (V/m)
SC coordinates (cm)
Horizontal
162.61
(8.36; 12.85; 15.70)
Shifted/tilted (30°)
228.43
(11.31; 12.10; 15.32)
Shifted/tilted (60°)
195.57
(15.10; 10.00; 12.70)
Shifted/tilted (90°)
142.88
(15.30; 10.31; 9.07)Table2 summarizes EMAX and SC calculated in each position.Results of Table2 confirm that the stimulation centers are located in the brain cortex under the axis of the coil passing through its center. The higher values of EMAX calculated in positions 30° and 60° are due to coil closer to the brain surface.


## 4. Discussion

Here we present a fast and robust computational approach forE→ field calculation inside realistic brain models. The computational approach is based on an improved revision of the admittance method. In addition, the strategy adopted to fulfill the real-time requirement decouples the domains where A→ and E→ fields are calculated. This allows us to calculate the E→ field inside the brain for each new coil position by dynamically mapping the brain model into the coil domain avoiding A→ to be recalculated each time. Both domains are discretized with 3×3×3 mm3 cubic cells resolution to obtain results in less than 20 s.Results were compared with those obtained using a more detailed brain model (i.e., 1 mm resolution) and a different solution method implemented by the commercial software SIM4LIFE. Comparisons show good agreement between results obtained with the two methods using the detailed brain model (i.e., 1 mm of resolution). The less refined resolution (i.e., 3 mm) determines an acceptable underestimation of the induced maximumE→ field while maintaining a good accuracy in the stimulation positioning.The presented methodology could benefit clinical TMS application in several ways. It may be used with the inhomogeneous1×1×1 mm3 resolution brain to improve the individual targeting and dosing of TMS during the offline planning of therapeutic TMS sessions. However, the actual advantage is the possibility of performing a real-time and accurate prediction (i.e., a few seconds) of the E→ field, using a 3 mm resolution, inside realistic brain regions with different coil models and any coil position and orientation.Some limitations of the proposed approach rely on the head model simplification. The brain model inside the CSF accounts for the tissue interface closest to the stimulated regions but does not represent a realistic scenario. The real brain is surrounded by various tissues such as adipose, skull, and scalp. In practice, the presence of these tissues may affect the overall distribution of the fields in a way that could be better investigated and quantified in a future research. Indeed, the analysis in [55] showed that the inclusion of the skull would not affect the distribution of currents in the adjacent cortex of the brain, while other authors claim the contrary [38]. Concluding, a direct consequence of this work would lead to including the main of the surrounding tissues such as skull and scalp.


## 5. Conclusions

This paper presents a fast, versatile, and robust approach to calculate theE→ field induced by different TMS coils within a realistic brain model obtained from MRI images.The presented approach is practical in the sense that it can be readily integrated with neuronavigation tools to accommodate online TMS, leading to possible improvement in the efficacy of TSM clinic applications.Future work will be related to the development of a realistic model of the human head, taking into account different biological tissues (bone, muscle, and skin), to evaluate the effect of the adopted head simplification.



---

*Source: 976854-2015-12-31.xml*