The present invention relates bringing a new accessible and accurate computational modeling approach to compute electric and magnetic fields in the brain to clinical practice.
The solution of computational electromagnetics (CEM) problems for human brain is of much interest to medical as well as commercial applications. Efficient and accurate CEM simulation enables, for example, a clinician to estimate and determine the exact locations of natural neural activity in the cortex or optimize the dose and the positions of electrodes or coils for electric or magnetic brain stimulation, providing in many cases more information than can ever be measured in a laboratory or in situ.
Commonly used numerical techniques for the analysis of electrical and magnetic brain activity as swell as electrical and magnetic brain stimulation are
a) Finite Element Method (FEM);
b) Boundary Element Method (BEM);
Bioelectromagnetic modeling of the brain as well as the human body is a continued competition between FEM and BEM. FEM discretizes the entire 3D volume into M tetrahedra or hexahedra. However, the resulting M×M system matrix is sparse. Its filling and iterative solution require as low as O(M log M) operations. BEM only discretizes 2D boundaries between otherwise homogeneous tissues into N triangles or quadrilaterals. However, the resulting N×N system matrix is dense; its filling alone requires O(N2) operations. Although N<<M, FEM is winning for large M and N i.e. for high-resolution subject-specific head models. For this reason, FEM is presently dominant in modeling chief neuromodulation modalities: transcranial magnetic stimulation, transcranial electrical stimulation, and deep brain stimulation. However, FEM cannot efficiently handle singular point sources—EEG (electroencephalography) and MEG (magnetoencephalography) dipoles. Therefore, a low-resolution BEM is used in EEG/MEG modeling.
The fast multipole method (FMM) introduced by Rokhlin and Greengard in 1980s is a way to reduce O(N2) to O(N log N) BEM operations and restore the major advantage of BEM—its faster speed and better accuracy for piecewise homogeneous tissues.
Since the 2000s, the high-frequency BEM-FMM algorithm has been successfully applied to the modeling of electromagnetic and acoustic scattering and radiation problems with a focus on defense applications. The quasistatic BEM-FMM algorithm has also been applied to capacitance/inductance computations in electrical engineering. Several commercial engineering software packages use custom BEM-FMM solvers, including ANSYS Q3D Extractor and FEKO.
However, before our first publication (Makarov et al. A Quasi-Static Boundary Element Approach with Fast Multipole Acceleration for High-Resolution Bioelectromagnetic Models. IEEE Trans Biomed Eng. 2018 Mar. 7. doi: 10.1109/TBME.2018.2813261) there was only one attempt to employ the fast multipole method (FMM) to quasistatic bioelectromagnetic problems (Kybic et al Fast multipole acceleration of the MEG/EEG boundary element method. Physics in Medicine and Biology. 2005; 50(19), 4695-4710. doi: http://doi.org/10.1088/0031-9155/50/19/018). This publication predicted that the time complexity of FMM may be higher rather than lower than that of traditional methods. We fear that this interpretation has had a discouraging influence on the development of approaches employing FMM in brain research.
Preliminary work done by the authors over 2018-2020 indicates that the meaningful multipole acceleration and the best combined boundary element fast multipole method (B EM-FMM) is obtained when
The BEM-FMM approach so developed is in a position to provide
At the same time, an implementation of the BEM-FMM approach for practical brain modeling problem including both neurophysiological recordings and neurostimulation will require:
Methods and system are presented for making the new BEM-FMM computational approach formulated in (Makarov et al. IEEE Trans Biomed Eng. 2018. doi: 10.1109/TBME.2018.2813261, Makarov et al J Neural Eng. 2020 doi: 10.1088/1741-2552/ab85b3, Makarov et al. IEEE Trans. Biomed. Eng. 2020 doi: 10.1109/TBME.2020.2999271) applicable to practical brain modeling problems in clinical applications including neurostimulation (TES or transcranial electrical stimulation, DBS or deep brain stimulation, ICMS or intracortical microstimulation) and neurophysiological recordings (EEG, MEG, intracortical EEG or iEEG) and. Examples of those applications are shown in
These methods include:
In a preferred embodiment, these methods will be used coupled with the new BEM-FMM approach. This approach includes the integral equation in terms of surface charge density on conductivity boundaries and the integration of the open-source parallelized FMM library, FMM3D originating from the inventors of the FMM and made accessible for commercial use since 2017 (Gimbutas et al. fmm3D Documentation. Release 0.1.0. 2019. Online: https://github.com/flatironinstitute/FMM3D). This FMM3D library summarizes a more than 20 years long ongoing effort of a group of leading mathematicians. This FMM3D library possesses high performance and speed, which could hardly be surpassed by custom codes.
In a preferred embodiment, these methods will assess brain waves and brain stimulation within a system on a computer, providing more information than can ever be measured in a laboratory or in situ.
I Overview
Methods and system are presented for assessing electric and magnetic quasistatic brain waves (EEG/MEG/iEEG) due to neural activity as well as assessing brain stimulation (TES/DBS/ICMS) fields on a computer. This is done while improving speed and accuracy of computational electromagnetics modeling environments. For the purpose of clarity, several embodiments described below are presented in the context of surface head models, using triangular surface discretization. But those of skill in the art will recognize that the system and methods described herein below are applicable to alternative discretization approaches (e.g., rectangular, hexagonal lattice, etc.). In addition, those of skilled in the art will recognize that the principles can also be applied to determining performance characteristics for human head models that include dielectric tissue properties.
In some embodiments, the system and methods are embodied in software stored and executable on one or more computing devices. A user can access the systems and methods using a user device, e.g., a computing device, remotely or locally. For example, the user device can interact with the systems and methods through a network, e.g., the Internet, and can display a user interface, e.g., a webpage, to the user. The user device can also host the systems and methods locally, e.g., by downloading and installing the software on the user device. The models can be constructed using the same systems and methods or different systems and methods that are hosted by the same computing device(s).
II. Example of System
In the example shown in
The server device 150 hosts a technical computing environment (TCE) 130 in which the historical data is processed and the target models are processed and/or generated. In some implementations, the client device 110 may employ a TCE 130 (160) to provide a display, e.g., a webpage. In some implementations, a user interacts with the server device 150 via the displayed webpage. The displayed TCE 130 operating on the client device 110 can be the same as or be part of the TCE 130 hosted by the server device 150. In some implementations, the TCE 160 is hosted on the client device 110. In such implementations, the client device 110 may not need to access the server device 150 to generate and/or process the desired model. Instead, target models can be generated locally at the client device 110 in the TCE 130. The TCE 130 can provide an interface that allows a user to interact with the client device 110 and the server device 150.
The server device 150, the client device 110, and the network 140 can be connected through wired connections, wireless connections, or a combination of wired and wireless connections. Although one client device 110 and one server device 150 are shown, multiple client devices 110 can access one or more server devices 150 through the same network 140 or a different network. In some implementations, one or more server devices 150 host one or more TCEs 130, e.g., using virtual machines. Multiple server devices 150 can be used to execute program code, e.g., serially or in parallel, and may provide respective results of executing the program code to the client device 110.
The client device 110 can include one or more devices capable of receiving, generating, storing, processing, and/or providing program code and/or information associated with program code for a model. For example, the client device 110 includes a computing device, such as a desktop computer, a laptop computer, a tablet computer, a mobile phone (e.g., a smart phone, a radiotelephone, etc.), or a similar device. In some implementations, the client device 110 receives information from and/or transmits information to the server device 150.
The server device 150 may include one or more devices capable of receiving, generating, storing, processing, evaluating, and/or providing program code and/or information associated with program code for a model. Additionally, the server device 150 also includes one or more devices capable of comparing multiple models generated from the same set of historical data. For example, the server device 150 includes a computing device, such as a server, a desktop computer, a laptop computer, a tablet computer, or a similar device.
The network 140 can include one or more wired and/or wireless networks. For example, network 140 includes a cellular network, a public land mobile network (PLMN), a local area network (LAN), a wide area network (WAN), a metropolitan area network (MAN), a telephone network (e.g., the Public Switched Telephone Network (PSTN)), an ad hoc network, an intranet, the Internet, a fiber optic-based network, a private network, a cloud computing network, and/or a combination of these or other types of networks.
Referring also to
The numbers and arrangements of devices and networks shown in
III. Example Implementation of Brain Modeling with Voltage/Current Active or Passive Electrodes Using Non-Nested Head Topology and Tissue Anisotropy
With reference to
Initially, upon receipt of a request, step 302 to perform brain modeling e.g., from a user or a user device, the system may prompt the user or user device to input complete information about the target model(s), step 304. These inputs can be the same as TCE inputs 262 of
Once the target surface head model is imported and described, some implementations then begin to model the fields within the head and performance estimation process (Step 308). Mathematical details of certain exemplary implementations of process 308 will be described in much greater detail below as including numerous sub-processes. In step 306, the target head surface mesh model is also processed internally to enable a proper treatment of the non-nested head geometry.
Results, such as described above, of the electric and magnetic field estimation process 308 may be output in Step 330. A determination (Step 332) may then be made to establish whether the determined performance characteristics of the electrode system and its readings meet user's requirements.
Typical performance requirements specified for neurostimulation (TMS/DBS/ICMS) include sufficiently high electric field levels within certain cortical and subcortical domains and sufficiently low fields otherwise.
Typical performance requirements specified for neurophysiological recordings include sufficiently high output voltage signals at the electrodes and sufficient electrode coverage for required spatial resolution.
If the requirements are satisfied, the process may then proceed to other target modeling tasks, or progress to prototype development (Step 334). If the performance measures output does not meet the specified requirements, the process may iterate, e.g., from step 332, permitting the user to enter additional and/or different input parameters or change the electrode assembly, or the system to automatically vary certain input parameters, until the output performance characteristics for the modeled physical field distributions satisfy the requirements.
Sections IV through XII will now describe in detail exemplary solutions for the scattering algorithm with the general purpose fast multipole method, FMM3D, of process 300 including step 308 and individual steps 306, 310, 312, 314, 316, 318, 320, 322, 324.
IV. Direct Charge-Based BEM in a Conducting Medium—Relevant to Step 308 and all Individual Steps 306, 310, 312, 314, 316, 318, 320, 322, 324
Induced charges with a surface charge density ρ(r) in C/m2 reside on macroscopic or microscopic tissue conductivity interface(s) S once an external electromagnetic stimulus (a primary electric field Ep(r), either conservative or solenoidal) is applied. The induced surface charges alter (typically block and/or redirect) the primary stimulus field. The total electric field anywhere in space except the charged interfaces themselves is governed by Coulomb's law
where ε0 is dielectric permittivity of vacuum. The electric field is discontinuous at the interfaces. When approaching a charged interface S with a normal vector n from either direction (inside or outside with regard to the direction of the normal vector), the electric field is given by
An integral equation for ρ(r), is obtained after substitution of Eq. (2) into the quasistatic boundary condition, which enforces the continuity of the normal current component across the interface, that is
σinn(r)·Ein=σoutn(r)·Eout, r∈S (Eq. 3)
The result has the form of the Fredholm integral equation of the second kind.
where the electric conductivity contrast
is defined at the interface(s). Here, σin, σout are are the conductivities inside and outside with regard to the direction of the normal vector, respectively. Note that if we solve Eq. (4) and then substitute the result for ρ(r) in Eq. (1), the normalization constant ε0 will cancel out. Therefore, its exact value does not matter for the subsequent analysis. However, if the displacement currents are significant, extra bound polarization charges will reside on the interfaces. Their effect is taken into account by considering a complex conductivity in the form a σ→σ+jωε for a harmonic excitation with angular frequency co in Eq. (4).
The surface charge density is expanded/discretized into pulse bases (zeroth-order basis functions) on triangular facets tm with area Am. The surface charge density is thus constant for every facet. The Galerkin method is then applied to Eq. (4) which gives us a system of M linear equations for unknown expansion coefficients cm in the form
The double potential integrals present in Eq. (5) require care in their numerical evaluation. Facets which are spatially close to one another (i.e., not considered well separated on the lowest level of the FMM octree) cannot be treated with the FMM. The close facets are those whose center-to-center distances are on the order (1-10 times) of a linear face size computed, for high-quality surface meshes, as the square root of the face area. The corresponding nearfield potential integrals are instead directly calculated and stored in the sparse nearfield BEM matrix using analytical integration for the inner integral and a Gaussian quadrature of 10th degree of accuracy for the outer integrals. The number of geometrical (based on Euclidian distance) neighbors in Eq. (5) may vary, but a relatively small number may be adequate. It must be noted that these geometrical neighbors may belong to different tissue compartments.
V. Application of General-Purpose Fast Multipole Method—Relevant to Step 308 and all Individual Steps 306, 310, 312, 314, 316, 318, 320, 322, 324
The general-purpose FMM and its most recent freeware distribution (Gimbutas et al. fmm3D Documentation. Release 0.1.0. 2019) is applied to compute all integrals of type defined by Eq. (5) except for neighbor integrals, using the center-point approximation at face centers rm, yielding
This problem is equivalent to finding the electric field at target points rm generated by the point charges located at source points rn. The accuracy of the FMM (the number of levels) is conventionally estimated for arbitrary volumetric charge distributions. However, for surface-based charge distributions, a much better relative accuracy is observed. For example, with the intrinsic method accuracy set as ε=0.1, the mean error for the pial cortical surface (GM shell) may be as low as 0.1% with respect to the electric field amplitude and 0.08 deg with respect to the field angle deviation as compared to the most accurate solution (i.e., the solution where FMM precision is set to maximum).
VI. The Method for Inclusion and Modeling Non-Nested (Non-Onion) Head Topology—Step 306
For the onion-like models, there should be none of coincident surfaces, because tissues of these models surround and enclose each other without touching—they are hollow shells, where each shell segments a boundary between exactly two tissue types.
For the non-nested models (an example is the MIDA model, Iacono et al, PLoS One 2015; 10(4). doi: 10.1371/journal.pone.0124126) however, the interior and exterior boundaries of every tissue are explicitly segmented. This means, for example, that the MIDA model's white matter and gray matter both independently segment their mutual boundary, producing a large number of duplicate facets. These duplicate facets would produce singularities that invalidate simulation results, so they are resolved as described below. The BEM-FMM approach theoretically allows to handle non-nested geometries since it uses only the local boundary condition Eq. (3) and does not uses integral transformations for manifold or closed surfaces like the second Green's identity. The practical method for doing so is proposed and tested as stated below.
If the surface is a 2-manifold object with no contact to other surfaces (a “nested” topology where each of the surfaces is associated with a single unique exterior compartment), n is simply the outer normal vector to the surface; σin is the conductivity inside the object; and σout is the conductivity of the surrounding medium. If two objects (1 and 2) are in contact with each other as shown in
The practical realization is as follows. For each pair of duplicate facets, one is designated the facet to be deleted, and the other is designated the facet to be kept. The outer conductivity of the facet to be kept is set equal to the inner conductivity of the facet to be deleted, and associated conductivity contrast information is updated for the facet to be kept. The facet to be deleted, and all associated information, is then removed from the model.
VII. The Method for Inclusion and Modeling Anisotropic Tissues Such as Skull or White Matter—Step 310
An anisotropic medium can be treated as a model of a realistic inhomogeneous medium with specifically oriented microinclusions: an example is given by white matter fiber. When an external electric field is applied, the microinclusions become polarized. This polarization is of a dipole nature—one part of the inclusion becomes positively charged while another part is charged negatively, with the total charge equal to zero. Therefore, we can replace the microinclusions by secondary dipoles densely and uniformly distributed in a volume. Those should be field-dependent dipoles, similar to the linear dependent sources in electrical engineering. When the external electric field is absent their strength (the dipole moment) will be equal to zero. Otherwise, the dipole moment will be proportional to the field. Three degrees of freedom (x-, y- and z-dipoles) should be made available at any spatial point to account for three local electric-field components as shown in
The strength of dependent dipole sources, say, in the x-direction is made proportional to (σx−σref)/(σx+σref) where σx is the component of the conductivity tensor in the x-direction, and σref is a reference conductivity. The reference conductivity maybe chosen as the largest component of the conductivity tensor.
The BEM-FMM is the preferred platform for the implementation since the number of dependent sources is practically unlimited if the fast multipole method is used to compute the combined effect of their electric fields.
The resulting system of integral equations can be solved iteratively, by updating the field of all dependent sources at every iteration step, and then computing the medium feedback due to this field. The method convergence is excellent.
This approach has been tested by comparison with a high-end commercial FEM software ANSYS Maxwell with adaptive mesh refinement. For highly anisotropic specimens with the top surface electrodes, it generates relative field/electric current errors below 5-10% in the entire volume for the uniformly-distributed dipole grid.
VIII. The Method for Modeling External (Scalp) and Internal (Intracortical Microstimulation) Voltage Electrodes—Steps 312, 316, 318
In TES/DBS/ICMS problems, the primary electric field Ep(r) in Eq. (4) is zero. However, voltage V is impressed at certain electrode surfaces Se. Voltage V may have different values for different electrodes. The electrode surfaces are considered as being a part of other closed surfaces, for example a part of the insulated lead surface. At the electrode surfaces, the Fredholm integral equation of the first kind is imposed instead of Eq. (4), that is
Furthermore, the conductivity contrast value is set to one at electrodes which corresponds to a very high metal (copper, platinum, or iridium) conductivity as compared to the conductivity of the surrounding tissues.
The surface charge density is expanded/discretized into pulse bases (zeroth-order basis functions) on triangular facets tm with area Am. The Galerkin method is then applied to Eq. (4) and Eq. (7), which gives a system of M linear equations for unknown expansion coefficients cm in the form
and N remaining linear equations for unknowns cm on the electrode surface in the form
Coupled Eqs. (8a) and (8b) are solved simultaneously using a proper weighting gm. Without this weighting, an iterative solution will diverge. The established weighting is as follows
This weighting is equivalent to the proper diagonal preconditioner for Eq. (8b).
As already described in [0034], the general-purpose FMM and its most recent freeware distribution (Gimbutas et al. fmm3D Documentation. Release 0.1.0. 2019) is applied to compute all double integrals of type defined by Eq. (8a) except for neighbor integrals. The same method is now applied to compute all double integrals of type defined by Eq. (8b) except for neighbor integrals using the center-point approximation at face centers rm, yielding
This problem is equivalent to finding the electric field at target points rm generated by the point charges located at source points rn. The accuracy of the FMM (the number of levels) is conventionally estimated for arbitrary volumetric charge distributions. However, for surface-based charge distributions, a much better relative accuracy is observed. For example, with the intrinsic method accuracy set as ε=0.1, the mean error for the pial cortical surface (GM shell) may be as low as 0.1% with respect to the electric field amplitude and 0.08 deg with respect to the field angle deviation as compared to the most accurate solution (i.e., the solution where FMM precision is set to maximum).
IX. The Method for Modeling External (Scalp) and Internal (Intracortical Microstimulation) Current Electrodes—Steps 312, 322, 324
The primary electric field Ep(r) in Eq. (4) is non-zero. It is impressed at certain electrode surfaces Se in the form of the impressed current Ie. The BEM-FMM solution of Eq. (4) is obtained with the primary field n(r)·Ep(r)=±Ie/(σeAe) impressed at the surfaces of the electrode and the reference electrode, respectively. Here, Ae is the electrode area and σe is the conductivity of the medium enclosing the electrode. For on-scalp electrodes, σe is the scalp conductivity.
X. Computing Neighbor Potential Integrals—Step 314
The double potential integrals present in Eqs. (8a) and (8b) require care. Facets which are spatially close to one another (i.e., not considered well separated on the lowest level of the FMM octree) cannot be treated with the FMM. These nearfield potential integrals are instead directly calculated and stored in the sparse nearfield BEM matrix using analytical integration for the inner integral and a Gaussian quadrature of 10th degree of accuracy for the outer integrals. The number of geometrical (based on Euclidian distance) neighbors in Eqs. (7) may vary, but a relatively small number (4-64) may be adequate. It must be noted that these geometrical neighbors may belong to different tissues.
XI. The Method for Improving the Convergence of the Iterative Solution Using the Charge Conservation Law—Steps 318, 324
The charge conservation law is not explicitly included in Eq. (4); it could be enforced in the form
∫Sp(r′)dr′=0 (Eq. 11)
In Eq. (11), S is now the combination of all interfaces. Proper implementation of Eq. (11) implies a direct summation of integral on the right-hand side of Eq. (11) with Eq. (4) with a certain weighting; it provides a significantly better and unconstrained convergence rate of the iterative solution as shown in
XII. The Method for Restoring Near-Surface Normal Electric Fields from the Computed Charge Distribution without Postprocessing and in No Time—Step 330
A significant advantage of the BEM-FMM approach established below is an ability to precisely obtain electric fields normal to the cortical surfaces (or any other interfaces) without additional computational cost or postprocessing. Only the solution for the surface charge density is necessary. After taking the scalar product of Eq. (2) with the surface normal vector n, Eq. (4) may then be substituted to explicitly find the normal electric field just inside the surface, n·Ein(r); the normal electric field just outside the surface, n·Eout(r); and the normal field discontinuity for any conducting interface, dn·E. All three quantities are directly proportional to each other. One has, for any conducting interface S and any observation point r∈S,
We should note that the normal component of the total E-field just inside/outside conductivity boundaries depends explicitly only on the induced surface charge density. For example, Eq. (12) immediately predicts that the normal component of the field just inside the outermost skin surface is always zero (there is indeed no current into air) since σout is equal to zero in the first expression of Eq. (12). However, both the surface charge density and the normal component of the field just outside the outermost surface are certainly different from zero.
As used herein in relation to computing, the term component is intended to be broadly construed as hardware, firmware, and/or a combination of hardware and software.
Program code, referred to herein as code or program code, is to be broadly interpreted to include text-based code that may not require further processing to execute (e.g., C or C++ code, Hardware Description Language (HDL) code, very-high-speed integrated circuits (VHSIC) HDL (VHDL) code, Verilog code, Java code, another type of hardware and/or software based code that may be compiled and/or synthesized, etc.), binary code that may be executed (e.g., executable files that may be directly executed by an operating system, bitstream files that may be used to configure an FPGA, Java byte code, object files combined together with linker directives, source code, makefiles, etc.), text files that may be executed in conjunction with other executables (e.g., Python text files, Octave files, MATLAB files, a collection of dynamic-link library (DLL) files with text-based combining, configuration information that connects pre-compiled modules, an extensible markup language (XML) file describing module linkage, etc.), graphical design models that may be executed in conjunction with other executables (e.g., LabView models, SystemVue models, Simulink models, Ptolemy models), source code (e.g., readable by a human), machine code (e.g., readable by a machine), or the like. In some implementations, program code may include different combinations of the above-identified classes of code (e.g., text-based code, graphical models, binary code, text files, source code, machine code, etc.). Additionally, or alternatively, program code may include code generated using a dynamically-typed programming language (e.g., the M language, a MATLAB® language, etc.) that may be used to express problems and/or solutions using mathematical notations. Additionally, or alternatively, program code may be of any type, such as a function, a script, an object, etc.
It will be apparent that system and/or methods, described herein, may be implemented in different forms of hardware, firmware, or a combination of hardware and software. The actual specialized control hardware or software code used to implement these systems and/or methods is not limiting of the implementations. Thus, the operation and behavior of the system and/or methods were described herein being understood that software and hardware can be designed to implement the systems and/or methods based on the description herein.
Even though particular combinations of features are recited in the claims and/or disclosed in the specification, these combinations are not intended to limit the disclosure of possible implementations. In fact, many of these features may be combined in ways not specifically recited in the claims and/or disclosed in the specification. Although each dependent claim listed below may directly depend on only one claim, the disclosure of possible implementations includes each dependent claim in combination with every other claim in the claim set.
No element, act, or instruction used herein should be construed as critical or essential unless explicitly described as such. Also, as used herein, the articles “a” and “an” are intended to include one or more items, and may be used interchangeably with “one or more.” Furthermore as used herein, the term “set” is intended to include one or more items, and may be used interchangeably with “one or more.” Where only one item is intended, the term “one” or similar language is used. Also, as used herein, the terms “has,” “have,” “having,” or the like are intended to be open-ended terms. Further, the phrase “based on” is intended to mean “based, at least in part, on” unless explicitly stated otherwise.
Headings used herein are intended as aids for readability and should not be used to interpret or construe aspects of the technology or claims.