A software toolkit for TMS electric-field modeling with boundary element fast multipole method: An efficient MATLAB implementation

Sergey N. Makarov*, William A. Wartman, Mohammad Daneshzand, Kyoko Fujimoto, Tommi Raij, Aapo Nummenmaa

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

9 Scopus citations


Objective. To present and disseminate our transcranial magnetic stimulation (TMS) modeling software toolkit, including several new algorithmic developments, and to apply this software to realistic TMS modeling scenarios given a high-resolution model of the human head including cortical geometry and an accurate coil model. Approach. The recently developed charge-based boundary element fast multipole method (BEM-FMM) is employed as an alternative to the 1st order finite element method (FEM) most commonly used today. The BEM-FMM approach provides high accuracy and unconstrained numerical field resolution close to and across cortical interfaces. Here, the previously proposed BEM-FMM algorithm has been improved in several novel ways. Main results. The improvements resulted in a threefold increase in computational speed while maintaining the same solution accuracy. The computational code based on the MATLAB® platform is made available to all interested researchers, along with a coil model repository and examples to create custom coils, head model repository, and supporting documentation. The presented software toolkit may be useful for post-hoc analyses of navigated TMS data using high-resolution subject-specific head models as well as accurate and fast modeling for the purposes of TMS coil/hardware development. Significance. TMS is currently the only non-invasive neurostimulation modality that enables painless and safe supra-threshold stimulation by employing electromagnetic induction to efficiently penetrate the skull. Accurate, fast, and high resolution modeling of the electric fields may significantly improve individualized targeting and dosing of TMS and therefore enhance the efficiency of existing clinical protocols as well as help establish new application domains.

Original languageEnglish (US)
Article number046023
JournalJournal of Neural Engineering
Issue number4
StatePublished - Aug 2020


  • boundary element fast multipole method (BEM-FMM)
  • cortical surface based analysis
  • high-resolution TMS targeting
  • high-resolution electric field modeling
  • navigated TMS
  • transcranial magnetic stimulation (TMS)

ASJC Scopus subject areas

  • Biomedical Engineering
  • Cellular and Molecular Neuroscience


Dive into the research topics of 'A software toolkit for TMS electric-field modeling with boundary element fast multipole method: An efficient MATLAB implementation'. Together they form a unique fingerprint.

Cite this