Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for...

16
Research Article An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation Edward T. Dougherty 1 and James C. Turner 2 1 Mathematics Department, Rowan University, Glassboro, NJ 08028, USA 2 Mathematics Department, Virginia Polytechnic Institute and State University, Blacksburg, VA 24061, USA Correspondence should be addressed to Edward T. Dougherty; [email protected] Received 28 May 2015; Revised 27 August 2015; Accepted 21 October 2015 Academic Editor: Camillo Porcaro Copyright © 2016 E. T. Dougherty and J. C. Turner. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Computational simulations of transcranial electrical stimulation (TES) are commonly utilized by the neurostimulation community, and while vastly different TES application areas can be investigated, the mathematical equations and physiological characteristics that govern this research are identical. e goal of this work was to develop a robust soſtware framework for TES that efficiently supports the spectrum of computational simulations routinely utilized by the TES community and in addition easily extends to support alternative neurostimulation research objectives. Using well-established object-oriented soſtware engineering techniques, we have designed a soſtware framework based upon the physical and computational aspects of TES. e framework’s versatility is demonstrated with a set of diverse neurostimulation simulations that (i) reinforce the importance of using anisotropic tissue conductivities, (ii) demonstrate the enhanced precision of high-definition stimulation electrodes, and (iii) highlight the benefits of utilizing multigrid solution algorithms. Our approaches result in a framework that facilitates rapid prototyping of real-world, customized TES administrations and supports virtually any clinical, biomedical, or computational aspect of this treatment. Soſtware reuse and maintainability are optimized, and in addition, the same code can be effortlessly augmented to provide support for alternative neurostimulation research endeavors. 1. Introduction Transcranial electrical stimulation (TES) is a collection of noninvasive neurostimulation techniques that strategically modulate activity in regions of the brain with low magnitude electric current delivered through electrodes positioned on the scalp surface. Forms of TES include the commonly used transcranial direct current stimulation (tDCS), as well as transcranial alternating current stimulation (tACS) [1]. Recently, the use of numerous smaller sized electrodes, termed high-definition tDCS (HD-tDCS), has emerged as a form of TES that enhances electrical current focality [2, 3]. Clinical and biomedical research continue to demonstrate the capabilities of TES as a medical treatment. For example, Alzheimer and Parkinson’s disease patients have demon- strated increased memory abilities [4–6]. In addition, TES has shown to alleviate symptoms of psychiatric disorders including depression [7, 8] and schizophrenia [9–11]. e efficacy and comprehension of TES have been enhanced with mathematical modeling and computational simulation. In particular, simulations can compute the cur- rent density distribution for a given patient and TES appa- ratus configuration [1, 12–15] and have demonstrated the importance of modulating treatment stimulation dosage [16]. Other simulations have illustrated the importance of incor- porating anisotropic tissue conductivity data [17, 18], and numerical studies aid in identifying the computational solu- tion methods most efficient in simulating TES mathematical models [19]. Object-oriented design is a soſtware design approach that defines objects, which are simply soſtware entities that encapsulate data and functionality and the relationships among objects. Features of object-oriented design can be utilized to maximize code reusability, simplify soſtware main- tenance, and promote application versatility [20]. e preva- lence of object-oriented design in scientific and biomedical Hindawi Publishing Corporation Journal of Computational Medicine Volume 2016, Article ID 9826596, 15 pages http://dx.doi.org/10.1155/2016/9826596

Transcript of Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for...

Page 1: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

Research ArticleAn Object-Oriented Framework for Versatile FiniteElement Based Simulations of Neurostimulation

Edward T Dougherty1 and James C Turner2

1Mathematics Department Rowan University Glassboro NJ 08028 USA2Mathematics Department Virginia Polytechnic Institute and State University Blacksburg VA 24061 USA

Correspondence should be addressed to Edward T Dougherty doughertyerowanedu

Received 28 May 2015 Revised 27 August 2015 Accepted 21 October 2015

Academic Editor Camillo Porcaro

Copyright copy 2016 E T Dougherty and J C Turner This is an open access article distributed under the Creative CommonsAttribution License which permits unrestricted use distribution and reproduction in any medium provided the original work isproperly cited

Computational simulations of transcranial electrical stimulation (TES) are commonly utilized by the neurostimulation communityand while vastly different TES application areas can be investigated the mathematical equations and physiological characteristicsthat govern this research are identical The goal of this work was to develop a robust software framework for TES that efficientlysupports the spectrum of computational simulations routinely utilized by the TES community and in addition easily extends tosupport alternative neurostimulation research objectives Using well-established object-oriented software engineering techniqueswe have designed a software framework based upon the physical and computational aspects of TES The frameworkrsquos versatilityis demonstrated with a set of diverse neurostimulation simulations that (i) reinforce the importance of using anisotropic tissueconductivities (ii) demonstrate the enhanced precision of high-definition stimulation electrodes and (iii) highlight the benefitsof utilizing multigrid solution algorithms Our approaches result in a framework that facilitates rapid prototyping of real-worldcustomized TES administrations and supports virtually any clinical biomedical or computational aspect of this treatment Softwarereuse and maintainability are optimized and in addition the same code can be effortlessly augmented to provide support foralternative neurostimulation research endeavors

1 Introduction

Transcranial electrical stimulation (TES) is a collection ofnoninvasive neurostimulation techniques that strategicallymodulate activity in regions of the brain with low magnitudeelectric current delivered through electrodes positioned onthe scalp surface Forms of TES include the commonlyused transcranial direct current stimulation (tDCS) as wellas transcranial alternating current stimulation (tACS) [1]Recently the use of numerous smaller sized electrodestermed high-definition tDCS (HD-tDCS) has emerged as aform of TES that enhances electrical current focality [2 3]Clinical and biomedical research continue to demonstratethe capabilities of TES as a medical treatment For exampleAlzheimer and Parkinsonrsquos disease patients have demon-strated increased memory abilities [4ndash6] In addition TEShas shown to alleviate symptoms of psychiatric disordersincluding depression [7 8] and schizophrenia [9ndash11]

The efficacy and comprehension of TES have beenenhanced with mathematical modeling and computationalsimulation In particular simulations can compute the cur-rent density distribution for a given patient and TES appa-ratus configuration [1 12ndash15] and have demonstrated theimportance of modulating treatment stimulation dosage [16]Other simulations have illustrated the importance of incor-porating anisotropic tissue conductivity data [17 18] andnumerical studies aid in identifying the computational solu-tion methods most efficient in simulating TES mathematicalmodels [19]

Object-oriented design is a software design approachthat defines objects which are simply software entities thatencapsulate data and functionality and the relationshipsamong objects Features of object-oriented design can beutilized tomaximize code reusability simplify softwaremain-tenance and promote application versatility [20] The preva-lence of object-oriented design in scientific and biomedical

Hindawi Publishing CorporationJournal of Computational MedicineVolume 2016 Article ID 9826596 15 pageshttpdxdoiorg10115520169826596

2 Journal of Computational Medicine

applications began in the 1990s and its use has dramaticallyincreased due to its advantages over procedural softwareimplementations [21ndash26] In particular mathematical andphysical attributes of a model can be naturally representedwith objects [27 28]

A common approach for simulating partial differentialequation (PDE) basedmathematical models is to use prebuiltsimulation software programs These ldquoblack-boxesrdquo can sim-plify model implementation however there are limitationswith this approach A researcher is often confined to thenumerical algorithms and programming controls offered bythe simulation program it can be very difficult or perhapsnot possible to incorporate numerics and solution tech-niques not supported by the software In addition integratinga prebuilt software application with external data sources andapplications can be very challenging which obstructs the useof its simulations within larger software solutions

An alternative strategy is to create custom softwarethat utilizes numerical application programming interfaces(APIs) While this approach generally takes longer to imple-ment it allows the use of problem-specific algorithms andprogramming logic that facilitate accurate and expedientsimulation results [28] Coupling this philosophywith object-oriented software engineering techniques can produce a finalproduct that is versatile expandable and computationallyefficient Interactions with external systems can be seamlesslyintegrated and the ability to compile the software to exe-cutable machine code simplifies its deployment to alternativehardware platforms for example medical imagingmachines

In this paper we present an object-oriented softwareframework for finite element basedTES simulationsMultiplefeatures of object-oriented design and programming areutilized to create a modular software architecture that encap-sulates medical mathematical and computational attributesof TESThe result is a program thatmaximizes code reuse andTES simulation versatility We demonstrate this versatilitywith several simulations each with a distinct TES researchfocus These simulations utilize MRI-derived three-dimen-sional headmodels with physiologically based tissue conduc-tivities and real-world electrode configurations Finally weshowhow the same software can be easily extended to addressalternative neurostimulation research areas such as deepbrain stimulation (DBS) In addition all components of theframework are available to the community as a supplementto this paper

2 Materials and Methods

21 Governing Equations The electric current density withinthe head and brain fromneurostimulation can bemodeled bythe Poisson equation namely minusnabla sdotMnablaΦ = 119891() where Φ isthe electric potentialM is the tissue conductivity tensor and119891() is a given electrical source term For isotropic mediumsM can be represented as a scalar which varies for differenttissue types

Electric current delivered by TES anode electrode(s) isgiven by the nonhomogeneous Neumann boundary condi-tion sdotMnablaΦ = 119868() where 119868() represents the stimulationcurrent density and is the outward boundary normal vector

Cathode electrode(s) are represented by the homogeneousDirichlet condition Φ() = 0 All other points on the skinsurface are insulated by the surrounding air thus sdotMnablaΦ = 0

Our governing equations are as follows

minusnabla sdotMnablaΦ = 119891 () isin Ω (1a)

Φ = 0 isin 120597Ω

119862 (1b)

sdotMnablaΦ = 119868 () isin 120597Ω119860 (1c)

sdotMnablaΦ = 0 isin 120597Ω119878 (1d)

where Ω is the head volume 120597Ω119860and 120597Ω

119862represent the

areas on the scalp covered by anode and cathode electrodesrespectively and 120597Ω

119878is the remaining portion of the head

surface Note that for TES simulations there is no sourceterm within the volume and so 119891() = 0 (1a) AlternativelyDBS is realized with an appropriate definition of119891() and thehomogeneous Neumann boundary condition (1d) applied tothe entire boundary namely 120597Ω

119904= 120597Ω [29]

The associatedweak formulation (seeAppendix) is to findΦ() isin 119867

1

0(Ω) given 119891() isin 119871

2(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(2)

where

119867

1

0(Ω) = 119906 | 119906 isin 119867

1(Ω) 119906 = 0 forall isin 120597Ω119862

119867

1(Ω) = 119906 | 119906 isin 1198712 (Ω)

120597119906

120597119909

119894

isin 119871

2 (Ω)

119871

2 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(3)

22 Framework Design The fundamental task in the designof the framework was to create objects based on attributesof TES and TES simulations We refer to [30] for a detailedexplanation of object-oriented design and provide just a briefoverview of the key aspects utilized within our framework

Objects encapsulate data and functions that operate onthe data A class provides the description of an object type bydefining variable and function names and an object is moreformally viewed as a specific instance of a class Inheritanceis a class relationship and provides the ability to extend thefunctionality of a class with a so-called subclass A subclasscan contain data and functionality from a parent class and candefine its own as well Inheritance is a major object-orienteddesign concept that exploits code reuse since all subclassescan reuse data constructs and functions from a parent classPolymorphism enables a subclass to give specific functionalityto an abstract function defined by a parent class This pow-erful technique allows parent classes to encapsulate genericand broad ideas by delegating specific function implementa-tions to subclasses [30]

We required that electrode configuration stimulationparameters tissue conductivity information computational

Journal of Computational Medicine 3

Conductivity

Matlab_Data_Conductivity

FEM

TES

TES_MG

Electrode

Source

TES_Source middot middot middot DBS_Source

Tissue conductivity properties PDE solver Neurostimulation modality

Figure 1 Software architecture and main classes in the object-oriented TES simulation framework Classes are represented with boxes andarrow and diamond tipped lines represent inheritance and aggregation respectively

domain and numerical solution methods be specified via aninput file This permits customized TES simulations withoutthe need to rewrite and recompile code In addition bymathematically retaining the source term 119891() in the weakformulation (2) and allowing this function to be defined bya user different neurostimulation modalities for exampleDBS can be simulated

We choose to base our framework design on Diffpack[31] which is a numerical API library for solving PDEs It isbased on the C++ programming language [32] and possessesa vast collection of PDE solution algorithms [27 28]TheC++language incorporates well-established software engineeringpractices [33] and is compiled to machine code resulting infast execution speeds and portability to alternative hardwareplatforms Despite our use of a specific numerical libraryand programming language the object-oriented design andimplementation strategies presented in this paper apply toany programming language and API package that supportsan object-oriented approach

Figure 1 displays the main software components in theTES simulation framework Each box represents a class andeach arrow and diamond tipped line represents inheritanceand aggregation respectively FEM is a class in the Diffpacklibrary that offers fundamental finite element method datastructures and algorithms Class TES which is the corner-stone of the framework inherits FEM functionality to solvesimulations given by system (1a)ndash(1d) Class TES MG extendsTES functionality so that multigrid (MG) algorithms can alsobe utilized in solving this system

For TES simulations to be fully realized tissueconductivity and electrode information are needed Theseideas have been encapsulated with respective classes andTES possesses instances of each Since conductivity data cancome from a variety of sources with differing storage formatsthe Conductivity class merely defines abstract functionnames that are viewed as common to all conductivity datasources Then specific functionality for specific conductivitydata sources is implemented in subclasses for example

Matlab Data Conductivity via polymorphism Thisapproach allows different conductivity data sources to beincorporated into the framework without needing to modifycode in the TES and Conductivity classes The boundaryconditions are also managed by TES using information fromclass Electrode which maintains TES electrode locationand size information In addition by retaining the sourceterm 119891() in the weak formulation (2) and encapsulating itas a class namely Source assignments to 119891() enable thesimulation of alternative types of neurostimulation such asDBS

23 Framework Implementation In this section key soft-ware implementation aspects of the framework and relatedDiffpack concepts are described For a complete guide toDiffpack see [27]

231 Tissue Conductivity Class Conductivity defines gen-eral function names but delegates the implementation ofthese functions to its subclasses (Code 1) MatlabConduc-tivity inherits Conductivity and provides specific imple-mentations of the loadConductivities and getConduc-tivity functions based on a Matlab [34] binary data fileformat produced by the SimNIBS software package [35]

Two additional datamembers are defined by MatlabCon-ductivity namely a MatlabHelper object mh whichmanages a runtime interface with the MatlabEngine [34]and a Matlab matrix ct These two members are neededby the MatlabConductivity subclass not the parentConductivity class and are therefore included in onlythe subclass The MatlabConductivity implementation ofthe loadConductivities function simply creates a Matlabcommand to load the anisotropic conductivity data sourceexecutes this command within the MatlabEngine via the mhobject and then stores the anisotropic conductivity tensordata into the ctmatrix which are then accessible throughouta TES simulation via the getConductivity function (Code1)

4 Journal of Computational Medicine

class Conductivity

Conductivity()

virtual simConductivity()

Load tensor conductivities from data files

virtual void loadConductivities (Stringamp fileName)

Get ith component of conductivity tensor at pt (xyz)

virtual double getConductivity (int i int x int y int z)

class MatlabConductivity public Conductivity

MatlabConductivity()

virtual simMatlabConductivity()

Inherited from Conductivity

virtual void loadConductivities(Stringamp fileName)

virtual double getConductivity(int i int x int y int z)

MatlabHelper mh Mangage interface with the MatlabEngine

mxArray ct Matrix with conductivity tensor data

void MatlabConductivityloadConductivities(Stringamp fileName)

String name = load( + fileName + )engEvalString(mh-gtep namec str())

ct = engGetVariable(mh-gtep ct)

Code 1 Class definitions for tissue conductivity data Class Conductivity provides general function names that is loadConductivitiesand getConductivity The MatlabConductivity subclass implements these functions for a particular data source For example itsloadConductivities function loads a Matlab anisotropic conductivity data source into the ctmatrix for use in a simulation

The Conductivity-MatlabConductivity relation-ship demonstrates the advantages of object-oriented inher-itance and polymorphism Conductivity is used to definefunction names common to all conductivity data sourcesand serves as the bridge between these repositories and theframework Polymorphism permits the MatlabConductiv-ity subclass to implement specific loadConductivitiesand getConductivity functionality for its particular dataformat Code within the Conductivity class and all otherframework classes does not dependent on these subclassimplementations Thus alternative conductivity data sourcescan be easily incorporated into the framework as a subclassof Conductivity in an identical fashion requiring nomodification to any other framework component

232 Source Term Class Source is a software abstractionof the 119891() source term (1a) and like Conductivity definesbasic functionality to be implemented in subclasses (Code 2)Source inherits the Diffpack class FieldFunc which allowsa scalar function to be defined over the domain Differentsubclass implementations of the valuePt function can beused to model different neurostimulation modalities ForTES valuePt in class TES Source simply returns zero since119891() = 0 in this case (Code 2)

Main TES ClassClass TES is themain class in the frameworkCode 3 presents the key elements of this class which containsnumerous objects functions and Diffpack concepts ClassTES inherits the Diffpack FEM class giving it access to finiteelement data structures and functionality Handle objectswhich are pointers in Diffpack that includememorymanage-ment features are defined for the computational grid gridand electric potential and current density solution results uand currDensity respectively

Several other class members are needed to implementTES simulations Variables to store boundary condition val-ues are included as well as the anodes and cathodes vectorsto store electrode information The vector isoSigma andmatrix sigma store isotropic and anisotropic conductivitydata and the choice of conductivity representation is deter-mined by a user via the isotropic boolean variable Themc data member is a reference to the Conductivity classproviding an interface to conductivity data Note that mc istype Conductivity and not MatlabConductivity Themc object can therefore use the loadConductivitiesand getConductivity functions of any Conductivitysubclass including MatlabConductivity This designapproach allows new Conductivity subclasses to be definedand utilized without the need to modify code in class TES

Journal of Computational Medicine 5

class Source public FieldFunc

TES data Provides access to TES class members

Source ()

virtual dpreal valuePt Source term value at pt x Abstract function

(const Ptv(dpreal)amp x dpreal t = DUMMY) = 0

dpreal TES Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

return val

Code 2 Source term class definitions The TES Source subclass of Source enables TES simulations by defining its valuePt function toreturn a value of zero at all points

class TES public FEM

DATA TYPES

Handle(GridFE) grid Underlying finite element grid

Handle(FieldFE) u Electric potential over grid

Handle(FieldsFE) currDensity Electric Current density over grid

dpreal dirichlet val1 Constant phi value at a boundary

dpreal dirichlet val2 Constant phi value at boundary

dpreal robin U0 Constants for Neumann boundary condition

vectorltElectrodegt anodes Anode electrodes

vectorltElectrodegt cathodes Cathode electrodes

bool isotropic Isotrpoic or anisotropic bool control

Vec(dpreal) isoSigma Isotropic brain tissue conductance values

MatSimple(dpreal) sigma Anisotropic conductivity tensor matrix

Conductivity mc Interface class for anisotropic conductivities

Handle(FieldFunc) source Source term for initializing f(x)

Handle(FieldFunc) alternatingStim Object to model non-direct TES ie tACS

FUNCTIONS

Standard finite element functions inherited from class FEM

virtual void fillEssBC () Set dirichlet boundary conditions

virtual void calcElmMatVec Compute FE coefficient matrix and load vector

(int e ElmMatVecamp elmat FiniteElementamp fe)

virtual void integrands Implement weak formulation integrand

(ElmMatVecamp elmat const FiniteElementamp fe)

virtual void integrands4side Neumann boundary integral

(int side int boind ElmMatVecamp elmat const FiniteElementamp fe)

Code 3 Main elements within the TES class Handles are Diffpack pointers that include memory management features The class definitioncontains a Handle for the computational grid (grid) and electric potential (u) and current density (currDensity) solution results Nextvariables store boundary condition values and anode (anodes) and cathode (cathodes) electrode information Support for both isotropicand anisotropic conductivity data is provided as well as functions for source and nonconstant anode stimulation Functions inherited fromFEM are required to perform finite element calculations

6 Journal of Computational Medicine

void TES integrands (ElmMatVecamp elmat const FiniteElementamp fe)

int ijq Loop control variables

const int nbf = fegetNoBasisFunc() no of nodesbasis functions

dpreal detJxW = fedetJxW() Numerical integration weight

const int nsd = fegetNoSpaceDim() Number of spatial dimensions

Get conductivity tensor for the current element

updateConductivityTensors(fe)

Get a point in the global domain represented by elemnt fe

Ptv(NUMT) x(nsd)

fegetGlobalEvalPt(x)

Get the source term f(x) for this element

dpreal f val

if (sourceok())

f val = source-gtvaluePt(x)

else f val = 0

Compute weak formulation

dpreal gradNi gradNj

for (i = 1 i lt= nbf i++)

for (j = 1 j lt= nbf j++)

gradNi gradNj = 0

for (q = 1 q lt= nsd q++)

Compute inner product of grad(N i) and grad(N j)

gradNi gradNj += sigma(qq) fedN(iq) fedN(jq)

Update linear system coefficient matrix

elmatA(ij) += gradNi gradNjdetJxW

Update linear system RHS (load vector)

elmatb(i) += feN(i)f valdetJxW

Code 4 TES class integrands function for computing weak formulation volume integrals Conductivity and source term values for finiteelement fe are retrieved with calls to the updateConductivityTensors and source valuePt functions Finite element basis functions arethen iterated to compute the volume integrals

There is also a reference to a Source object for exampleTES Source as well as a field function for nonconstantstimulation currents for example tACS Finally TES inheritsfunctions from FEM to perform finite element computationsincluding fillEssBC to set Dirichlet boundary conditionscalcElmMatVec to assemble the finite element linear systemcoefficient matrix and load vector and the integrands andintegrands4side functions to evaluate the weak formula-tion volume and boundary integrals respectively

233 Weak Formulation Integration The weak formulationvolume integrals (2) are computed in the TESintegrandsfunction (Code 4) The Diffpack linear system assemblerautomatically calls this function as it iterates over thefinite elements in the computational grid Conductivityvalues for the current element are attained with a call to

the updateConductivityTensors function which deter-mines if isotropic or anisotropic conductivities are desiredand then populates the sigmamatrix accordingly

The source term 119891() over the current element isretrieved via a call to the valuePt function in a Source classThen the finite element basis functions for this element areiterated over and the weak formulation is computed Notethat in this implementation sigma is assumed to be diag-onal however this can be generalized with the incorporationof an additional loop Finally the coefficient matrix A andload vector b are updatedThe boundary integral in theweakformulation is computed similarly in the integrands4sidefunction and its contribution is incorporated into b

234 Multigrid Multigrid is a linear system solution algo-rithm that utilizes multiple computational grid resolutions to

Journal of Computational Medicine 7

class TES MG public TES

int no of grids

Handle(MGtools) mgtools

Set boundary condtion on grid level specified by space

virtual void mgFillEssBC (SpaceId space)

Code 5 New members of TES MG class definition The mgtools object references the Diffpack multigrid toolbox The no of grids integerstores the number of MG grid levels and the mgFillEssBC function sets the essential boundary condition on all grid levels

(a) Head surface (b) Brain region (c) View of sagittal cross section

Figure 2 Computational domain used in numerical simulations

achieve fast solution convergence [36] By performing justa few iterations on each grid and then changing betweenfiner and coarser grids large portions of the error areefficiently removed [37] In addition as a preconditioner tothe commonly used conjugate gradient (CG) method MG ishighly effective at solving linear systems that result fromfiniteelement based TES simulations [38] Two commonly usedMG cycles are the V-cycle and the W-cycle and identifyingthe optimal cycle type for a given PDE system in addition tootherMGparameters including the number of grid levels canbe challenging [38]

As a subclass of TES very few new data members andfunctions are needed in TES MG (Code 5) since the entiretyof TES is efficiently reused The new members in TES MGare a reference to the Diffpack multigrid toolbox mgtoolsand an integer representing the number of MG grid levelsno of grids Finally just one new function mgFillEssBCis needed to set the essential boundary condition (1b) on allgrid levels

24 Computational Tools Numerical simulations were per-formed on a three-dimensional mesh (Figure 2) generatedfrom human MRI images by the SimNIBS software package[35] The mesh contains the skin skull cerebral spinal fluid(CSF) gray matter (GM) and white matter (WM) tissues ofthe head Gmsh [39] enabled mesh visualization identifica-tion of electrode coordinates and grid conversion to a formsupported by Diffpack Electric potential and current densityresults were exported from Diffpack and visualized withParaView [40] and gnuplot [41] Anisotropic conductivitydata for theGMandWMregions are provided by SimNIBS in

a Matlab binary data file these data are accessed by theMatlabEngine [34] via the MatlabHelper object of theMatlabConductivity class (Code 1)

25 Computational Simulations Multiple simulations wereperformed with the TES framework Simulations wereselected to demonstrate the frameworkrsquos versatility and abilityto target medical biophysical and computational researchobjectives Finally to illustrate how alternative forms ofneurostimulation can be simulated with the same softwarewe show a trivial extension to the framework that enablessupport for DBS applications

Simulation 1 (comparison of isotropic and anisotropic con-ductivity data) Previous research suggests that incorporatinganisotropic rather than isotropic brain tissue conductivitydata is important formost accuratelymodeling TES electricalcurrent distribution [17 42] To evaluate the impact thatthese two conductivity representations have on simulationresults TES simulations were performed with isotropic andanisotropic data The three-dimensional domain shown inFigure 2 was used with approximately 28 million lineartetrahedra finite elements

Anode and cathode electrodes were positioned at C3 andC4 [43] respectively each with a surface area of approx-imately 16 cm2 and the anode electric current magnitudewas set to 10mA This montage has been used to stimulatethe motor cortex ipsilateral to the C3 anode electrode [4445] First isotropic electrical conductivities were assigned todifferent tissues skin = 0465 skull = 0010 CSF = 1654GM = 0276 and WM = 0126 each with units (Sm) [46]

8 Journal of Computational Medicine

05mm05mm05mm10mm

075mm

minus

+

Figure 3 Simulation 4 DBS electrode positioning (subthalamic nucleus) and dimensions Anode and cathode contacts are denoted with ldquo+rdquoand ldquominusrdquo symbols respectively

Then anisotropic conductivity data were used via theMatlabConductivity class as previously described (seeCode 1)

Simulation 2 (comparison of tDCS and HD-tDCS electrodemontages) High-definition TES electrodes have demon-strated a greater ability to focus its electrical current on atargeted brain region than traditional tDCS which uses twolarger electrodes [2 3] Using the same computational gridas Simulation 1 the current densities produced by tDCS andHD-tDCS were compared

For tDCS the anodewas positioned over C3 and the cath-ode over the contralateral supraorbital each with a surfacearea of approximately 16 cm2 In comparison high-definitionelectrodes each circular with a 12mm diameter were posi-tioned according to a 4 times 1 configuration a single anode waspositioned over C3 and four cathodes were placed approxi-mately 5 cm radially from the anode forming a square Bothof these montages are known to target the motor cortexregion ipsilateral to the anode electrode [15 47ndash50] Anodestimulation strength for each simulation was once again10mA and both utilized anisotropic conductivities

Simulation 3 (comparison of finite element linear systemsolvers) Finite element based simulations of TES requirethe solution of large systems of linear equations which canbecome a computational bottleneck for simulations per-formed on very fine meshes Therefore the effectiveness ofa TES simulation is directly related to the efficiency of thechosen linear solverTheCGmethod is ideal for solving theselinear systems and appropriate preconditioning can rapidlyaccelerate numerical results [36 38]

The numerical efficiency of the preconditioned CGmethod was evaluated with TES simulations on the three-dimensional volume mesh (Figure 2) with approximately

29 million linear tetrahedra finite elements and roughly 51million unknowns The anode was positioned at CZ with astimulation strength of 10mA and the cathode at OZ [12 51]Simulations were performed with the CG method precon-ditioned with symmetric successive overrelaxation (SSOR)relaxed incomplete LUdecomposition (RILU) andmultigridThe RILU relaxation parameter was set to 05 [27] The MGpreconditioner was simulated with a V-cycle with both twoand three grid levels and aW-cycle with three grid levelsTherelative residual convergence tolerance was set to 10minus8 for allnumerical experiments

Simulation 4 (impact of conductivity representation onDBS simulation results) The importance of incorporatinganisotropic conductivities in TES simulations suggests thataccurately simulating other neurostimulationmodalitiesmaydepend on this conductivity representation as well In thisnumerical experiment we compared DBS simulation resultsusing both isotropic and anisotropic conductivities A singleelectrode was positioned in the subthalamic nucleus (STN)the most commonly targeted location for DBS [52] The elec-trode is a simplified version of the Medtronic (Model 3387)electrode used in humans [53] The lower 50mm of the elec-trode was modeledThe anode is positioned 10mm from theelectrode tip and the cathode is separated by 05mm from theanode Both the anode and cathode are 05mm in height andthe overall electrode diameter was set to 075mm (Figure 3)The anode and cathode metal contacts were modeled asconductors by setting the electrical conductivities of theseregions to 106 (Sm) and the remaining electrode shaft wasmodeled as an insulator with conductivity equal to 10minus6 (Sm) [54] Because DBS electric current is proximal to the elec-trode [29 55] a 100mm times 40mm times 40mm subset of tissuearound the electrode was considered as the computationaldomain

Journal of Computational Medicine 9

class DBS Source public Source

DBS Source(TES data)

virtual dpreal valuePt(const Ptv(dpreal)amp x dpreal t = DUMMY)

dpreal DBS Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

if (4625 lt= x(1) ampamp x(1) lt= 5375 ampamp

4625 lt= x(2) ampamp x(2) lt= 5375 ampamp

3500 lt= x(3) ampamp x(3) lt= 4000 )

val = 0001

Code 6 DBS Source class definition and sample code from its valuePt function

00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(a) Isotropic conductivities00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(b) Anisotropic conductivities

Figure 4 Simulation 1 current density results viewed from above with the nasion facing up Anode was placed at C3 and cathode at C4

To simulate DBS with the existing TES software frame-work no existing code required modification Rather theonly addition was a new subclass of class Source that defines119891() (1a) for DBS in total less than ten lines of codewere added Code 6 displays this new subclass definitionSource DBS and highlights of its valuePt function imple-mentation which in this simplified scenario simply injects10mA of current from the anode contact into the surround-ing tissue In practice DBS stimulations are time-varyingpulses and differing stimulation frequencies impact GM andWM tissue conductivities [56] However when examiningelectric field dispersion around a DBS electrode as in thissimulation a constant-valued source term in (1a) can beutilized [57]

3 Results and Discussion

31 Simulation 1 Electric current density results on thesurface of the brain tissue are displayed in Figure 4 Viewing

perspective is from above the head with the nasion facingup As expected the largest electric current density valuesare attained near the anode and cathode locations Despitean overall similar pattern of electric current distribution thesimulated current densities particularly in the motor cortexipsilateral to the anode electrode are significantly differentbetween the isotropic and anisotropic simulations For exam-ple the maximal anisotropic current density value (0434 (Am2)) is approximately 182 higher than in the isotropic case(0367 (Am2)) Similar discrepancies are observed through-out the top surface of the brain including a substantialimpact on the paracentral lobule contralateral to the anodeIn addition these discrepancies extend to the GM and WMinteriors These results reinforce the importance of usinganisotropic conductivities to most accurately model TESadministrations and in addition showcase the capabilities ofthe object-oriented framework to support both isotropic andanisotropic TES simulations

10 Journal of Computational Medicine

Elec

tric

pot

entia

l (V

)

00

005

010

015

(a) tDCS electric potential00

0015

003

0045

Elec

tric

pot

entia

l (V

)

(b) HD-tDCS electric potential

00

015

030

045

Curr

ent d

ensit

y (A

m2)

(c) tDCS electric current density00

0033

0067

01

Curr

ent d

ensit

y (A

m2)

(d) HD-tDCS electric current density

Figure 5 Simulation 2 electric potential and current density results The tDCS montage positioned the anode at C3 and the cathode overthe contralateral supraorbital A 4 times 1 configuration was used for HD-tDCS with a single anode positioned over C3

32 Simulation 2 Electric potential and electric currentdensity results are displayed in Figure 5 The tDCS montageresults in a noticeably larger range of electric potential values(Figures 5(a) and 5(b)) However the focus of the tDCScurrent density on the targeted region in this case the motorcortex under C3 is much less than the HD-tDCS electrodemontage (Figures 5(c) and 5(d)) Specifically the brain tissueoutside of the square formed by the HD-tDCS cathodesis virtually unstimulated whereas tDCS results in a muchgreater electric current dispersion

One limitation of this HD-tDCS electrode arrangementis the lower concentration of electric current that reaches thebrain tissue Specifically the maximal electric current densityin the brain fromHD-tDCS is just approximately 23 of thatachieved with traditional tDCS The culprit for this effect isthe shunting of the electric current around the poorly con-ducting skull the HD-tDCS montage used in this simulationyields a minuscule amount of current that penetrates theskull to reach the CSF and brain tissues (Figure 6) Potentialremedies for this behavior are a greater anode stimulation orpositioning the cathodes at greater distances from the anode[3]

This simulation demonstrates the frameworkrsquos ability tosupport varying TES electrode montages including high-definition electrode configurations Results of this simulation

Curr

ent d

ensit

y (A

m2)

00

05

10

15

Figure 6 Simulation 2 HD-tDCS electric current density Crosssection is through two diagonally positioned cathodes

corroborate that HD-tDCS offers greater electric currentfocality however its net stimulation of brain tissue is poten-tially much lower than tDCS

33 Simulation 3 Electric potential and current densityresults on the head surface are displayed in Figure 7 Viewing

Journal of Computational Medicine 11

00

004

008

012

Elec

tric

pot

entia

l (V

)

(a) Electric potential00

05

10

15

20

Curr

ent d

ensit

y (A

m2)

(b) Current density

Figure 7 Simulation 3 electric potential and current density results viewed from the back of the head The anode was positioned at CZ andthe cathode at OZ

perspective is frombehind the head and as anticipatedmaxi-mal andminimal electric potential and current density valuesoccur at the anode and cathode respectivelyThe shunting ofthe electric current around the skull due to its low electricalconductivity results in the segregated current density patternaround the anode and cathode centers (Figure 7(b)) Thisphenomenon has been previously observed [1] however itis highlighted by the very fine mesh resolution used in thissimulation

Figure 8 displays convergence history curves and perfor-mance metrics for each CG preconditioning strategy Withno preconditioning the CG method will eventually conver-gence but will accomplish this extremely slowly requiringmore than 6 hours to solve the linear system The SSORand RILU preconditioners demonstrate comparable perfor-mances both in solution time and number of iterationsMultigrid preconditioning with two grid levels has far feweriterations with 166 than both SSOR and RILU and yet has agreater run time This observation can be explained by thefact that a single iteration of MG has embedded iterationson the different mesh refinements [37] However three-grid-level MG noticeably accelerates convergence rates with boththe V- and W-cycles outperforming the other precondition-ers Three-grid-level MG with a W-cycle pattern has slightlyfewer iterations than its corresponding V-cycle yet this V-cycle preconditioner is approximately 113 faster

The ability of the framework to support numerically ori-ented TES research is presented in this simulation exampleThe results indicate that the CG method combined with anappropriately configured MG preconditioner is highly effi-cient in solving the linear systems produced in TES compu-tational simulations

34 Simulation 4 Figure 9 displays the electric currentdensities produced by the DBS electrode using isotropic(Figure 9(a)) and anisotropic (Figure 9(b)) conductivitiesIn both cases the majority of the current density is prox-imal to the electrode indicating that accurate placementof electrodes in DBS procedures is paramount [56] While

1

0

minus1

minus2

minus3

minus4

minus5

minus6

minus7

minus8

minus9

Iterations0 100 200 300 400 500 600 700 800 900

SSORRILUMG 2-V

MG 3-VMG 3-W

log10(r

elat

ive r

esid

ual)

(a) Convergence history

Preconditioner Iterations Time (min)NoneSSORRILUMG 2-grid V-cycleMG 3-grid V-cycleMG 3-grid W-cycle

gt5000 gt360

860

885

166

113

106

1134

1175

1264

574647

(b) Numerical iterations and linear system solve time Boldfacevalues indicate best convergence results

Figure 8 Convergence performances of the preconditioned conju-gate gradient methods

themaximal current densities of the isotropic and anisotropicscenarios are similar other differences between them areobservable First the current density around the electrodeis nonsymmetric in the anisotropic case as is expectedwith directionally dependent conductivity data In addition

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 2: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

2 Journal of Computational Medicine

applications began in the 1990s and its use has dramaticallyincreased due to its advantages over procedural softwareimplementations [21ndash26] In particular mathematical andphysical attributes of a model can be naturally representedwith objects [27 28]

A common approach for simulating partial differentialequation (PDE) basedmathematical models is to use prebuiltsimulation software programs These ldquoblack-boxesrdquo can sim-plify model implementation however there are limitationswith this approach A researcher is often confined to thenumerical algorithms and programming controls offered bythe simulation program it can be very difficult or perhapsnot possible to incorporate numerics and solution tech-niques not supported by the software In addition integratinga prebuilt software application with external data sources andapplications can be very challenging which obstructs the useof its simulations within larger software solutions

An alternative strategy is to create custom softwarethat utilizes numerical application programming interfaces(APIs) While this approach generally takes longer to imple-ment it allows the use of problem-specific algorithms andprogramming logic that facilitate accurate and expedientsimulation results [28] Coupling this philosophywith object-oriented software engineering techniques can produce a finalproduct that is versatile expandable and computationallyefficient Interactions with external systems can be seamlesslyintegrated and the ability to compile the software to exe-cutable machine code simplifies its deployment to alternativehardware platforms for example medical imagingmachines

In this paper we present an object-oriented softwareframework for finite element basedTES simulationsMultiplefeatures of object-oriented design and programming areutilized to create a modular software architecture that encap-sulates medical mathematical and computational attributesof TESThe result is a program thatmaximizes code reuse andTES simulation versatility We demonstrate this versatilitywith several simulations each with a distinct TES researchfocus These simulations utilize MRI-derived three-dimen-sional headmodels with physiologically based tissue conduc-tivities and real-world electrode configurations Finally weshowhow the same software can be easily extended to addressalternative neurostimulation research areas such as deepbrain stimulation (DBS) In addition all components of theframework are available to the community as a supplementto this paper

2 Materials and Methods

21 Governing Equations The electric current density withinthe head and brain fromneurostimulation can bemodeled bythe Poisson equation namely minusnabla sdotMnablaΦ = 119891() where Φ isthe electric potentialM is the tissue conductivity tensor and119891() is a given electrical source term For isotropic mediumsM can be represented as a scalar which varies for differenttissue types

Electric current delivered by TES anode electrode(s) isgiven by the nonhomogeneous Neumann boundary condi-tion sdotMnablaΦ = 119868() where 119868() represents the stimulationcurrent density and is the outward boundary normal vector

Cathode electrode(s) are represented by the homogeneousDirichlet condition Φ() = 0 All other points on the skinsurface are insulated by the surrounding air thus sdotMnablaΦ = 0

Our governing equations are as follows

minusnabla sdotMnablaΦ = 119891 () isin Ω (1a)

Φ = 0 isin 120597Ω

119862 (1b)

sdotMnablaΦ = 119868 () isin 120597Ω119860 (1c)

sdotMnablaΦ = 0 isin 120597Ω119878 (1d)

where Ω is the head volume 120597Ω119860and 120597Ω

119862represent the

areas on the scalp covered by anode and cathode electrodesrespectively and 120597Ω

119878is the remaining portion of the head

surface Note that for TES simulations there is no sourceterm within the volume and so 119891() = 0 (1a) AlternativelyDBS is realized with an appropriate definition of119891() and thehomogeneous Neumann boundary condition (1d) applied tothe entire boundary namely 120597Ω

119904= 120597Ω [29]

The associatedweak formulation (seeAppendix) is to findΦ() isin 119867

1

0(Ω) given 119891() isin 119871

2(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(2)

where

119867

1

0(Ω) = 119906 | 119906 isin 119867

1(Ω) 119906 = 0 forall isin 120597Ω119862

119867

1(Ω) = 119906 | 119906 isin 1198712 (Ω)

120597119906

120597119909

119894

isin 119871

2 (Ω)

119871

2 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(3)

22 Framework Design The fundamental task in the designof the framework was to create objects based on attributesof TES and TES simulations We refer to [30] for a detailedexplanation of object-oriented design and provide just a briefoverview of the key aspects utilized within our framework

Objects encapsulate data and functions that operate onthe data A class provides the description of an object type bydefining variable and function names and an object is moreformally viewed as a specific instance of a class Inheritanceis a class relationship and provides the ability to extend thefunctionality of a class with a so-called subclass A subclasscan contain data and functionality from a parent class and candefine its own as well Inheritance is a major object-orienteddesign concept that exploits code reuse since all subclassescan reuse data constructs and functions from a parent classPolymorphism enables a subclass to give specific functionalityto an abstract function defined by a parent class This pow-erful technique allows parent classes to encapsulate genericand broad ideas by delegating specific function implementa-tions to subclasses [30]

We required that electrode configuration stimulationparameters tissue conductivity information computational

Journal of Computational Medicine 3

Conductivity

Matlab_Data_Conductivity

FEM

TES

TES_MG

Electrode

Source

TES_Source middot middot middot DBS_Source

Tissue conductivity properties PDE solver Neurostimulation modality

Figure 1 Software architecture and main classes in the object-oriented TES simulation framework Classes are represented with boxes andarrow and diamond tipped lines represent inheritance and aggregation respectively

domain and numerical solution methods be specified via aninput file This permits customized TES simulations withoutthe need to rewrite and recompile code In addition bymathematically retaining the source term 119891() in the weakformulation (2) and allowing this function to be defined bya user different neurostimulation modalities for exampleDBS can be simulated

We choose to base our framework design on Diffpack[31] which is a numerical API library for solving PDEs It isbased on the C++ programming language [32] and possessesa vast collection of PDE solution algorithms [27 28]TheC++language incorporates well-established software engineeringpractices [33] and is compiled to machine code resulting infast execution speeds and portability to alternative hardwareplatforms Despite our use of a specific numerical libraryand programming language the object-oriented design andimplementation strategies presented in this paper apply toany programming language and API package that supportsan object-oriented approach

Figure 1 displays the main software components in theTES simulation framework Each box represents a class andeach arrow and diamond tipped line represents inheritanceand aggregation respectively FEM is a class in the Diffpacklibrary that offers fundamental finite element method datastructures and algorithms Class TES which is the corner-stone of the framework inherits FEM functionality to solvesimulations given by system (1a)ndash(1d) Class TES MG extendsTES functionality so that multigrid (MG) algorithms can alsobe utilized in solving this system

For TES simulations to be fully realized tissueconductivity and electrode information are needed Theseideas have been encapsulated with respective classes andTES possesses instances of each Since conductivity data cancome from a variety of sources with differing storage formatsthe Conductivity class merely defines abstract functionnames that are viewed as common to all conductivity datasources Then specific functionality for specific conductivitydata sources is implemented in subclasses for example

Matlab Data Conductivity via polymorphism Thisapproach allows different conductivity data sources to beincorporated into the framework without needing to modifycode in the TES and Conductivity classes The boundaryconditions are also managed by TES using information fromclass Electrode which maintains TES electrode locationand size information In addition by retaining the sourceterm 119891() in the weak formulation (2) and encapsulating itas a class namely Source assignments to 119891() enable thesimulation of alternative types of neurostimulation such asDBS

23 Framework Implementation In this section key soft-ware implementation aspects of the framework and relatedDiffpack concepts are described For a complete guide toDiffpack see [27]

231 Tissue Conductivity Class Conductivity defines gen-eral function names but delegates the implementation ofthese functions to its subclasses (Code 1) MatlabConduc-tivity inherits Conductivity and provides specific imple-mentations of the loadConductivities and getConduc-tivity functions based on a Matlab [34] binary data fileformat produced by the SimNIBS software package [35]

Two additional datamembers are defined by MatlabCon-ductivity namely a MatlabHelper object mh whichmanages a runtime interface with the MatlabEngine [34]and a Matlab matrix ct These two members are neededby the MatlabConductivity subclass not the parentConductivity class and are therefore included in onlythe subclass The MatlabConductivity implementation ofthe loadConductivities function simply creates a Matlabcommand to load the anisotropic conductivity data sourceexecutes this command within the MatlabEngine via the mhobject and then stores the anisotropic conductivity tensordata into the ctmatrix which are then accessible throughouta TES simulation via the getConductivity function (Code1)

4 Journal of Computational Medicine

class Conductivity

Conductivity()

virtual simConductivity()

Load tensor conductivities from data files

virtual void loadConductivities (Stringamp fileName)

Get ith component of conductivity tensor at pt (xyz)

virtual double getConductivity (int i int x int y int z)

class MatlabConductivity public Conductivity

MatlabConductivity()

virtual simMatlabConductivity()

Inherited from Conductivity

virtual void loadConductivities(Stringamp fileName)

virtual double getConductivity(int i int x int y int z)

MatlabHelper mh Mangage interface with the MatlabEngine

mxArray ct Matrix with conductivity tensor data

void MatlabConductivityloadConductivities(Stringamp fileName)

String name = load( + fileName + )engEvalString(mh-gtep namec str())

ct = engGetVariable(mh-gtep ct)

Code 1 Class definitions for tissue conductivity data Class Conductivity provides general function names that is loadConductivitiesand getConductivity The MatlabConductivity subclass implements these functions for a particular data source For example itsloadConductivities function loads a Matlab anisotropic conductivity data source into the ctmatrix for use in a simulation

The Conductivity-MatlabConductivity relation-ship demonstrates the advantages of object-oriented inher-itance and polymorphism Conductivity is used to definefunction names common to all conductivity data sourcesand serves as the bridge between these repositories and theframework Polymorphism permits the MatlabConductiv-ity subclass to implement specific loadConductivitiesand getConductivity functionality for its particular dataformat Code within the Conductivity class and all otherframework classes does not dependent on these subclassimplementations Thus alternative conductivity data sourcescan be easily incorporated into the framework as a subclassof Conductivity in an identical fashion requiring nomodification to any other framework component

232 Source Term Class Source is a software abstractionof the 119891() source term (1a) and like Conductivity definesbasic functionality to be implemented in subclasses (Code 2)Source inherits the Diffpack class FieldFunc which allowsa scalar function to be defined over the domain Differentsubclass implementations of the valuePt function can beused to model different neurostimulation modalities ForTES valuePt in class TES Source simply returns zero since119891() = 0 in this case (Code 2)

Main TES ClassClass TES is themain class in the frameworkCode 3 presents the key elements of this class which containsnumerous objects functions and Diffpack concepts ClassTES inherits the Diffpack FEM class giving it access to finiteelement data structures and functionality Handle objectswhich are pointers in Diffpack that includememorymanage-ment features are defined for the computational grid gridand electric potential and current density solution results uand currDensity respectively

Several other class members are needed to implementTES simulations Variables to store boundary condition val-ues are included as well as the anodes and cathodes vectorsto store electrode information The vector isoSigma andmatrix sigma store isotropic and anisotropic conductivitydata and the choice of conductivity representation is deter-mined by a user via the isotropic boolean variable Themc data member is a reference to the Conductivity classproviding an interface to conductivity data Note that mc istype Conductivity and not MatlabConductivity Themc object can therefore use the loadConductivitiesand getConductivity functions of any Conductivitysubclass including MatlabConductivity This designapproach allows new Conductivity subclasses to be definedand utilized without the need to modify code in class TES

Journal of Computational Medicine 5

class Source public FieldFunc

TES data Provides access to TES class members

Source ()

virtual dpreal valuePt Source term value at pt x Abstract function

(const Ptv(dpreal)amp x dpreal t = DUMMY) = 0

dpreal TES Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

return val

Code 2 Source term class definitions The TES Source subclass of Source enables TES simulations by defining its valuePt function toreturn a value of zero at all points

class TES public FEM

DATA TYPES

Handle(GridFE) grid Underlying finite element grid

Handle(FieldFE) u Electric potential over grid

Handle(FieldsFE) currDensity Electric Current density over grid

dpreal dirichlet val1 Constant phi value at a boundary

dpreal dirichlet val2 Constant phi value at boundary

dpreal robin U0 Constants for Neumann boundary condition

vectorltElectrodegt anodes Anode electrodes

vectorltElectrodegt cathodes Cathode electrodes

bool isotropic Isotrpoic or anisotropic bool control

Vec(dpreal) isoSigma Isotropic brain tissue conductance values

MatSimple(dpreal) sigma Anisotropic conductivity tensor matrix

Conductivity mc Interface class for anisotropic conductivities

Handle(FieldFunc) source Source term for initializing f(x)

Handle(FieldFunc) alternatingStim Object to model non-direct TES ie tACS

FUNCTIONS

Standard finite element functions inherited from class FEM

virtual void fillEssBC () Set dirichlet boundary conditions

virtual void calcElmMatVec Compute FE coefficient matrix and load vector

(int e ElmMatVecamp elmat FiniteElementamp fe)

virtual void integrands Implement weak formulation integrand

(ElmMatVecamp elmat const FiniteElementamp fe)

virtual void integrands4side Neumann boundary integral

(int side int boind ElmMatVecamp elmat const FiniteElementamp fe)

Code 3 Main elements within the TES class Handles are Diffpack pointers that include memory management features The class definitioncontains a Handle for the computational grid (grid) and electric potential (u) and current density (currDensity) solution results Nextvariables store boundary condition values and anode (anodes) and cathode (cathodes) electrode information Support for both isotropicand anisotropic conductivity data is provided as well as functions for source and nonconstant anode stimulation Functions inherited fromFEM are required to perform finite element calculations

6 Journal of Computational Medicine

void TES integrands (ElmMatVecamp elmat const FiniteElementamp fe)

int ijq Loop control variables

const int nbf = fegetNoBasisFunc() no of nodesbasis functions

dpreal detJxW = fedetJxW() Numerical integration weight

const int nsd = fegetNoSpaceDim() Number of spatial dimensions

Get conductivity tensor for the current element

updateConductivityTensors(fe)

Get a point in the global domain represented by elemnt fe

Ptv(NUMT) x(nsd)

fegetGlobalEvalPt(x)

Get the source term f(x) for this element

dpreal f val

if (sourceok())

f val = source-gtvaluePt(x)

else f val = 0

Compute weak formulation

dpreal gradNi gradNj

for (i = 1 i lt= nbf i++)

for (j = 1 j lt= nbf j++)

gradNi gradNj = 0

for (q = 1 q lt= nsd q++)

Compute inner product of grad(N i) and grad(N j)

gradNi gradNj += sigma(qq) fedN(iq) fedN(jq)

Update linear system coefficient matrix

elmatA(ij) += gradNi gradNjdetJxW

Update linear system RHS (load vector)

elmatb(i) += feN(i)f valdetJxW

Code 4 TES class integrands function for computing weak formulation volume integrals Conductivity and source term values for finiteelement fe are retrieved with calls to the updateConductivityTensors and source valuePt functions Finite element basis functions arethen iterated to compute the volume integrals

There is also a reference to a Source object for exampleTES Source as well as a field function for nonconstantstimulation currents for example tACS Finally TES inheritsfunctions from FEM to perform finite element computationsincluding fillEssBC to set Dirichlet boundary conditionscalcElmMatVec to assemble the finite element linear systemcoefficient matrix and load vector and the integrands andintegrands4side functions to evaluate the weak formula-tion volume and boundary integrals respectively

233 Weak Formulation Integration The weak formulationvolume integrals (2) are computed in the TESintegrandsfunction (Code 4) The Diffpack linear system assemblerautomatically calls this function as it iterates over thefinite elements in the computational grid Conductivityvalues for the current element are attained with a call to

the updateConductivityTensors function which deter-mines if isotropic or anisotropic conductivities are desiredand then populates the sigmamatrix accordingly

The source term 119891() over the current element isretrieved via a call to the valuePt function in a Source classThen the finite element basis functions for this element areiterated over and the weak formulation is computed Notethat in this implementation sigma is assumed to be diag-onal however this can be generalized with the incorporationof an additional loop Finally the coefficient matrix A andload vector b are updatedThe boundary integral in theweakformulation is computed similarly in the integrands4sidefunction and its contribution is incorporated into b

234 Multigrid Multigrid is a linear system solution algo-rithm that utilizes multiple computational grid resolutions to

Journal of Computational Medicine 7

class TES MG public TES

int no of grids

Handle(MGtools) mgtools

Set boundary condtion on grid level specified by space

virtual void mgFillEssBC (SpaceId space)

Code 5 New members of TES MG class definition The mgtools object references the Diffpack multigrid toolbox The no of grids integerstores the number of MG grid levels and the mgFillEssBC function sets the essential boundary condition on all grid levels

(a) Head surface (b) Brain region (c) View of sagittal cross section

Figure 2 Computational domain used in numerical simulations

achieve fast solution convergence [36] By performing justa few iterations on each grid and then changing betweenfiner and coarser grids large portions of the error areefficiently removed [37] In addition as a preconditioner tothe commonly used conjugate gradient (CG) method MG ishighly effective at solving linear systems that result fromfiniteelement based TES simulations [38] Two commonly usedMG cycles are the V-cycle and the W-cycle and identifyingthe optimal cycle type for a given PDE system in addition tootherMGparameters including the number of grid levels canbe challenging [38]

As a subclass of TES very few new data members andfunctions are needed in TES MG (Code 5) since the entiretyof TES is efficiently reused The new members in TES MGare a reference to the Diffpack multigrid toolbox mgtoolsand an integer representing the number of MG grid levelsno of grids Finally just one new function mgFillEssBCis needed to set the essential boundary condition (1b) on allgrid levels

24 Computational Tools Numerical simulations were per-formed on a three-dimensional mesh (Figure 2) generatedfrom human MRI images by the SimNIBS software package[35] The mesh contains the skin skull cerebral spinal fluid(CSF) gray matter (GM) and white matter (WM) tissues ofthe head Gmsh [39] enabled mesh visualization identifica-tion of electrode coordinates and grid conversion to a formsupported by Diffpack Electric potential and current densityresults were exported from Diffpack and visualized withParaView [40] and gnuplot [41] Anisotropic conductivitydata for theGMandWMregions are provided by SimNIBS in

a Matlab binary data file these data are accessed by theMatlabEngine [34] via the MatlabHelper object of theMatlabConductivity class (Code 1)

25 Computational Simulations Multiple simulations wereperformed with the TES framework Simulations wereselected to demonstrate the frameworkrsquos versatility and abilityto target medical biophysical and computational researchobjectives Finally to illustrate how alternative forms ofneurostimulation can be simulated with the same softwarewe show a trivial extension to the framework that enablessupport for DBS applications

Simulation 1 (comparison of isotropic and anisotropic con-ductivity data) Previous research suggests that incorporatinganisotropic rather than isotropic brain tissue conductivitydata is important formost accuratelymodeling TES electricalcurrent distribution [17 42] To evaluate the impact thatthese two conductivity representations have on simulationresults TES simulations were performed with isotropic andanisotropic data The three-dimensional domain shown inFigure 2 was used with approximately 28 million lineartetrahedra finite elements

Anode and cathode electrodes were positioned at C3 andC4 [43] respectively each with a surface area of approx-imately 16 cm2 and the anode electric current magnitudewas set to 10mA This montage has been used to stimulatethe motor cortex ipsilateral to the C3 anode electrode [4445] First isotropic electrical conductivities were assigned todifferent tissues skin = 0465 skull = 0010 CSF = 1654GM = 0276 and WM = 0126 each with units (Sm) [46]

8 Journal of Computational Medicine

05mm05mm05mm10mm

075mm

minus

+

Figure 3 Simulation 4 DBS electrode positioning (subthalamic nucleus) and dimensions Anode and cathode contacts are denoted with ldquo+rdquoand ldquominusrdquo symbols respectively

Then anisotropic conductivity data were used via theMatlabConductivity class as previously described (seeCode 1)

Simulation 2 (comparison of tDCS and HD-tDCS electrodemontages) High-definition TES electrodes have demon-strated a greater ability to focus its electrical current on atargeted brain region than traditional tDCS which uses twolarger electrodes [2 3] Using the same computational gridas Simulation 1 the current densities produced by tDCS andHD-tDCS were compared

For tDCS the anodewas positioned over C3 and the cath-ode over the contralateral supraorbital each with a surfacearea of approximately 16 cm2 In comparison high-definitionelectrodes each circular with a 12mm diameter were posi-tioned according to a 4 times 1 configuration a single anode waspositioned over C3 and four cathodes were placed approxi-mately 5 cm radially from the anode forming a square Bothof these montages are known to target the motor cortexregion ipsilateral to the anode electrode [15 47ndash50] Anodestimulation strength for each simulation was once again10mA and both utilized anisotropic conductivities

Simulation 3 (comparison of finite element linear systemsolvers) Finite element based simulations of TES requirethe solution of large systems of linear equations which canbecome a computational bottleneck for simulations per-formed on very fine meshes Therefore the effectiveness ofa TES simulation is directly related to the efficiency of thechosen linear solverTheCGmethod is ideal for solving theselinear systems and appropriate preconditioning can rapidlyaccelerate numerical results [36 38]

The numerical efficiency of the preconditioned CGmethod was evaluated with TES simulations on the three-dimensional volume mesh (Figure 2) with approximately

29 million linear tetrahedra finite elements and roughly 51million unknowns The anode was positioned at CZ with astimulation strength of 10mA and the cathode at OZ [12 51]Simulations were performed with the CG method precon-ditioned with symmetric successive overrelaxation (SSOR)relaxed incomplete LUdecomposition (RILU) andmultigridThe RILU relaxation parameter was set to 05 [27] The MGpreconditioner was simulated with a V-cycle with both twoand three grid levels and aW-cycle with three grid levelsTherelative residual convergence tolerance was set to 10minus8 for allnumerical experiments

Simulation 4 (impact of conductivity representation onDBS simulation results) The importance of incorporatinganisotropic conductivities in TES simulations suggests thataccurately simulating other neurostimulationmodalitiesmaydepend on this conductivity representation as well In thisnumerical experiment we compared DBS simulation resultsusing both isotropic and anisotropic conductivities A singleelectrode was positioned in the subthalamic nucleus (STN)the most commonly targeted location for DBS [52] The elec-trode is a simplified version of the Medtronic (Model 3387)electrode used in humans [53] The lower 50mm of the elec-trode was modeledThe anode is positioned 10mm from theelectrode tip and the cathode is separated by 05mm from theanode Both the anode and cathode are 05mm in height andthe overall electrode diameter was set to 075mm (Figure 3)The anode and cathode metal contacts were modeled asconductors by setting the electrical conductivities of theseregions to 106 (Sm) and the remaining electrode shaft wasmodeled as an insulator with conductivity equal to 10minus6 (Sm) [54] Because DBS electric current is proximal to the elec-trode [29 55] a 100mm times 40mm times 40mm subset of tissuearound the electrode was considered as the computationaldomain

Journal of Computational Medicine 9

class DBS Source public Source

DBS Source(TES data)

virtual dpreal valuePt(const Ptv(dpreal)amp x dpreal t = DUMMY)

dpreal DBS Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

if (4625 lt= x(1) ampamp x(1) lt= 5375 ampamp

4625 lt= x(2) ampamp x(2) lt= 5375 ampamp

3500 lt= x(3) ampamp x(3) lt= 4000 )

val = 0001

Code 6 DBS Source class definition and sample code from its valuePt function

00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(a) Isotropic conductivities00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(b) Anisotropic conductivities

Figure 4 Simulation 1 current density results viewed from above with the nasion facing up Anode was placed at C3 and cathode at C4

To simulate DBS with the existing TES software frame-work no existing code required modification Rather theonly addition was a new subclass of class Source that defines119891() (1a) for DBS in total less than ten lines of codewere added Code 6 displays this new subclass definitionSource DBS and highlights of its valuePt function imple-mentation which in this simplified scenario simply injects10mA of current from the anode contact into the surround-ing tissue In practice DBS stimulations are time-varyingpulses and differing stimulation frequencies impact GM andWM tissue conductivities [56] However when examiningelectric field dispersion around a DBS electrode as in thissimulation a constant-valued source term in (1a) can beutilized [57]

3 Results and Discussion

31 Simulation 1 Electric current density results on thesurface of the brain tissue are displayed in Figure 4 Viewing

perspective is from above the head with the nasion facingup As expected the largest electric current density valuesare attained near the anode and cathode locations Despitean overall similar pattern of electric current distribution thesimulated current densities particularly in the motor cortexipsilateral to the anode electrode are significantly differentbetween the isotropic and anisotropic simulations For exam-ple the maximal anisotropic current density value (0434 (Am2)) is approximately 182 higher than in the isotropic case(0367 (Am2)) Similar discrepancies are observed through-out the top surface of the brain including a substantialimpact on the paracentral lobule contralateral to the anodeIn addition these discrepancies extend to the GM and WMinteriors These results reinforce the importance of usinganisotropic conductivities to most accurately model TESadministrations and in addition showcase the capabilities ofthe object-oriented framework to support both isotropic andanisotropic TES simulations

10 Journal of Computational Medicine

Elec

tric

pot

entia

l (V

)

00

005

010

015

(a) tDCS electric potential00

0015

003

0045

Elec

tric

pot

entia

l (V

)

(b) HD-tDCS electric potential

00

015

030

045

Curr

ent d

ensit

y (A

m2)

(c) tDCS electric current density00

0033

0067

01

Curr

ent d

ensit

y (A

m2)

(d) HD-tDCS electric current density

Figure 5 Simulation 2 electric potential and current density results The tDCS montage positioned the anode at C3 and the cathode overthe contralateral supraorbital A 4 times 1 configuration was used for HD-tDCS with a single anode positioned over C3

32 Simulation 2 Electric potential and electric currentdensity results are displayed in Figure 5 The tDCS montageresults in a noticeably larger range of electric potential values(Figures 5(a) and 5(b)) However the focus of the tDCScurrent density on the targeted region in this case the motorcortex under C3 is much less than the HD-tDCS electrodemontage (Figures 5(c) and 5(d)) Specifically the brain tissueoutside of the square formed by the HD-tDCS cathodesis virtually unstimulated whereas tDCS results in a muchgreater electric current dispersion

One limitation of this HD-tDCS electrode arrangementis the lower concentration of electric current that reaches thebrain tissue Specifically the maximal electric current densityin the brain fromHD-tDCS is just approximately 23 of thatachieved with traditional tDCS The culprit for this effect isthe shunting of the electric current around the poorly con-ducting skull the HD-tDCS montage used in this simulationyields a minuscule amount of current that penetrates theskull to reach the CSF and brain tissues (Figure 6) Potentialremedies for this behavior are a greater anode stimulation orpositioning the cathodes at greater distances from the anode[3]

This simulation demonstrates the frameworkrsquos ability tosupport varying TES electrode montages including high-definition electrode configurations Results of this simulation

Curr

ent d

ensit

y (A

m2)

00

05

10

15

Figure 6 Simulation 2 HD-tDCS electric current density Crosssection is through two diagonally positioned cathodes

corroborate that HD-tDCS offers greater electric currentfocality however its net stimulation of brain tissue is poten-tially much lower than tDCS

33 Simulation 3 Electric potential and current densityresults on the head surface are displayed in Figure 7 Viewing

Journal of Computational Medicine 11

00

004

008

012

Elec

tric

pot

entia

l (V

)

(a) Electric potential00

05

10

15

20

Curr

ent d

ensit

y (A

m2)

(b) Current density

Figure 7 Simulation 3 electric potential and current density results viewed from the back of the head The anode was positioned at CZ andthe cathode at OZ

perspective is frombehind the head and as anticipatedmaxi-mal andminimal electric potential and current density valuesoccur at the anode and cathode respectivelyThe shunting ofthe electric current around the skull due to its low electricalconductivity results in the segregated current density patternaround the anode and cathode centers (Figure 7(b)) Thisphenomenon has been previously observed [1] however itis highlighted by the very fine mesh resolution used in thissimulation

Figure 8 displays convergence history curves and perfor-mance metrics for each CG preconditioning strategy Withno preconditioning the CG method will eventually conver-gence but will accomplish this extremely slowly requiringmore than 6 hours to solve the linear system The SSORand RILU preconditioners demonstrate comparable perfor-mances both in solution time and number of iterationsMultigrid preconditioning with two grid levels has far feweriterations with 166 than both SSOR and RILU and yet has agreater run time This observation can be explained by thefact that a single iteration of MG has embedded iterationson the different mesh refinements [37] However three-grid-level MG noticeably accelerates convergence rates with boththe V- and W-cycles outperforming the other precondition-ers Three-grid-level MG with a W-cycle pattern has slightlyfewer iterations than its corresponding V-cycle yet this V-cycle preconditioner is approximately 113 faster

The ability of the framework to support numerically ori-ented TES research is presented in this simulation exampleThe results indicate that the CG method combined with anappropriately configured MG preconditioner is highly effi-cient in solving the linear systems produced in TES compu-tational simulations

34 Simulation 4 Figure 9 displays the electric currentdensities produced by the DBS electrode using isotropic(Figure 9(a)) and anisotropic (Figure 9(b)) conductivitiesIn both cases the majority of the current density is prox-imal to the electrode indicating that accurate placementof electrodes in DBS procedures is paramount [56] While

1

0

minus1

minus2

minus3

minus4

minus5

minus6

minus7

minus8

minus9

Iterations0 100 200 300 400 500 600 700 800 900

SSORRILUMG 2-V

MG 3-VMG 3-W

log10(r

elat

ive r

esid

ual)

(a) Convergence history

Preconditioner Iterations Time (min)NoneSSORRILUMG 2-grid V-cycleMG 3-grid V-cycleMG 3-grid W-cycle

gt5000 gt360

860

885

166

113

106

1134

1175

1264

574647

(b) Numerical iterations and linear system solve time Boldfacevalues indicate best convergence results

Figure 8 Convergence performances of the preconditioned conju-gate gradient methods

themaximal current densities of the isotropic and anisotropicscenarios are similar other differences between them areobservable First the current density around the electrodeis nonsymmetric in the anisotropic case as is expectedwith directionally dependent conductivity data In addition

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 3: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

Journal of Computational Medicine 3

Conductivity

Matlab_Data_Conductivity

FEM

TES

TES_MG

Electrode

Source

TES_Source middot middot middot DBS_Source

Tissue conductivity properties PDE solver Neurostimulation modality

Figure 1 Software architecture and main classes in the object-oriented TES simulation framework Classes are represented with boxes andarrow and diamond tipped lines represent inheritance and aggregation respectively

domain and numerical solution methods be specified via aninput file This permits customized TES simulations withoutthe need to rewrite and recompile code In addition bymathematically retaining the source term 119891() in the weakformulation (2) and allowing this function to be defined bya user different neurostimulation modalities for exampleDBS can be simulated

We choose to base our framework design on Diffpack[31] which is a numerical API library for solving PDEs It isbased on the C++ programming language [32] and possessesa vast collection of PDE solution algorithms [27 28]TheC++language incorporates well-established software engineeringpractices [33] and is compiled to machine code resulting infast execution speeds and portability to alternative hardwareplatforms Despite our use of a specific numerical libraryand programming language the object-oriented design andimplementation strategies presented in this paper apply toany programming language and API package that supportsan object-oriented approach

Figure 1 displays the main software components in theTES simulation framework Each box represents a class andeach arrow and diamond tipped line represents inheritanceand aggregation respectively FEM is a class in the Diffpacklibrary that offers fundamental finite element method datastructures and algorithms Class TES which is the corner-stone of the framework inherits FEM functionality to solvesimulations given by system (1a)ndash(1d) Class TES MG extendsTES functionality so that multigrid (MG) algorithms can alsobe utilized in solving this system

For TES simulations to be fully realized tissueconductivity and electrode information are needed Theseideas have been encapsulated with respective classes andTES possesses instances of each Since conductivity data cancome from a variety of sources with differing storage formatsthe Conductivity class merely defines abstract functionnames that are viewed as common to all conductivity datasources Then specific functionality for specific conductivitydata sources is implemented in subclasses for example

Matlab Data Conductivity via polymorphism Thisapproach allows different conductivity data sources to beincorporated into the framework without needing to modifycode in the TES and Conductivity classes The boundaryconditions are also managed by TES using information fromclass Electrode which maintains TES electrode locationand size information In addition by retaining the sourceterm 119891() in the weak formulation (2) and encapsulating itas a class namely Source assignments to 119891() enable thesimulation of alternative types of neurostimulation such asDBS

23 Framework Implementation In this section key soft-ware implementation aspects of the framework and relatedDiffpack concepts are described For a complete guide toDiffpack see [27]

231 Tissue Conductivity Class Conductivity defines gen-eral function names but delegates the implementation ofthese functions to its subclasses (Code 1) MatlabConduc-tivity inherits Conductivity and provides specific imple-mentations of the loadConductivities and getConduc-tivity functions based on a Matlab [34] binary data fileformat produced by the SimNIBS software package [35]

Two additional datamembers are defined by MatlabCon-ductivity namely a MatlabHelper object mh whichmanages a runtime interface with the MatlabEngine [34]and a Matlab matrix ct These two members are neededby the MatlabConductivity subclass not the parentConductivity class and are therefore included in onlythe subclass The MatlabConductivity implementation ofthe loadConductivities function simply creates a Matlabcommand to load the anisotropic conductivity data sourceexecutes this command within the MatlabEngine via the mhobject and then stores the anisotropic conductivity tensordata into the ctmatrix which are then accessible throughouta TES simulation via the getConductivity function (Code1)

4 Journal of Computational Medicine

class Conductivity

Conductivity()

virtual simConductivity()

Load tensor conductivities from data files

virtual void loadConductivities (Stringamp fileName)

Get ith component of conductivity tensor at pt (xyz)

virtual double getConductivity (int i int x int y int z)

class MatlabConductivity public Conductivity

MatlabConductivity()

virtual simMatlabConductivity()

Inherited from Conductivity

virtual void loadConductivities(Stringamp fileName)

virtual double getConductivity(int i int x int y int z)

MatlabHelper mh Mangage interface with the MatlabEngine

mxArray ct Matrix with conductivity tensor data

void MatlabConductivityloadConductivities(Stringamp fileName)

String name = load( + fileName + )engEvalString(mh-gtep namec str())

ct = engGetVariable(mh-gtep ct)

Code 1 Class definitions for tissue conductivity data Class Conductivity provides general function names that is loadConductivitiesand getConductivity The MatlabConductivity subclass implements these functions for a particular data source For example itsloadConductivities function loads a Matlab anisotropic conductivity data source into the ctmatrix for use in a simulation

The Conductivity-MatlabConductivity relation-ship demonstrates the advantages of object-oriented inher-itance and polymorphism Conductivity is used to definefunction names common to all conductivity data sourcesand serves as the bridge between these repositories and theframework Polymorphism permits the MatlabConductiv-ity subclass to implement specific loadConductivitiesand getConductivity functionality for its particular dataformat Code within the Conductivity class and all otherframework classes does not dependent on these subclassimplementations Thus alternative conductivity data sourcescan be easily incorporated into the framework as a subclassof Conductivity in an identical fashion requiring nomodification to any other framework component

232 Source Term Class Source is a software abstractionof the 119891() source term (1a) and like Conductivity definesbasic functionality to be implemented in subclasses (Code 2)Source inherits the Diffpack class FieldFunc which allowsa scalar function to be defined over the domain Differentsubclass implementations of the valuePt function can beused to model different neurostimulation modalities ForTES valuePt in class TES Source simply returns zero since119891() = 0 in this case (Code 2)

Main TES ClassClass TES is themain class in the frameworkCode 3 presents the key elements of this class which containsnumerous objects functions and Diffpack concepts ClassTES inherits the Diffpack FEM class giving it access to finiteelement data structures and functionality Handle objectswhich are pointers in Diffpack that includememorymanage-ment features are defined for the computational grid gridand electric potential and current density solution results uand currDensity respectively

Several other class members are needed to implementTES simulations Variables to store boundary condition val-ues are included as well as the anodes and cathodes vectorsto store electrode information The vector isoSigma andmatrix sigma store isotropic and anisotropic conductivitydata and the choice of conductivity representation is deter-mined by a user via the isotropic boolean variable Themc data member is a reference to the Conductivity classproviding an interface to conductivity data Note that mc istype Conductivity and not MatlabConductivity Themc object can therefore use the loadConductivitiesand getConductivity functions of any Conductivitysubclass including MatlabConductivity This designapproach allows new Conductivity subclasses to be definedand utilized without the need to modify code in class TES

Journal of Computational Medicine 5

class Source public FieldFunc

TES data Provides access to TES class members

Source ()

virtual dpreal valuePt Source term value at pt x Abstract function

(const Ptv(dpreal)amp x dpreal t = DUMMY) = 0

dpreal TES Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

return val

Code 2 Source term class definitions The TES Source subclass of Source enables TES simulations by defining its valuePt function toreturn a value of zero at all points

class TES public FEM

DATA TYPES

Handle(GridFE) grid Underlying finite element grid

Handle(FieldFE) u Electric potential over grid

Handle(FieldsFE) currDensity Electric Current density over grid

dpreal dirichlet val1 Constant phi value at a boundary

dpreal dirichlet val2 Constant phi value at boundary

dpreal robin U0 Constants for Neumann boundary condition

vectorltElectrodegt anodes Anode electrodes

vectorltElectrodegt cathodes Cathode electrodes

bool isotropic Isotrpoic or anisotropic bool control

Vec(dpreal) isoSigma Isotropic brain tissue conductance values

MatSimple(dpreal) sigma Anisotropic conductivity tensor matrix

Conductivity mc Interface class for anisotropic conductivities

Handle(FieldFunc) source Source term for initializing f(x)

Handle(FieldFunc) alternatingStim Object to model non-direct TES ie tACS

FUNCTIONS

Standard finite element functions inherited from class FEM

virtual void fillEssBC () Set dirichlet boundary conditions

virtual void calcElmMatVec Compute FE coefficient matrix and load vector

(int e ElmMatVecamp elmat FiniteElementamp fe)

virtual void integrands Implement weak formulation integrand

(ElmMatVecamp elmat const FiniteElementamp fe)

virtual void integrands4side Neumann boundary integral

(int side int boind ElmMatVecamp elmat const FiniteElementamp fe)

Code 3 Main elements within the TES class Handles are Diffpack pointers that include memory management features The class definitioncontains a Handle for the computational grid (grid) and electric potential (u) and current density (currDensity) solution results Nextvariables store boundary condition values and anode (anodes) and cathode (cathodes) electrode information Support for both isotropicand anisotropic conductivity data is provided as well as functions for source and nonconstant anode stimulation Functions inherited fromFEM are required to perform finite element calculations

6 Journal of Computational Medicine

void TES integrands (ElmMatVecamp elmat const FiniteElementamp fe)

int ijq Loop control variables

const int nbf = fegetNoBasisFunc() no of nodesbasis functions

dpreal detJxW = fedetJxW() Numerical integration weight

const int nsd = fegetNoSpaceDim() Number of spatial dimensions

Get conductivity tensor for the current element

updateConductivityTensors(fe)

Get a point in the global domain represented by elemnt fe

Ptv(NUMT) x(nsd)

fegetGlobalEvalPt(x)

Get the source term f(x) for this element

dpreal f val

if (sourceok())

f val = source-gtvaluePt(x)

else f val = 0

Compute weak formulation

dpreal gradNi gradNj

for (i = 1 i lt= nbf i++)

for (j = 1 j lt= nbf j++)

gradNi gradNj = 0

for (q = 1 q lt= nsd q++)

Compute inner product of grad(N i) and grad(N j)

gradNi gradNj += sigma(qq) fedN(iq) fedN(jq)

Update linear system coefficient matrix

elmatA(ij) += gradNi gradNjdetJxW

Update linear system RHS (load vector)

elmatb(i) += feN(i)f valdetJxW

Code 4 TES class integrands function for computing weak formulation volume integrals Conductivity and source term values for finiteelement fe are retrieved with calls to the updateConductivityTensors and source valuePt functions Finite element basis functions arethen iterated to compute the volume integrals

There is also a reference to a Source object for exampleTES Source as well as a field function for nonconstantstimulation currents for example tACS Finally TES inheritsfunctions from FEM to perform finite element computationsincluding fillEssBC to set Dirichlet boundary conditionscalcElmMatVec to assemble the finite element linear systemcoefficient matrix and load vector and the integrands andintegrands4side functions to evaluate the weak formula-tion volume and boundary integrals respectively

233 Weak Formulation Integration The weak formulationvolume integrals (2) are computed in the TESintegrandsfunction (Code 4) The Diffpack linear system assemblerautomatically calls this function as it iterates over thefinite elements in the computational grid Conductivityvalues for the current element are attained with a call to

the updateConductivityTensors function which deter-mines if isotropic or anisotropic conductivities are desiredand then populates the sigmamatrix accordingly

The source term 119891() over the current element isretrieved via a call to the valuePt function in a Source classThen the finite element basis functions for this element areiterated over and the weak formulation is computed Notethat in this implementation sigma is assumed to be diag-onal however this can be generalized with the incorporationof an additional loop Finally the coefficient matrix A andload vector b are updatedThe boundary integral in theweakformulation is computed similarly in the integrands4sidefunction and its contribution is incorporated into b

234 Multigrid Multigrid is a linear system solution algo-rithm that utilizes multiple computational grid resolutions to

Journal of Computational Medicine 7

class TES MG public TES

int no of grids

Handle(MGtools) mgtools

Set boundary condtion on grid level specified by space

virtual void mgFillEssBC (SpaceId space)

Code 5 New members of TES MG class definition The mgtools object references the Diffpack multigrid toolbox The no of grids integerstores the number of MG grid levels and the mgFillEssBC function sets the essential boundary condition on all grid levels

(a) Head surface (b) Brain region (c) View of sagittal cross section

Figure 2 Computational domain used in numerical simulations

achieve fast solution convergence [36] By performing justa few iterations on each grid and then changing betweenfiner and coarser grids large portions of the error areefficiently removed [37] In addition as a preconditioner tothe commonly used conjugate gradient (CG) method MG ishighly effective at solving linear systems that result fromfiniteelement based TES simulations [38] Two commonly usedMG cycles are the V-cycle and the W-cycle and identifyingthe optimal cycle type for a given PDE system in addition tootherMGparameters including the number of grid levels canbe challenging [38]

As a subclass of TES very few new data members andfunctions are needed in TES MG (Code 5) since the entiretyof TES is efficiently reused The new members in TES MGare a reference to the Diffpack multigrid toolbox mgtoolsand an integer representing the number of MG grid levelsno of grids Finally just one new function mgFillEssBCis needed to set the essential boundary condition (1b) on allgrid levels

24 Computational Tools Numerical simulations were per-formed on a three-dimensional mesh (Figure 2) generatedfrom human MRI images by the SimNIBS software package[35] The mesh contains the skin skull cerebral spinal fluid(CSF) gray matter (GM) and white matter (WM) tissues ofthe head Gmsh [39] enabled mesh visualization identifica-tion of electrode coordinates and grid conversion to a formsupported by Diffpack Electric potential and current densityresults were exported from Diffpack and visualized withParaView [40] and gnuplot [41] Anisotropic conductivitydata for theGMandWMregions are provided by SimNIBS in

a Matlab binary data file these data are accessed by theMatlabEngine [34] via the MatlabHelper object of theMatlabConductivity class (Code 1)

25 Computational Simulations Multiple simulations wereperformed with the TES framework Simulations wereselected to demonstrate the frameworkrsquos versatility and abilityto target medical biophysical and computational researchobjectives Finally to illustrate how alternative forms ofneurostimulation can be simulated with the same softwarewe show a trivial extension to the framework that enablessupport for DBS applications

Simulation 1 (comparison of isotropic and anisotropic con-ductivity data) Previous research suggests that incorporatinganisotropic rather than isotropic brain tissue conductivitydata is important formost accuratelymodeling TES electricalcurrent distribution [17 42] To evaluate the impact thatthese two conductivity representations have on simulationresults TES simulations were performed with isotropic andanisotropic data The three-dimensional domain shown inFigure 2 was used with approximately 28 million lineartetrahedra finite elements

Anode and cathode electrodes were positioned at C3 andC4 [43] respectively each with a surface area of approx-imately 16 cm2 and the anode electric current magnitudewas set to 10mA This montage has been used to stimulatethe motor cortex ipsilateral to the C3 anode electrode [4445] First isotropic electrical conductivities were assigned todifferent tissues skin = 0465 skull = 0010 CSF = 1654GM = 0276 and WM = 0126 each with units (Sm) [46]

8 Journal of Computational Medicine

05mm05mm05mm10mm

075mm

minus

+

Figure 3 Simulation 4 DBS electrode positioning (subthalamic nucleus) and dimensions Anode and cathode contacts are denoted with ldquo+rdquoand ldquominusrdquo symbols respectively

Then anisotropic conductivity data were used via theMatlabConductivity class as previously described (seeCode 1)

Simulation 2 (comparison of tDCS and HD-tDCS electrodemontages) High-definition TES electrodes have demon-strated a greater ability to focus its electrical current on atargeted brain region than traditional tDCS which uses twolarger electrodes [2 3] Using the same computational gridas Simulation 1 the current densities produced by tDCS andHD-tDCS were compared

For tDCS the anodewas positioned over C3 and the cath-ode over the contralateral supraorbital each with a surfacearea of approximately 16 cm2 In comparison high-definitionelectrodes each circular with a 12mm diameter were posi-tioned according to a 4 times 1 configuration a single anode waspositioned over C3 and four cathodes were placed approxi-mately 5 cm radially from the anode forming a square Bothof these montages are known to target the motor cortexregion ipsilateral to the anode electrode [15 47ndash50] Anodestimulation strength for each simulation was once again10mA and both utilized anisotropic conductivities

Simulation 3 (comparison of finite element linear systemsolvers) Finite element based simulations of TES requirethe solution of large systems of linear equations which canbecome a computational bottleneck for simulations per-formed on very fine meshes Therefore the effectiveness ofa TES simulation is directly related to the efficiency of thechosen linear solverTheCGmethod is ideal for solving theselinear systems and appropriate preconditioning can rapidlyaccelerate numerical results [36 38]

The numerical efficiency of the preconditioned CGmethod was evaluated with TES simulations on the three-dimensional volume mesh (Figure 2) with approximately

29 million linear tetrahedra finite elements and roughly 51million unknowns The anode was positioned at CZ with astimulation strength of 10mA and the cathode at OZ [12 51]Simulations were performed with the CG method precon-ditioned with symmetric successive overrelaxation (SSOR)relaxed incomplete LUdecomposition (RILU) andmultigridThe RILU relaxation parameter was set to 05 [27] The MGpreconditioner was simulated with a V-cycle with both twoand three grid levels and aW-cycle with three grid levelsTherelative residual convergence tolerance was set to 10minus8 for allnumerical experiments

Simulation 4 (impact of conductivity representation onDBS simulation results) The importance of incorporatinganisotropic conductivities in TES simulations suggests thataccurately simulating other neurostimulationmodalitiesmaydepend on this conductivity representation as well In thisnumerical experiment we compared DBS simulation resultsusing both isotropic and anisotropic conductivities A singleelectrode was positioned in the subthalamic nucleus (STN)the most commonly targeted location for DBS [52] The elec-trode is a simplified version of the Medtronic (Model 3387)electrode used in humans [53] The lower 50mm of the elec-trode was modeledThe anode is positioned 10mm from theelectrode tip and the cathode is separated by 05mm from theanode Both the anode and cathode are 05mm in height andthe overall electrode diameter was set to 075mm (Figure 3)The anode and cathode metal contacts were modeled asconductors by setting the electrical conductivities of theseregions to 106 (Sm) and the remaining electrode shaft wasmodeled as an insulator with conductivity equal to 10minus6 (Sm) [54] Because DBS electric current is proximal to the elec-trode [29 55] a 100mm times 40mm times 40mm subset of tissuearound the electrode was considered as the computationaldomain

Journal of Computational Medicine 9

class DBS Source public Source

DBS Source(TES data)

virtual dpreal valuePt(const Ptv(dpreal)amp x dpreal t = DUMMY)

dpreal DBS Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

if (4625 lt= x(1) ampamp x(1) lt= 5375 ampamp

4625 lt= x(2) ampamp x(2) lt= 5375 ampamp

3500 lt= x(3) ampamp x(3) lt= 4000 )

val = 0001

Code 6 DBS Source class definition and sample code from its valuePt function

00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(a) Isotropic conductivities00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(b) Anisotropic conductivities

Figure 4 Simulation 1 current density results viewed from above with the nasion facing up Anode was placed at C3 and cathode at C4

To simulate DBS with the existing TES software frame-work no existing code required modification Rather theonly addition was a new subclass of class Source that defines119891() (1a) for DBS in total less than ten lines of codewere added Code 6 displays this new subclass definitionSource DBS and highlights of its valuePt function imple-mentation which in this simplified scenario simply injects10mA of current from the anode contact into the surround-ing tissue In practice DBS stimulations are time-varyingpulses and differing stimulation frequencies impact GM andWM tissue conductivities [56] However when examiningelectric field dispersion around a DBS electrode as in thissimulation a constant-valued source term in (1a) can beutilized [57]

3 Results and Discussion

31 Simulation 1 Electric current density results on thesurface of the brain tissue are displayed in Figure 4 Viewing

perspective is from above the head with the nasion facingup As expected the largest electric current density valuesare attained near the anode and cathode locations Despitean overall similar pattern of electric current distribution thesimulated current densities particularly in the motor cortexipsilateral to the anode electrode are significantly differentbetween the isotropic and anisotropic simulations For exam-ple the maximal anisotropic current density value (0434 (Am2)) is approximately 182 higher than in the isotropic case(0367 (Am2)) Similar discrepancies are observed through-out the top surface of the brain including a substantialimpact on the paracentral lobule contralateral to the anodeIn addition these discrepancies extend to the GM and WMinteriors These results reinforce the importance of usinganisotropic conductivities to most accurately model TESadministrations and in addition showcase the capabilities ofthe object-oriented framework to support both isotropic andanisotropic TES simulations

10 Journal of Computational Medicine

Elec

tric

pot

entia

l (V

)

00

005

010

015

(a) tDCS electric potential00

0015

003

0045

Elec

tric

pot

entia

l (V

)

(b) HD-tDCS electric potential

00

015

030

045

Curr

ent d

ensit

y (A

m2)

(c) tDCS electric current density00

0033

0067

01

Curr

ent d

ensit

y (A

m2)

(d) HD-tDCS electric current density

Figure 5 Simulation 2 electric potential and current density results The tDCS montage positioned the anode at C3 and the cathode overthe contralateral supraorbital A 4 times 1 configuration was used for HD-tDCS with a single anode positioned over C3

32 Simulation 2 Electric potential and electric currentdensity results are displayed in Figure 5 The tDCS montageresults in a noticeably larger range of electric potential values(Figures 5(a) and 5(b)) However the focus of the tDCScurrent density on the targeted region in this case the motorcortex under C3 is much less than the HD-tDCS electrodemontage (Figures 5(c) and 5(d)) Specifically the brain tissueoutside of the square formed by the HD-tDCS cathodesis virtually unstimulated whereas tDCS results in a muchgreater electric current dispersion

One limitation of this HD-tDCS electrode arrangementis the lower concentration of electric current that reaches thebrain tissue Specifically the maximal electric current densityin the brain fromHD-tDCS is just approximately 23 of thatachieved with traditional tDCS The culprit for this effect isthe shunting of the electric current around the poorly con-ducting skull the HD-tDCS montage used in this simulationyields a minuscule amount of current that penetrates theskull to reach the CSF and brain tissues (Figure 6) Potentialremedies for this behavior are a greater anode stimulation orpositioning the cathodes at greater distances from the anode[3]

This simulation demonstrates the frameworkrsquos ability tosupport varying TES electrode montages including high-definition electrode configurations Results of this simulation

Curr

ent d

ensit

y (A

m2)

00

05

10

15

Figure 6 Simulation 2 HD-tDCS electric current density Crosssection is through two diagonally positioned cathodes

corroborate that HD-tDCS offers greater electric currentfocality however its net stimulation of brain tissue is poten-tially much lower than tDCS

33 Simulation 3 Electric potential and current densityresults on the head surface are displayed in Figure 7 Viewing

Journal of Computational Medicine 11

00

004

008

012

Elec

tric

pot

entia

l (V

)

(a) Electric potential00

05

10

15

20

Curr

ent d

ensit

y (A

m2)

(b) Current density

Figure 7 Simulation 3 electric potential and current density results viewed from the back of the head The anode was positioned at CZ andthe cathode at OZ

perspective is frombehind the head and as anticipatedmaxi-mal andminimal electric potential and current density valuesoccur at the anode and cathode respectivelyThe shunting ofthe electric current around the skull due to its low electricalconductivity results in the segregated current density patternaround the anode and cathode centers (Figure 7(b)) Thisphenomenon has been previously observed [1] however itis highlighted by the very fine mesh resolution used in thissimulation

Figure 8 displays convergence history curves and perfor-mance metrics for each CG preconditioning strategy Withno preconditioning the CG method will eventually conver-gence but will accomplish this extremely slowly requiringmore than 6 hours to solve the linear system The SSORand RILU preconditioners demonstrate comparable perfor-mances both in solution time and number of iterationsMultigrid preconditioning with two grid levels has far feweriterations with 166 than both SSOR and RILU and yet has agreater run time This observation can be explained by thefact that a single iteration of MG has embedded iterationson the different mesh refinements [37] However three-grid-level MG noticeably accelerates convergence rates with boththe V- and W-cycles outperforming the other precondition-ers Three-grid-level MG with a W-cycle pattern has slightlyfewer iterations than its corresponding V-cycle yet this V-cycle preconditioner is approximately 113 faster

The ability of the framework to support numerically ori-ented TES research is presented in this simulation exampleThe results indicate that the CG method combined with anappropriately configured MG preconditioner is highly effi-cient in solving the linear systems produced in TES compu-tational simulations

34 Simulation 4 Figure 9 displays the electric currentdensities produced by the DBS electrode using isotropic(Figure 9(a)) and anisotropic (Figure 9(b)) conductivitiesIn both cases the majority of the current density is prox-imal to the electrode indicating that accurate placementof electrodes in DBS procedures is paramount [56] While

1

0

minus1

minus2

minus3

minus4

minus5

minus6

minus7

minus8

minus9

Iterations0 100 200 300 400 500 600 700 800 900

SSORRILUMG 2-V

MG 3-VMG 3-W

log10(r

elat

ive r

esid

ual)

(a) Convergence history

Preconditioner Iterations Time (min)NoneSSORRILUMG 2-grid V-cycleMG 3-grid V-cycleMG 3-grid W-cycle

gt5000 gt360

860

885

166

113

106

1134

1175

1264

574647

(b) Numerical iterations and linear system solve time Boldfacevalues indicate best convergence results

Figure 8 Convergence performances of the preconditioned conju-gate gradient methods

themaximal current densities of the isotropic and anisotropicscenarios are similar other differences between them areobservable First the current density around the electrodeis nonsymmetric in the anisotropic case as is expectedwith directionally dependent conductivity data In addition

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 4: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

4 Journal of Computational Medicine

class Conductivity

Conductivity()

virtual simConductivity()

Load tensor conductivities from data files

virtual void loadConductivities (Stringamp fileName)

Get ith component of conductivity tensor at pt (xyz)

virtual double getConductivity (int i int x int y int z)

class MatlabConductivity public Conductivity

MatlabConductivity()

virtual simMatlabConductivity()

Inherited from Conductivity

virtual void loadConductivities(Stringamp fileName)

virtual double getConductivity(int i int x int y int z)

MatlabHelper mh Mangage interface with the MatlabEngine

mxArray ct Matrix with conductivity tensor data

void MatlabConductivityloadConductivities(Stringamp fileName)

String name = load( + fileName + )engEvalString(mh-gtep namec str())

ct = engGetVariable(mh-gtep ct)

Code 1 Class definitions for tissue conductivity data Class Conductivity provides general function names that is loadConductivitiesand getConductivity The MatlabConductivity subclass implements these functions for a particular data source For example itsloadConductivities function loads a Matlab anisotropic conductivity data source into the ctmatrix for use in a simulation

The Conductivity-MatlabConductivity relation-ship demonstrates the advantages of object-oriented inher-itance and polymorphism Conductivity is used to definefunction names common to all conductivity data sourcesand serves as the bridge between these repositories and theframework Polymorphism permits the MatlabConductiv-ity subclass to implement specific loadConductivitiesand getConductivity functionality for its particular dataformat Code within the Conductivity class and all otherframework classes does not dependent on these subclassimplementations Thus alternative conductivity data sourcescan be easily incorporated into the framework as a subclassof Conductivity in an identical fashion requiring nomodification to any other framework component

232 Source Term Class Source is a software abstractionof the 119891() source term (1a) and like Conductivity definesbasic functionality to be implemented in subclasses (Code 2)Source inherits the Diffpack class FieldFunc which allowsa scalar function to be defined over the domain Differentsubclass implementations of the valuePt function can beused to model different neurostimulation modalities ForTES valuePt in class TES Source simply returns zero since119891() = 0 in this case (Code 2)

Main TES ClassClass TES is themain class in the frameworkCode 3 presents the key elements of this class which containsnumerous objects functions and Diffpack concepts ClassTES inherits the Diffpack FEM class giving it access to finiteelement data structures and functionality Handle objectswhich are pointers in Diffpack that includememorymanage-ment features are defined for the computational grid gridand electric potential and current density solution results uand currDensity respectively

Several other class members are needed to implementTES simulations Variables to store boundary condition val-ues are included as well as the anodes and cathodes vectorsto store electrode information The vector isoSigma andmatrix sigma store isotropic and anisotropic conductivitydata and the choice of conductivity representation is deter-mined by a user via the isotropic boolean variable Themc data member is a reference to the Conductivity classproviding an interface to conductivity data Note that mc istype Conductivity and not MatlabConductivity Themc object can therefore use the loadConductivitiesand getConductivity functions of any Conductivitysubclass including MatlabConductivity This designapproach allows new Conductivity subclasses to be definedand utilized without the need to modify code in class TES

Journal of Computational Medicine 5

class Source public FieldFunc

TES data Provides access to TES class members

Source ()

virtual dpreal valuePt Source term value at pt x Abstract function

(const Ptv(dpreal)amp x dpreal t = DUMMY) = 0

dpreal TES Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

return val

Code 2 Source term class definitions The TES Source subclass of Source enables TES simulations by defining its valuePt function toreturn a value of zero at all points

class TES public FEM

DATA TYPES

Handle(GridFE) grid Underlying finite element grid

Handle(FieldFE) u Electric potential over grid

Handle(FieldsFE) currDensity Electric Current density over grid

dpreal dirichlet val1 Constant phi value at a boundary

dpreal dirichlet val2 Constant phi value at boundary

dpreal robin U0 Constants for Neumann boundary condition

vectorltElectrodegt anodes Anode electrodes

vectorltElectrodegt cathodes Cathode electrodes

bool isotropic Isotrpoic or anisotropic bool control

Vec(dpreal) isoSigma Isotropic brain tissue conductance values

MatSimple(dpreal) sigma Anisotropic conductivity tensor matrix

Conductivity mc Interface class for anisotropic conductivities

Handle(FieldFunc) source Source term for initializing f(x)

Handle(FieldFunc) alternatingStim Object to model non-direct TES ie tACS

FUNCTIONS

Standard finite element functions inherited from class FEM

virtual void fillEssBC () Set dirichlet boundary conditions

virtual void calcElmMatVec Compute FE coefficient matrix and load vector

(int e ElmMatVecamp elmat FiniteElementamp fe)

virtual void integrands Implement weak formulation integrand

(ElmMatVecamp elmat const FiniteElementamp fe)

virtual void integrands4side Neumann boundary integral

(int side int boind ElmMatVecamp elmat const FiniteElementamp fe)

Code 3 Main elements within the TES class Handles are Diffpack pointers that include memory management features The class definitioncontains a Handle for the computational grid (grid) and electric potential (u) and current density (currDensity) solution results Nextvariables store boundary condition values and anode (anodes) and cathode (cathodes) electrode information Support for both isotropicand anisotropic conductivity data is provided as well as functions for source and nonconstant anode stimulation Functions inherited fromFEM are required to perform finite element calculations

6 Journal of Computational Medicine

void TES integrands (ElmMatVecamp elmat const FiniteElementamp fe)

int ijq Loop control variables

const int nbf = fegetNoBasisFunc() no of nodesbasis functions

dpreal detJxW = fedetJxW() Numerical integration weight

const int nsd = fegetNoSpaceDim() Number of spatial dimensions

Get conductivity tensor for the current element

updateConductivityTensors(fe)

Get a point in the global domain represented by elemnt fe

Ptv(NUMT) x(nsd)

fegetGlobalEvalPt(x)

Get the source term f(x) for this element

dpreal f val

if (sourceok())

f val = source-gtvaluePt(x)

else f val = 0

Compute weak formulation

dpreal gradNi gradNj

for (i = 1 i lt= nbf i++)

for (j = 1 j lt= nbf j++)

gradNi gradNj = 0

for (q = 1 q lt= nsd q++)

Compute inner product of grad(N i) and grad(N j)

gradNi gradNj += sigma(qq) fedN(iq) fedN(jq)

Update linear system coefficient matrix

elmatA(ij) += gradNi gradNjdetJxW

Update linear system RHS (load vector)

elmatb(i) += feN(i)f valdetJxW

Code 4 TES class integrands function for computing weak formulation volume integrals Conductivity and source term values for finiteelement fe are retrieved with calls to the updateConductivityTensors and source valuePt functions Finite element basis functions arethen iterated to compute the volume integrals

There is also a reference to a Source object for exampleTES Source as well as a field function for nonconstantstimulation currents for example tACS Finally TES inheritsfunctions from FEM to perform finite element computationsincluding fillEssBC to set Dirichlet boundary conditionscalcElmMatVec to assemble the finite element linear systemcoefficient matrix and load vector and the integrands andintegrands4side functions to evaluate the weak formula-tion volume and boundary integrals respectively

233 Weak Formulation Integration The weak formulationvolume integrals (2) are computed in the TESintegrandsfunction (Code 4) The Diffpack linear system assemblerautomatically calls this function as it iterates over thefinite elements in the computational grid Conductivityvalues for the current element are attained with a call to

the updateConductivityTensors function which deter-mines if isotropic or anisotropic conductivities are desiredand then populates the sigmamatrix accordingly

The source term 119891() over the current element isretrieved via a call to the valuePt function in a Source classThen the finite element basis functions for this element areiterated over and the weak formulation is computed Notethat in this implementation sigma is assumed to be diag-onal however this can be generalized with the incorporationof an additional loop Finally the coefficient matrix A andload vector b are updatedThe boundary integral in theweakformulation is computed similarly in the integrands4sidefunction and its contribution is incorporated into b

234 Multigrid Multigrid is a linear system solution algo-rithm that utilizes multiple computational grid resolutions to

Journal of Computational Medicine 7

class TES MG public TES

int no of grids

Handle(MGtools) mgtools

Set boundary condtion on grid level specified by space

virtual void mgFillEssBC (SpaceId space)

Code 5 New members of TES MG class definition The mgtools object references the Diffpack multigrid toolbox The no of grids integerstores the number of MG grid levels and the mgFillEssBC function sets the essential boundary condition on all grid levels

(a) Head surface (b) Brain region (c) View of sagittal cross section

Figure 2 Computational domain used in numerical simulations

achieve fast solution convergence [36] By performing justa few iterations on each grid and then changing betweenfiner and coarser grids large portions of the error areefficiently removed [37] In addition as a preconditioner tothe commonly used conjugate gradient (CG) method MG ishighly effective at solving linear systems that result fromfiniteelement based TES simulations [38] Two commonly usedMG cycles are the V-cycle and the W-cycle and identifyingthe optimal cycle type for a given PDE system in addition tootherMGparameters including the number of grid levels canbe challenging [38]

As a subclass of TES very few new data members andfunctions are needed in TES MG (Code 5) since the entiretyof TES is efficiently reused The new members in TES MGare a reference to the Diffpack multigrid toolbox mgtoolsand an integer representing the number of MG grid levelsno of grids Finally just one new function mgFillEssBCis needed to set the essential boundary condition (1b) on allgrid levels

24 Computational Tools Numerical simulations were per-formed on a three-dimensional mesh (Figure 2) generatedfrom human MRI images by the SimNIBS software package[35] The mesh contains the skin skull cerebral spinal fluid(CSF) gray matter (GM) and white matter (WM) tissues ofthe head Gmsh [39] enabled mesh visualization identifica-tion of electrode coordinates and grid conversion to a formsupported by Diffpack Electric potential and current densityresults were exported from Diffpack and visualized withParaView [40] and gnuplot [41] Anisotropic conductivitydata for theGMandWMregions are provided by SimNIBS in

a Matlab binary data file these data are accessed by theMatlabEngine [34] via the MatlabHelper object of theMatlabConductivity class (Code 1)

25 Computational Simulations Multiple simulations wereperformed with the TES framework Simulations wereselected to demonstrate the frameworkrsquos versatility and abilityto target medical biophysical and computational researchobjectives Finally to illustrate how alternative forms ofneurostimulation can be simulated with the same softwarewe show a trivial extension to the framework that enablessupport for DBS applications

Simulation 1 (comparison of isotropic and anisotropic con-ductivity data) Previous research suggests that incorporatinganisotropic rather than isotropic brain tissue conductivitydata is important formost accuratelymodeling TES electricalcurrent distribution [17 42] To evaluate the impact thatthese two conductivity representations have on simulationresults TES simulations were performed with isotropic andanisotropic data The three-dimensional domain shown inFigure 2 was used with approximately 28 million lineartetrahedra finite elements

Anode and cathode electrodes were positioned at C3 andC4 [43] respectively each with a surface area of approx-imately 16 cm2 and the anode electric current magnitudewas set to 10mA This montage has been used to stimulatethe motor cortex ipsilateral to the C3 anode electrode [4445] First isotropic electrical conductivities were assigned todifferent tissues skin = 0465 skull = 0010 CSF = 1654GM = 0276 and WM = 0126 each with units (Sm) [46]

8 Journal of Computational Medicine

05mm05mm05mm10mm

075mm

minus

+

Figure 3 Simulation 4 DBS electrode positioning (subthalamic nucleus) and dimensions Anode and cathode contacts are denoted with ldquo+rdquoand ldquominusrdquo symbols respectively

Then anisotropic conductivity data were used via theMatlabConductivity class as previously described (seeCode 1)

Simulation 2 (comparison of tDCS and HD-tDCS electrodemontages) High-definition TES electrodes have demon-strated a greater ability to focus its electrical current on atargeted brain region than traditional tDCS which uses twolarger electrodes [2 3] Using the same computational gridas Simulation 1 the current densities produced by tDCS andHD-tDCS were compared

For tDCS the anodewas positioned over C3 and the cath-ode over the contralateral supraorbital each with a surfacearea of approximately 16 cm2 In comparison high-definitionelectrodes each circular with a 12mm diameter were posi-tioned according to a 4 times 1 configuration a single anode waspositioned over C3 and four cathodes were placed approxi-mately 5 cm radially from the anode forming a square Bothof these montages are known to target the motor cortexregion ipsilateral to the anode electrode [15 47ndash50] Anodestimulation strength for each simulation was once again10mA and both utilized anisotropic conductivities

Simulation 3 (comparison of finite element linear systemsolvers) Finite element based simulations of TES requirethe solution of large systems of linear equations which canbecome a computational bottleneck for simulations per-formed on very fine meshes Therefore the effectiveness ofa TES simulation is directly related to the efficiency of thechosen linear solverTheCGmethod is ideal for solving theselinear systems and appropriate preconditioning can rapidlyaccelerate numerical results [36 38]

The numerical efficiency of the preconditioned CGmethod was evaluated with TES simulations on the three-dimensional volume mesh (Figure 2) with approximately

29 million linear tetrahedra finite elements and roughly 51million unknowns The anode was positioned at CZ with astimulation strength of 10mA and the cathode at OZ [12 51]Simulations were performed with the CG method precon-ditioned with symmetric successive overrelaxation (SSOR)relaxed incomplete LUdecomposition (RILU) andmultigridThe RILU relaxation parameter was set to 05 [27] The MGpreconditioner was simulated with a V-cycle with both twoand three grid levels and aW-cycle with three grid levelsTherelative residual convergence tolerance was set to 10minus8 for allnumerical experiments

Simulation 4 (impact of conductivity representation onDBS simulation results) The importance of incorporatinganisotropic conductivities in TES simulations suggests thataccurately simulating other neurostimulationmodalitiesmaydepend on this conductivity representation as well In thisnumerical experiment we compared DBS simulation resultsusing both isotropic and anisotropic conductivities A singleelectrode was positioned in the subthalamic nucleus (STN)the most commonly targeted location for DBS [52] The elec-trode is a simplified version of the Medtronic (Model 3387)electrode used in humans [53] The lower 50mm of the elec-trode was modeledThe anode is positioned 10mm from theelectrode tip and the cathode is separated by 05mm from theanode Both the anode and cathode are 05mm in height andthe overall electrode diameter was set to 075mm (Figure 3)The anode and cathode metal contacts were modeled asconductors by setting the electrical conductivities of theseregions to 106 (Sm) and the remaining electrode shaft wasmodeled as an insulator with conductivity equal to 10minus6 (Sm) [54] Because DBS electric current is proximal to the elec-trode [29 55] a 100mm times 40mm times 40mm subset of tissuearound the electrode was considered as the computationaldomain

Journal of Computational Medicine 9

class DBS Source public Source

DBS Source(TES data)

virtual dpreal valuePt(const Ptv(dpreal)amp x dpreal t = DUMMY)

dpreal DBS Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

if (4625 lt= x(1) ampamp x(1) lt= 5375 ampamp

4625 lt= x(2) ampamp x(2) lt= 5375 ampamp

3500 lt= x(3) ampamp x(3) lt= 4000 )

val = 0001

Code 6 DBS Source class definition and sample code from its valuePt function

00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(a) Isotropic conductivities00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(b) Anisotropic conductivities

Figure 4 Simulation 1 current density results viewed from above with the nasion facing up Anode was placed at C3 and cathode at C4

To simulate DBS with the existing TES software frame-work no existing code required modification Rather theonly addition was a new subclass of class Source that defines119891() (1a) for DBS in total less than ten lines of codewere added Code 6 displays this new subclass definitionSource DBS and highlights of its valuePt function imple-mentation which in this simplified scenario simply injects10mA of current from the anode contact into the surround-ing tissue In practice DBS stimulations are time-varyingpulses and differing stimulation frequencies impact GM andWM tissue conductivities [56] However when examiningelectric field dispersion around a DBS electrode as in thissimulation a constant-valued source term in (1a) can beutilized [57]

3 Results and Discussion

31 Simulation 1 Electric current density results on thesurface of the brain tissue are displayed in Figure 4 Viewing

perspective is from above the head with the nasion facingup As expected the largest electric current density valuesare attained near the anode and cathode locations Despitean overall similar pattern of electric current distribution thesimulated current densities particularly in the motor cortexipsilateral to the anode electrode are significantly differentbetween the isotropic and anisotropic simulations For exam-ple the maximal anisotropic current density value (0434 (Am2)) is approximately 182 higher than in the isotropic case(0367 (Am2)) Similar discrepancies are observed through-out the top surface of the brain including a substantialimpact on the paracentral lobule contralateral to the anodeIn addition these discrepancies extend to the GM and WMinteriors These results reinforce the importance of usinganisotropic conductivities to most accurately model TESadministrations and in addition showcase the capabilities ofthe object-oriented framework to support both isotropic andanisotropic TES simulations

10 Journal of Computational Medicine

Elec

tric

pot

entia

l (V

)

00

005

010

015

(a) tDCS electric potential00

0015

003

0045

Elec

tric

pot

entia

l (V

)

(b) HD-tDCS electric potential

00

015

030

045

Curr

ent d

ensit

y (A

m2)

(c) tDCS electric current density00

0033

0067

01

Curr

ent d

ensit

y (A

m2)

(d) HD-tDCS electric current density

Figure 5 Simulation 2 electric potential and current density results The tDCS montage positioned the anode at C3 and the cathode overthe contralateral supraorbital A 4 times 1 configuration was used for HD-tDCS with a single anode positioned over C3

32 Simulation 2 Electric potential and electric currentdensity results are displayed in Figure 5 The tDCS montageresults in a noticeably larger range of electric potential values(Figures 5(a) and 5(b)) However the focus of the tDCScurrent density on the targeted region in this case the motorcortex under C3 is much less than the HD-tDCS electrodemontage (Figures 5(c) and 5(d)) Specifically the brain tissueoutside of the square formed by the HD-tDCS cathodesis virtually unstimulated whereas tDCS results in a muchgreater electric current dispersion

One limitation of this HD-tDCS electrode arrangementis the lower concentration of electric current that reaches thebrain tissue Specifically the maximal electric current densityin the brain fromHD-tDCS is just approximately 23 of thatachieved with traditional tDCS The culprit for this effect isthe shunting of the electric current around the poorly con-ducting skull the HD-tDCS montage used in this simulationyields a minuscule amount of current that penetrates theskull to reach the CSF and brain tissues (Figure 6) Potentialremedies for this behavior are a greater anode stimulation orpositioning the cathodes at greater distances from the anode[3]

This simulation demonstrates the frameworkrsquos ability tosupport varying TES electrode montages including high-definition electrode configurations Results of this simulation

Curr

ent d

ensit

y (A

m2)

00

05

10

15

Figure 6 Simulation 2 HD-tDCS electric current density Crosssection is through two diagonally positioned cathodes

corroborate that HD-tDCS offers greater electric currentfocality however its net stimulation of brain tissue is poten-tially much lower than tDCS

33 Simulation 3 Electric potential and current densityresults on the head surface are displayed in Figure 7 Viewing

Journal of Computational Medicine 11

00

004

008

012

Elec

tric

pot

entia

l (V

)

(a) Electric potential00

05

10

15

20

Curr

ent d

ensit

y (A

m2)

(b) Current density

Figure 7 Simulation 3 electric potential and current density results viewed from the back of the head The anode was positioned at CZ andthe cathode at OZ

perspective is frombehind the head and as anticipatedmaxi-mal andminimal electric potential and current density valuesoccur at the anode and cathode respectivelyThe shunting ofthe electric current around the skull due to its low electricalconductivity results in the segregated current density patternaround the anode and cathode centers (Figure 7(b)) Thisphenomenon has been previously observed [1] however itis highlighted by the very fine mesh resolution used in thissimulation

Figure 8 displays convergence history curves and perfor-mance metrics for each CG preconditioning strategy Withno preconditioning the CG method will eventually conver-gence but will accomplish this extremely slowly requiringmore than 6 hours to solve the linear system The SSORand RILU preconditioners demonstrate comparable perfor-mances both in solution time and number of iterationsMultigrid preconditioning with two grid levels has far feweriterations with 166 than both SSOR and RILU and yet has agreater run time This observation can be explained by thefact that a single iteration of MG has embedded iterationson the different mesh refinements [37] However three-grid-level MG noticeably accelerates convergence rates with boththe V- and W-cycles outperforming the other precondition-ers Three-grid-level MG with a W-cycle pattern has slightlyfewer iterations than its corresponding V-cycle yet this V-cycle preconditioner is approximately 113 faster

The ability of the framework to support numerically ori-ented TES research is presented in this simulation exampleThe results indicate that the CG method combined with anappropriately configured MG preconditioner is highly effi-cient in solving the linear systems produced in TES compu-tational simulations

34 Simulation 4 Figure 9 displays the electric currentdensities produced by the DBS electrode using isotropic(Figure 9(a)) and anisotropic (Figure 9(b)) conductivitiesIn both cases the majority of the current density is prox-imal to the electrode indicating that accurate placementof electrodes in DBS procedures is paramount [56] While

1

0

minus1

minus2

minus3

minus4

minus5

minus6

minus7

minus8

minus9

Iterations0 100 200 300 400 500 600 700 800 900

SSORRILUMG 2-V

MG 3-VMG 3-W

log10(r

elat

ive r

esid

ual)

(a) Convergence history

Preconditioner Iterations Time (min)NoneSSORRILUMG 2-grid V-cycleMG 3-grid V-cycleMG 3-grid W-cycle

gt5000 gt360

860

885

166

113

106

1134

1175

1264

574647

(b) Numerical iterations and linear system solve time Boldfacevalues indicate best convergence results

Figure 8 Convergence performances of the preconditioned conju-gate gradient methods

themaximal current densities of the isotropic and anisotropicscenarios are similar other differences between them areobservable First the current density around the electrodeis nonsymmetric in the anisotropic case as is expectedwith directionally dependent conductivity data In addition

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 5: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

Journal of Computational Medicine 5

class Source public FieldFunc

TES data Provides access to TES class members

Source ()

virtual dpreal valuePt Source term value at pt x Abstract function

(const Ptv(dpreal)amp x dpreal t = DUMMY) = 0

dpreal TES Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

return val

Code 2 Source term class definitions The TES Source subclass of Source enables TES simulations by defining its valuePt function toreturn a value of zero at all points

class TES public FEM

DATA TYPES

Handle(GridFE) grid Underlying finite element grid

Handle(FieldFE) u Electric potential over grid

Handle(FieldsFE) currDensity Electric Current density over grid

dpreal dirichlet val1 Constant phi value at a boundary

dpreal dirichlet val2 Constant phi value at boundary

dpreal robin U0 Constants for Neumann boundary condition

vectorltElectrodegt anodes Anode electrodes

vectorltElectrodegt cathodes Cathode electrodes

bool isotropic Isotrpoic or anisotropic bool control

Vec(dpreal) isoSigma Isotropic brain tissue conductance values

MatSimple(dpreal) sigma Anisotropic conductivity tensor matrix

Conductivity mc Interface class for anisotropic conductivities

Handle(FieldFunc) source Source term for initializing f(x)

Handle(FieldFunc) alternatingStim Object to model non-direct TES ie tACS

FUNCTIONS

Standard finite element functions inherited from class FEM

virtual void fillEssBC () Set dirichlet boundary conditions

virtual void calcElmMatVec Compute FE coefficient matrix and load vector

(int e ElmMatVecamp elmat FiniteElementamp fe)

virtual void integrands Implement weak formulation integrand

(ElmMatVecamp elmat const FiniteElementamp fe)

virtual void integrands4side Neumann boundary integral

(int side int boind ElmMatVecamp elmat const FiniteElementamp fe)

Code 3 Main elements within the TES class Handles are Diffpack pointers that include memory management features The class definitioncontains a Handle for the computational grid (grid) and electric potential (u) and current density (currDensity) solution results Nextvariables store boundary condition values and anode (anodes) and cathode (cathodes) electrode information Support for both isotropicand anisotropic conductivity data is provided as well as functions for source and nonconstant anode stimulation Functions inherited fromFEM are required to perform finite element calculations

6 Journal of Computational Medicine

void TES integrands (ElmMatVecamp elmat const FiniteElementamp fe)

int ijq Loop control variables

const int nbf = fegetNoBasisFunc() no of nodesbasis functions

dpreal detJxW = fedetJxW() Numerical integration weight

const int nsd = fegetNoSpaceDim() Number of spatial dimensions

Get conductivity tensor for the current element

updateConductivityTensors(fe)

Get a point in the global domain represented by elemnt fe

Ptv(NUMT) x(nsd)

fegetGlobalEvalPt(x)

Get the source term f(x) for this element

dpreal f val

if (sourceok())

f val = source-gtvaluePt(x)

else f val = 0

Compute weak formulation

dpreal gradNi gradNj

for (i = 1 i lt= nbf i++)

for (j = 1 j lt= nbf j++)

gradNi gradNj = 0

for (q = 1 q lt= nsd q++)

Compute inner product of grad(N i) and grad(N j)

gradNi gradNj += sigma(qq) fedN(iq) fedN(jq)

Update linear system coefficient matrix

elmatA(ij) += gradNi gradNjdetJxW

Update linear system RHS (load vector)

elmatb(i) += feN(i)f valdetJxW

Code 4 TES class integrands function for computing weak formulation volume integrals Conductivity and source term values for finiteelement fe are retrieved with calls to the updateConductivityTensors and source valuePt functions Finite element basis functions arethen iterated to compute the volume integrals

There is also a reference to a Source object for exampleTES Source as well as a field function for nonconstantstimulation currents for example tACS Finally TES inheritsfunctions from FEM to perform finite element computationsincluding fillEssBC to set Dirichlet boundary conditionscalcElmMatVec to assemble the finite element linear systemcoefficient matrix and load vector and the integrands andintegrands4side functions to evaluate the weak formula-tion volume and boundary integrals respectively

233 Weak Formulation Integration The weak formulationvolume integrals (2) are computed in the TESintegrandsfunction (Code 4) The Diffpack linear system assemblerautomatically calls this function as it iterates over thefinite elements in the computational grid Conductivityvalues for the current element are attained with a call to

the updateConductivityTensors function which deter-mines if isotropic or anisotropic conductivities are desiredand then populates the sigmamatrix accordingly

The source term 119891() over the current element isretrieved via a call to the valuePt function in a Source classThen the finite element basis functions for this element areiterated over and the weak formulation is computed Notethat in this implementation sigma is assumed to be diag-onal however this can be generalized with the incorporationof an additional loop Finally the coefficient matrix A andload vector b are updatedThe boundary integral in theweakformulation is computed similarly in the integrands4sidefunction and its contribution is incorporated into b

234 Multigrid Multigrid is a linear system solution algo-rithm that utilizes multiple computational grid resolutions to

Journal of Computational Medicine 7

class TES MG public TES

int no of grids

Handle(MGtools) mgtools

Set boundary condtion on grid level specified by space

virtual void mgFillEssBC (SpaceId space)

Code 5 New members of TES MG class definition The mgtools object references the Diffpack multigrid toolbox The no of grids integerstores the number of MG grid levels and the mgFillEssBC function sets the essential boundary condition on all grid levels

(a) Head surface (b) Brain region (c) View of sagittal cross section

Figure 2 Computational domain used in numerical simulations

achieve fast solution convergence [36] By performing justa few iterations on each grid and then changing betweenfiner and coarser grids large portions of the error areefficiently removed [37] In addition as a preconditioner tothe commonly used conjugate gradient (CG) method MG ishighly effective at solving linear systems that result fromfiniteelement based TES simulations [38] Two commonly usedMG cycles are the V-cycle and the W-cycle and identifyingthe optimal cycle type for a given PDE system in addition tootherMGparameters including the number of grid levels canbe challenging [38]

As a subclass of TES very few new data members andfunctions are needed in TES MG (Code 5) since the entiretyof TES is efficiently reused The new members in TES MGare a reference to the Diffpack multigrid toolbox mgtoolsand an integer representing the number of MG grid levelsno of grids Finally just one new function mgFillEssBCis needed to set the essential boundary condition (1b) on allgrid levels

24 Computational Tools Numerical simulations were per-formed on a three-dimensional mesh (Figure 2) generatedfrom human MRI images by the SimNIBS software package[35] The mesh contains the skin skull cerebral spinal fluid(CSF) gray matter (GM) and white matter (WM) tissues ofthe head Gmsh [39] enabled mesh visualization identifica-tion of electrode coordinates and grid conversion to a formsupported by Diffpack Electric potential and current densityresults were exported from Diffpack and visualized withParaView [40] and gnuplot [41] Anisotropic conductivitydata for theGMandWMregions are provided by SimNIBS in

a Matlab binary data file these data are accessed by theMatlabEngine [34] via the MatlabHelper object of theMatlabConductivity class (Code 1)

25 Computational Simulations Multiple simulations wereperformed with the TES framework Simulations wereselected to demonstrate the frameworkrsquos versatility and abilityto target medical biophysical and computational researchobjectives Finally to illustrate how alternative forms ofneurostimulation can be simulated with the same softwarewe show a trivial extension to the framework that enablessupport for DBS applications

Simulation 1 (comparison of isotropic and anisotropic con-ductivity data) Previous research suggests that incorporatinganisotropic rather than isotropic brain tissue conductivitydata is important formost accuratelymodeling TES electricalcurrent distribution [17 42] To evaluate the impact thatthese two conductivity representations have on simulationresults TES simulations were performed with isotropic andanisotropic data The three-dimensional domain shown inFigure 2 was used with approximately 28 million lineartetrahedra finite elements

Anode and cathode electrodes were positioned at C3 andC4 [43] respectively each with a surface area of approx-imately 16 cm2 and the anode electric current magnitudewas set to 10mA This montage has been used to stimulatethe motor cortex ipsilateral to the C3 anode electrode [4445] First isotropic electrical conductivities were assigned todifferent tissues skin = 0465 skull = 0010 CSF = 1654GM = 0276 and WM = 0126 each with units (Sm) [46]

8 Journal of Computational Medicine

05mm05mm05mm10mm

075mm

minus

+

Figure 3 Simulation 4 DBS electrode positioning (subthalamic nucleus) and dimensions Anode and cathode contacts are denoted with ldquo+rdquoand ldquominusrdquo symbols respectively

Then anisotropic conductivity data were used via theMatlabConductivity class as previously described (seeCode 1)

Simulation 2 (comparison of tDCS and HD-tDCS electrodemontages) High-definition TES electrodes have demon-strated a greater ability to focus its electrical current on atargeted brain region than traditional tDCS which uses twolarger electrodes [2 3] Using the same computational gridas Simulation 1 the current densities produced by tDCS andHD-tDCS were compared

For tDCS the anodewas positioned over C3 and the cath-ode over the contralateral supraorbital each with a surfacearea of approximately 16 cm2 In comparison high-definitionelectrodes each circular with a 12mm diameter were posi-tioned according to a 4 times 1 configuration a single anode waspositioned over C3 and four cathodes were placed approxi-mately 5 cm radially from the anode forming a square Bothof these montages are known to target the motor cortexregion ipsilateral to the anode electrode [15 47ndash50] Anodestimulation strength for each simulation was once again10mA and both utilized anisotropic conductivities

Simulation 3 (comparison of finite element linear systemsolvers) Finite element based simulations of TES requirethe solution of large systems of linear equations which canbecome a computational bottleneck for simulations per-formed on very fine meshes Therefore the effectiveness ofa TES simulation is directly related to the efficiency of thechosen linear solverTheCGmethod is ideal for solving theselinear systems and appropriate preconditioning can rapidlyaccelerate numerical results [36 38]

The numerical efficiency of the preconditioned CGmethod was evaluated with TES simulations on the three-dimensional volume mesh (Figure 2) with approximately

29 million linear tetrahedra finite elements and roughly 51million unknowns The anode was positioned at CZ with astimulation strength of 10mA and the cathode at OZ [12 51]Simulations were performed with the CG method precon-ditioned with symmetric successive overrelaxation (SSOR)relaxed incomplete LUdecomposition (RILU) andmultigridThe RILU relaxation parameter was set to 05 [27] The MGpreconditioner was simulated with a V-cycle with both twoand three grid levels and aW-cycle with three grid levelsTherelative residual convergence tolerance was set to 10minus8 for allnumerical experiments

Simulation 4 (impact of conductivity representation onDBS simulation results) The importance of incorporatinganisotropic conductivities in TES simulations suggests thataccurately simulating other neurostimulationmodalitiesmaydepend on this conductivity representation as well In thisnumerical experiment we compared DBS simulation resultsusing both isotropic and anisotropic conductivities A singleelectrode was positioned in the subthalamic nucleus (STN)the most commonly targeted location for DBS [52] The elec-trode is a simplified version of the Medtronic (Model 3387)electrode used in humans [53] The lower 50mm of the elec-trode was modeledThe anode is positioned 10mm from theelectrode tip and the cathode is separated by 05mm from theanode Both the anode and cathode are 05mm in height andthe overall electrode diameter was set to 075mm (Figure 3)The anode and cathode metal contacts were modeled asconductors by setting the electrical conductivities of theseregions to 106 (Sm) and the remaining electrode shaft wasmodeled as an insulator with conductivity equal to 10minus6 (Sm) [54] Because DBS electric current is proximal to the elec-trode [29 55] a 100mm times 40mm times 40mm subset of tissuearound the electrode was considered as the computationaldomain

Journal of Computational Medicine 9

class DBS Source public Source

DBS Source(TES data)

virtual dpreal valuePt(const Ptv(dpreal)amp x dpreal t = DUMMY)

dpreal DBS Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

if (4625 lt= x(1) ampamp x(1) lt= 5375 ampamp

4625 lt= x(2) ampamp x(2) lt= 5375 ampamp

3500 lt= x(3) ampamp x(3) lt= 4000 )

val = 0001

Code 6 DBS Source class definition and sample code from its valuePt function

00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(a) Isotropic conductivities00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(b) Anisotropic conductivities

Figure 4 Simulation 1 current density results viewed from above with the nasion facing up Anode was placed at C3 and cathode at C4

To simulate DBS with the existing TES software frame-work no existing code required modification Rather theonly addition was a new subclass of class Source that defines119891() (1a) for DBS in total less than ten lines of codewere added Code 6 displays this new subclass definitionSource DBS and highlights of its valuePt function imple-mentation which in this simplified scenario simply injects10mA of current from the anode contact into the surround-ing tissue In practice DBS stimulations are time-varyingpulses and differing stimulation frequencies impact GM andWM tissue conductivities [56] However when examiningelectric field dispersion around a DBS electrode as in thissimulation a constant-valued source term in (1a) can beutilized [57]

3 Results and Discussion

31 Simulation 1 Electric current density results on thesurface of the brain tissue are displayed in Figure 4 Viewing

perspective is from above the head with the nasion facingup As expected the largest electric current density valuesare attained near the anode and cathode locations Despitean overall similar pattern of electric current distribution thesimulated current densities particularly in the motor cortexipsilateral to the anode electrode are significantly differentbetween the isotropic and anisotropic simulations For exam-ple the maximal anisotropic current density value (0434 (Am2)) is approximately 182 higher than in the isotropic case(0367 (Am2)) Similar discrepancies are observed through-out the top surface of the brain including a substantialimpact on the paracentral lobule contralateral to the anodeIn addition these discrepancies extend to the GM and WMinteriors These results reinforce the importance of usinganisotropic conductivities to most accurately model TESadministrations and in addition showcase the capabilities ofthe object-oriented framework to support both isotropic andanisotropic TES simulations

10 Journal of Computational Medicine

Elec

tric

pot

entia

l (V

)

00

005

010

015

(a) tDCS electric potential00

0015

003

0045

Elec

tric

pot

entia

l (V

)

(b) HD-tDCS electric potential

00

015

030

045

Curr

ent d

ensit

y (A

m2)

(c) tDCS electric current density00

0033

0067

01

Curr

ent d

ensit

y (A

m2)

(d) HD-tDCS electric current density

Figure 5 Simulation 2 electric potential and current density results The tDCS montage positioned the anode at C3 and the cathode overthe contralateral supraorbital A 4 times 1 configuration was used for HD-tDCS with a single anode positioned over C3

32 Simulation 2 Electric potential and electric currentdensity results are displayed in Figure 5 The tDCS montageresults in a noticeably larger range of electric potential values(Figures 5(a) and 5(b)) However the focus of the tDCScurrent density on the targeted region in this case the motorcortex under C3 is much less than the HD-tDCS electrodemontage (Figures 5(c) and 5(d)) Specifically the brain tissueoutside of the square formed by the HD-tDCS cathodesis virtually unstimulated whereas tDCS results in a muchgreater electric current dispersion

One limitation of this HD-tDCS electrode arrangementis the lower concentration of electric current that reaches thebrain tissue Specifically the maximal electric current densityin the brain fromHD-tDCS is just approximately 23 of thatachieved with traditional tDCS The culprit for this effect isthe shunting of the electric current around the poorly con-ducting skull the HD-tDCS montage used in this simulationyields a minuscule amount of current that penetrates theskull to reach the CSF and brain tissues (Figure 6) Potentialremedies for this behavior are a greater anode stimulation orpositioning the cathodes at greater distances from the anode[3]

This simulation demonstrates the frameworkrsquos ability tosupport varying TES electrode montages including high-definition electrode configurations Results of this simulation

Curr

ent d

ensit

y (A

m2)

00

05

10

15

Figure 6 Simulation 2 HD-tDCS electric current density Crosssection is through two diagonally positioned cathodes

corroborate that HD-tDCS offers greater electric currentfocality however its net stimulation of brain tissue is poten-tially much lower than tDCS

33 Simulation 3 Electric potential and current densityresults on the head surface are displayed in Figure 7 Viewing

Journal of Computational Medicine 11

00

004

008

012

Elec

tric

pot

entia

l (V

)

(a) Electric potential00

05

10

15

20

Curr

ent d

ensit

y (A

m2)

(b) Current density

Figure 7 Simulation 3 electric potential and current density results viewed from the back of the head The anode was positioned at CZ andthe cathode at OZ

perspective is frombehind the head and as anticipatedmaxi-mal andminimal electric potential and current density valuesoccur at the anode and cathode respectivelyThe shunting ofthe electric current around the skull due to its low electricalconductivity results in the segregated current density patternaround the anode and cathode centers (Figure 7(b)) Thisphenomenon has been previously observed [1] however itis highlighted by the very fine mesh resolution used in thissimulation

Figure 8 displays convergence history curves and perfor-mance metrics for each CG preconditioning strategy Withno preconditioning the CG method will eventually conver-gence but will accomplish this extremely slowly requiringmore than 6 hours to solve the linear system The SSORand RILU preconditioners demonstrate comparable perfor-mances both in solution time and number of iterationsMultigrid preconditioning with two grid levels has far feweriterations with 166 than both SSOR and RILU and yet has agreater run time This observation can be explained by thefact that a single iteration of MG has embedded iterationson the different mesh refinements [37] However three-grid-level MG noticeably accelerates convergence rates with boththe V- and W-cycles outperforming the other precondition-ers Three-grid-level MG with a W-cycle pattern has slightlyfewer iterations than its corresponding V-cycle yet this V-cycle preconditioner is approximately 113 faster

The ability of the framework to support numerically ori-ented TES research is presented in this simulation exampleThe results indicate that the CG method combined with anappropriately configured MG preconditioner is highly effi-cient in solving the linear systems produced in TES compu-tational simulations

34 Simulation 4 Figure 9 displays the electric currentdensities produced by the DBS electrode using isotropic(Figure 9(a)) and anisotropic (Figure 9(b)) conductivitiesIn both cases the majority of the current density is prox-imal to the electrode indicating that accurate placementof electrodes in DBS procedures is paramount [56] While

1

0

minus1

minus2

minus3

minus4

minus5

minus6

minus7

minus8

minus9

Iterations0 100 200 300 400 500 600 700 800 900

SSORRILUMG 2-V

MG 3-VMG 3-W

log10(r

elat

ive r

esid

ual)

(a) Convergence history

Preconditioner Iterations Time (min)NoneSSORRILUMG 2-grid V-cycleMG 3-grid V-cycleMG 3-grid W-cycle

gt5000 gt360

860

885

166

113

106

1134

1175

1264

574647

(b) Numerical iterations and linear system solve time Boldfacevalues indicate best convergence results

Figure 8 Convergence performances of the preconditioned conju-gate gradient methods

themaximal current densities of the isotropic and anisotropicscenarios are similar other differences between them areobservable First the current density around the electrodeis nonsymmetric in the anisotropic case as is expectedwith directionally dependent conductivity data In addition

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 6: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

6 Journal of Computational Medicine

void TES integrands (ElmMatVecamp elmat const FiniteElementamp fe)

int ijq Loop control variables

const int nbf = fegetNoBasisFunc() no of nodesbasis functions

dpreal detJxW = fedetJxW() Numerical integration weight

const int nsd = fegetNoSpaceDim() Number of spatial dimensions

Get conductivity tensor for the current element

updateConductivityTensors(fe)

Get a point in the global domain represented by elemnt fe

Ptv(NUMT) x(nsd)

fegetGlobalEvalPt(x)

Get the source term f(x) for this element

dpreal f val

if (sourceok())

f val = source-gtvaluePt(x)

else f val = 0

Compute weak formulation

dpreal gradNi gradNj

for (i = 1 i lt= nbf i++)

for (j = 1 j lt= nbf j++)

gradNi gradNj = 0

for (q = 1 q lt= nsd q++)

Compute inner product of grad(N i) and grad(N j)

gradNi gradNj += sigma(qq) fedN(iq) fedN(jq)

Update linear system coefficient matrix

elmatA(ij) += gradNi gradNjdetJxW

Update linear system RHS (load vector)

elmatb(i) += feN(i)f valdetJxW

Code 4 TES class integrands function for computing weak formulation volume integrals Conductivity and source term values for finiteelement fe are retrieved with calls to the updateConductivityTensors and source valuePt functions Finite element basis functions arethen iterated to compute the volume integrals

There is also a reference to a Source object for exampleTES Source as well as a field function for nonconstantstimulation currents for example tACS Finally TES inheritsfunctions from FEM to perform finite element computationsincluding fillEssBC to set Dirichlet boundary conditionscalcElmMatVec to assemble the finite element linear systemcoefficient matrix and load vector and the integrands andintegrands4side functions to evaluate the weak formula-tion volume and boundary integrals respectively

233 Weak Formulation Integration The weak formulationvolume integrals (2) are computed in the TESintegrandsfunction (Code 4) The Diffpack linear system assemblerautomatically calls this function as it iterates over thefinite elements in the computational grid Conductivityvalues for the current element are attained with a call to

the updateConductivityTensors function which deter-mines if isotropic or anisotropic conductivities are desiredand then populates the sigmamatrix accordingly

The source term 119891() over the current element isretrieved via a call to the valuePt function in a Source classThen the finite element basis functions for this element areiterated over and the weak formulation is computed Notethat in this implementation sigma is assumed to be diag-onal however this can be generalized with the incorporationof an additional loop Finally the coefficient matrix A andload vector b are updatedThe boundary integral in theweakformulation is computed similarly in the integrands4sidefunction and its contribution is incorporated into b

234 Multigrid Multigrid is a linear system solution algo-rithm that utilizes multiple computational grid resolutions to

Journal of Computational Medicine 7

class TES MG public TES

int no of grids

Handle(MGtools) mgtools

Set boundary condtion on grid level specified by space

virtual void mgFillEssBC (SpaceId space)

Code 5 New members of TES MG class definition The mgtools object references the Diffpack multigrid toolbox The no of grids integerstores the number of MG grid levels and the mgFillEssBC function sets the essential boundary condition on all grid levels

(a) Head surface (b) Brain region (c) View of sagittal cross section

Figure 2 Computational domain used in numerical simulations

achieve fast solution convergence [36] By performing justa few iterations on each grid and then changing betweenfiner and coarser grids large portions of the error areefficiently removed [37] In addition as a preconditioner tothe commonly used conjugate gradient (CG) method MG ishighly effective at solving linear systems that result fromfiniteelement based TES simulations [38] Two commonly usedMG cycles are the V-cycle and the W-cycle and identifyingthe optimal cycle type for a given PDE system in addition tootherMGparameters including the number of grid levels canbe challenging [38]

As a subclass of TES very few new data members andfunctions are needed in TES MG (Code 5) since the entiretyof TES is efficiently reused The new members in TES MGare a reference to the Diffpack multigrid toolbox mgtoolsand an integer representing the number of MG grid levelsno of grids Finally just one new function mgFillEssBCis needed to set the essential boundary condition (1b) on allgrid levels

24 Computational Tools Numerical simulations were per-formed on a three-dimensional mesh (Figure 2) generatedfrom human MRI images by the SimNIBS software package[35] The mesh contains the skin skull cerebral spinal fluid(CSF) gray matter (GM) and white matter (WM) tissues ofthe head Gmsh [39] enabled mesh visualization identifica-tion of electrode coordinates and grid conversion to a formsupported by Diffpack Electric potential and current densityresults were exported from Diffpack and visualized withParaView [40] and gnuplot [41] Anisotropic conductivitydata for theGMandWMregions are provided by SimNIBS in

a Matlab binary data file these data are accessed by theMatlabEngine [34] via the MatlabHelper object of theMatlabConductivity class (Code 1)

25 Computational Simulations Multiple simulations wereperformed with the TES framework Simulations wereselected to demonstrate the frameworkrsquos versatility and abilityto target medical biophysical and computational researchobjectives Finally to illustrate how alternative forms ofneurostimulation can be simulated with the same softwarewe show a trivial extension to the framework that enablessupport for DBS applications

Simulation 1 (comparison of isotropic and anisotropic con-ductivity data) Previous research suggests that incorporatinganisotropic rather than isotropic brain tissue conductivitydata is important formost accuratelymodeling TES electricalcurrent distribution [17 42] To evaluate the impact thatthese two conductivity representations have on simulationresults TES simulations were performed with isotropic andanisotropic data The three-dimensional domain shown inFigure 2 was used with approximately 28 million lineartetrahedra finite elements

Anode and cathode electrodes were positioned at C3 andC4 [43] respectively each with a surface area of approx-imately 16 cm2 and the anode electric current magnitudewas set to 10mA This montage has been used to stimulatethe motor cortex ipsilateral to the C3 anode electrode [4445] First isotropic electrical conductivities were assigned todifferent tissues skin = 0465 skull = 0010 CSF = 1654GM = 0276 and WM = 0126 each with units (Sm) [46]

8 Journal of Computational Medicine

05mm05mm05mm10mm

075mm

minus

+

Figure 3 Simulation 4 DBS electrode positioning (subthalamic nucleus) and dimensions Anode and cathode contacts are denoted with ldquo+rdquoand ldquominusrdquo symbols respectively

Then anisotropic conductivity data were used via theMatlabConductivity class as previously described (seeCode 1)

Simulation 2 (comparison of tDCS and HD-tDCS electrodemontages) High-definition TES electrodes have demon-strated a greater ability to focus its electrical current on atargeted brain region than traditional tDCS which uses twolarger electrodes [2 3] Using the same computational gridas Simulation 1 the current densities produced by tDCS andHD-tDCS were compared

For tDCS the anodewas positioned over C3 and the cath-ode over the contralateral supraorbital each with a surfacearea of approximately 16 cm2 In comparison high-definitionelectrodes each circular with a 12mm diameter were posi-tioned according to a 4 times 1 configuration a single anode waspositioned over C3 and four cathodes were placed approxi-mately 5 cm radially from the anode forming a square Bothof these montages are known to target the motor cortexregion ipsilateral to the anode electrode [15 47ndash50] Anodestimulation strength for each simulation was once again10mA and both utilized anisotropic conductivities

Simulation 3 (comparison of finite element linear systemsolvers) Finite element based simulations of TES requirethe solution of large systems of linear equations which canbecome a computational bottleneck for simulations per-formed on very fine meshes Therefore the effectiveness ofa TES simulation is directly related to the efficiency of thechosen linear solverTheCGmethod is ideal for solving theselinear systems and appropriate preconditioning can rapidlyaccelerate numerical results [36 38]

The numerical efficiency of the preconditioned CGmethod was evaluated with TES simulations on the three-dimensional volume mesh (Figure 2) with approximately

29 million linear tetrahedra finite elements and roughly 51million unknowns The anode was positioned at CZ with astimulation strength of 10mA and the cathode at OZ [12 51]Simulations were performed with the CG method precon-ditioned with symmetric successive overrelaxation (SSOR)relaxed incomplete LUdecomposition (RILU) andmultigridThe RILU relaxation parameter was set to 05 [27] The MGpreconditioner was simulated with a V-cycle with both twoand three grid levels and aW-cycle with three grid levelsTherelative residual convergence tolerance was set to 10minus8 for allnumerical experiments

Simulation 4 (impact of conductivity representation onDBS simulation results) The importance of incorporatinganisotropic conductivities in TES simulations suggests thataccurately simulating other neurostimulationmodalitiesmaydepend on this conductivity representation as well In thisnumerical experiment we compared DBS simulation resultsusing both isotropic and anisotropic conductivities A singleelectrode was positioned in the subthalamic nucleus (STN)the most commonly targeted location for DBS [52] The elec-trode is a simplified version of the Medtronic (Model 3387)electrode used in humans [53] The lower 50mm of the elec-trode was modeledThe anode is positioned 10mm from theelectrode tip and the cathode is separated by 05mm from theanode Both the anode and cathode are 05mm in height andthe overall electrode diameter was set to 075mm (Figure 3)The anode and cathode metal contacts were modeled asconductors by setting the electrical conductivities of theseregions to 106 (Sm) and the remaining electrode shaft wasmodeled as an insulator with conductivity equal to 10minus6 (Sm) [54] Because DBS electric current is proximal to the elec-trode [29 55] a 100mm times 40mm times 40mm subset of tissuearound the electrode was considered as the computationaldomain

Journal of Computational Medicine 9

class DBS Source public Source

DBS Source(TES data)

virtual dpreal valuePt(const Ptv(dpreal)amp x dpreal t = DUMMY)

dpreal DBS Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

if (4625 lt= x(1) ampamp x(1) lt= 5375 ampamp

4625 lt= x(2) ampamp x(2) lt= 5375 ampamp

3500 lt= x(3) ampamp x(3) lt= 4000 )

val = 0001

Code 6 DBS Source class definition and sample code from its valuePt function

00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(a) Isotropic conductivities00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(b) Anisotropic conductivities

Figure 4 Simulation 1 current density results viewed from above with the nasion facing up Anode was placed at C3 and cathode at C4

To simulate DBS with the existing TES software frame-work no existing code required modification Rather theonly addition was a new subclass of class Source that defines119891() (1a) for DBS in total less than ten lines of codewere added Code 6 displays this new subclass definitionSource DBS and highlights of its valuePt function imple-mentation which in this simplified scenario simply injects10mA of current from the anode contact into the surround-ing tissue In practice DBS stimulations are time-varyingpulses and differing stimulation frequencies impact GM andWM tissue conductivities [56] However when examiningelectric field dispersion around a DBS electrode as in thissimulation a constant-valued source term in (1a) can beutilized [57]

3 Results and Discussion

31 Simulation 1 Electric current density results on thesurface of the brain tissue are displayed in Figure 4 Viewing

perspective is from above the head with the nasion facingup As expected the largest electric current density valuesare attained near the anode and cathode locations Despitean overall similar pattern of electric current distribution thesimulated current densities particularly in the motor cortexipsilateral to the anode electrode are significantly differentbetween the isotropic and anisotropic simulations For exam-ple the maximal anisotropic current density value (0434 (Am2)) is approximately 182 higher than in the isotropic case(0367 (Am2)) Similar discrepancies are observed through-out the top surface of the brain including a substantialimpact on the paracentral lobule contralateral to the anodeIn addition these discrepancies extend to the GM and WMinteriors These results reinforce the importance of usinganisotropic conductivities to most accurately model TESadministrations and in addition showcase the capabilities ofthe object-oriented framework to support both isotropic andanisotropic TES simulations

10 Journal of Computational Medicine

Elec

tric

pot

entia

l (V

)

00

005

010

015

(a) tDCS electric potential00

0015

003

0045

Elec

tric

pot

entia

l (V

)

(b) HD-tDCS electric potential

00

015

030

045

Curr

ent d

ensit

y (A

m2)

(c) tDCS electric current density00

0033

0067

01

Curr

ent d

ensit

y (A

m2)

(d) HD-tDCS electric current density

Figure 5 Simulation 2 electric potential and current density results The tDCS montage positioned the anode at C3 and the cathode overthe contralateral supraorbital A 4 times 1 configuration was used for HD-tDCS with a single anode positioned over C3

32 Simulation 2 Electric potential and electric currentdensity results are displayed in Figure 5 The tDCS montageresults in a noticeably larger range of electric potential values(Figures 5(a) and 5(b)) However the focus of the tDCScurrent density on the targeted region in this case the motorcortex under C3 is much less than the HD-tDCS electrodemontage (Figures 5(c) and 5(d)) Specifically the brain tissueoutside of the square formed by the HD-tDCS cathodesis virtually unstimulated whereas tDCS results in a muchgreater electric current dispersion

One limitation of this HD-tDCS electrode arrangementis the lower concentration of electric current that reaches thebrain tissue Specifically the maximal electric current densityin the brain fromHD-tDCS is just approximately 23 of thatachieved with traditional tDCS The culprit for this effect isthe shunting of the electric current around the poorly con-ducting skull the HD-tDCS montage used in this simulationyields a minuscule amount of current that penetrates theskull to reach the CSF and brain tissues (Figure 6) Potentialremedies for this behavior are a greater anode stimulation orpositioning the cathodes at greater distances from the anode[3]

This simulation demonstrates the frameworkrsquos ability tosupport varying TES electrode montages including high-definition electrode configurations Results of this simulation

Curr

ent d

ensit

y (A

m2)

00

05

10

15

Figure 6 Simulation 2 HD-tDCS electric current density Crosssection is through two diagonally positioned cathodes

corroborate that HD-tDCS offers greater electric currentfocality however its net stimulation of brain tissue is poten-tially much lower than tDCS

33 Simulation 3 Electric potential and current densityresults on the head surface are displayed in Figure 7 Viewing

Journal of Computational Medicine 11

00

004

008

012

Elec

tric

pot

entia

l (V

)

(a) Electric potential00

05

10

15

20

Curr

ent d

ensit

y (A

m2)

(b) Current density

Figure 7 Simulation 3 electric potential and current density results viewed from the back of the head The anode was positioned at CZ andthe cathode at OZ

perspective is frombehind the head and as anticipatedmaxi-mal andminimal electric potential and current density valuesoccur at the anode and cathode respectivelyThe shunting ofthe electric current around the skull due to its low electricalconductivity results in the segregated current density patternaround the anode and cathode centers (Figure 7(b)) Thisphenomenon has been previously observed [1] however itis highlighted by the very fine mesh resolution used in thissimulation

Figure 8 displays convergence history curves and perfor-mance metrics for each CG preconditioning strategy Withno preconditioning the CG method will eventually conver-gence but will accomplish this extremely slowly requiringmore than 6 hours to solve the linear system The SSORand RILU preconditioners demonstrate comparable perfor-mances both in solution time and number of iterationsMultigrid preconditioning with two grid levels has far feweriterations with 166 than both SSOR and RILU and yet has agreater run time This observation can be explained by thefact that a single iteration of MG has embedded iterationson the different mesh refinements [37] However three-grid-level MG noticeably accelerates convergence rates with boththe V- and W-cycles outperforming the other precondition-ers Three-grid-level MG with a W-cycle pattern has slightlyfewer iterations than its corresponding V-cycle yet this V-cycle preconditioner is approximately 113 faster

The ability of the framework to support numerically ori-ented TES research is presented in this simulation exampleThe results indicate that the CG method combined with anappropriately configured MG preconditioner is highly effi-cient in solving the linear systems produced in TES compu-tational simulations

34 Simulation 4 Figure 9 displays the electric currentdensities produced by the DBS electrode using isotropic(Figure 9(a)) and anisotropic (Figure 9(b)) conductivitiesIn both cases the majority of the current density is prox-imal to the electrode indicating that accurate placementof electrodes in DBS procedures is paramount [56] While

1

0

minus1

minus2

minus3

minus4

minus5

minus6

minus7

minus8

minus9

Iterations0 100 200 300 400 500 600 700 800 900

SSORRILUMG 2-V

MG 3-VMG 3-W

log10(r

elat

ive r

esid

ual)

(a) Convergence history

Preconditioner Iterations Time (min)NoneSSORRILUMG 2-grid V-cycleMG 3-grid V-cycleMG 3-grid W-cycle

gt5000 gt360

860

885

166

113

106

1134

1175

1264

574647

(b) Numerical iterations and linear system solve time Boldfacevalues indicate best convergence results

Figure 8 Convergence performances of the preconditioned conju-gate gradient methods

themaximal current densities of the isotropic and anisotropicscenarios are similar other differences between them areobservable First the current density around the electrodeis nonsymmetric in the anisotropic case as is expectedwith directionally dependent conductivity data In addition

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 7: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

Journal of Computational Medicine 7

class TES MG public TES

int no of grids

Handle(MGtools) mgtools

Set boundary condtion on grid level specified by space

virtual void mgFillEssBC (SpaceId space)

Code 5 New members of TES MG class definition The mgtools object references the Diffpack multigrid toolbox The no of grids integerstores the number of MG grid levels and the mgFillEssBC function sets the essential boundary condition on all grid levels

(a) Head surface (b) Brain region (c) View of sagittal cross section

Figure 2 Computational domain used in numerical simulations

achieve fast solution convergence [36] By performing justa few iterations on each grid and then changing betweenfiner and coarser grids large portions of the error areefficiently removed [37] In addition as a preconditioner tothe commonly used conjugate gradient (CG) method MG ishighly effective at solving linear systems that result fromfiniteelement based TES simulations [38] Two commonly usedMG cycles are the V-cycle and the W-cycle and identifyingthe optimal cycle type for a given PDE system in addition tootherMGparameters including the number of grid levels canbe challenging [38]

As a subclass of TES very few new data members andfunctions are needed in TES MG (Code 5) since the entiretyof TES is efficiently reused The new members in TES MGare a reference to the Diffpack multigrid toolbox mgtoolsand an integer representing the number of MG grid levelsno of grids Finally just one new function mgFillEssBCis needed to set the essential boundary condition (1b) on allgrid levels

24 Computational Tools Numerical simulations were per-formed on a three-dimensional mesh (Figure 2) generatedfrom human MRI images by the SimNIBS software package[35] The mesh contains the skin skull cerebral spinal fluid(CSF) gray matter (GM) and white matter (WM) tissues ofthe head Gmsh [39] enabled mesh visualization identifica-tion of electrode coordinates and grid conversion to a formsupported by Diffpack Electric potential and current densityresults were exported from Diffpack and visualized withParaView [40] and gnuplot [41] Anisotropic conductivitydata for theGMandWMregions are provided by SimNIBS in

a Matlab binary data file these data are accessed by theMatlabEngine [34] via the MatlabHelper object of theMatlabConductivity class (Code 1)

25 Computational Simulations Multiple simulations wereperformed with the TES framework Simulations wereselected to demonstrate the frameworkrsquos versatility and abilityto target medical biophysical and computational researchobjectives Finally to illustrate how alternative forms ofneurostimulation can be simulated with the same softwarewe show a trivial extension to the framework that enablessupport for DBS applications

Simulation 1 (comparison of isotropic and anisotropic con-ductivity data) Previous research suggests that incorporatinganisotropic rather than isotropic brain tissue conductivitydata is important formost accuratelymodeling TES electricalcurrent distribution [17 42] To evaluate the impact thatthese two conductivity representations have on simulationresults TES simulations were performed with isotropic andanisotropic data The three-dimensional domain shown inFigure 2 was used with approximately 28 million lineartetrahedra finite elements

Anode and cathode electrodes were positioned at C3 andC4 [43] respectively each with a surface area of approx-imately 16 cm2 and the anode electric current magnitudewas set to 10mA This montage has been used to stimulatethe motor cortex ipsilateral to the C3 anode electrode [4445] First isotropic electrical conductivities were assigned todifferent tissues skin = 0465 skull = 0010 CSF = 1654GM = 0276 and WM = 0126 each with units (Sm) [46]

8 Journal of Computational Medicine

05mm05mm05mm10mm

075mm

minus

+

Figure 3 Simulation 4 DBS electrode positioning (subthalamic nucleus) and dimensions Anode and cathode contacts are denoted with ldquo+rdquoand ldquominusrdquo symbols respectively

Then anisotropic conductivity data were used via theMatlabConductivity class as previously described (seeCode 1)

Simulation 2 (comparison of tDCS and HD-tDCS electrodemontages) High-definition TES electrodes have demon-strated a greater ability to focus its electrical current on atargeted brain region than traditional tDCS which uses twolarger electrodes [2 3] Using the same computational gridas Simulation 1 the current densities produced by tDCS andHD-tDCS were compared

For tDCS the anodewas positioned over C3 and the cath-ode over the contralateral supraorbital each with a surfacearea of approximately 16 cm2 In comparison high-definitionelectrodes each circular with a 12mm diameter were posi-tioned according to a 4 times 1 configuration a single anode waspositioned over C3 and four cathodes were placed approxi-mately 5 cm radially from the anode forming a square Bothof these montages are known to target the motor cortexregion ipsilateral to the anode electrode [15 47ndash50] Anodestimulation strength for each simulation was once again10mA and both utilized anisotropic conductivities

Simulation 3 (comparison of finite element linear systemsolvers) Finite element based simulations of TES requirethe solution of large systems of linear equations which canbecome a computational bottleneck for simulations per-formed on very fine meshes Therefore the effectiveness ofa TES simulation is directly related to the efficiency of thechosen linear solverTheCGmethod is ideal for solving theselinear systems and appropriate preconditioning can rapidlyaccelerate numerical results [36 38]

The numerical efficiency of the preconditioned CGmethod was evaluated with TES simulations on the three-dimensional volume mesh (Figure 2) with approximately

29 million linear tetrahedra finite elements and roughly 51million unknowns The anode was positioned at CZ with astimulation strength of 10mA and the cathode at OZ [12 51]Simulations were performed with the CG method precon-ditioned with symmetric successive overrelaxation (SSOR)relaxed incomplete LUdecomposition (RILU) andmultigridThe RILU relaxation parameter was set to 05 [27] The MGpreconditioner was simulated with a V-cycle with both twoand three grid levels and aW-cycle with three grid levelsTherelative residual convergence tolerance was set to 10minus8 for allnumerical experiments

Simulation 4 (impact of conductivity representation onDBS simulation results) The importance of incorporatinganisotropic conductivities in TES simulations suggests thataccurately simulating other neurostimulationmodalitiesmaydepend on this conductivity representation as well In thisnumerical experiment we compared DBS simulation resultsusing both isotropic and anisotropic conductivities A singleelectrode was positioned in the subthalamic nucleus (STN)the most commonly targeted location for DBS [52] The elec-trode is a simplified version of the Medtronic (Model 3387)electrode used in humans [53] The lower 50mm of the elec-trode was modeledThe anode is positioned 10mm from theelectrode tip and the cathode is separated by 05mm from theanode Both the anode and cathode are 05mm in height andthe overall electrode diameter was set to 075mm (Figure 3)The anode and cathode metal contacts were modeled asconductors by setting the electrical conductivities of theseregions to 106 (Sm) and the remaining electrode shaft wasmodeled as an insulator with conductivity equal to 10minus6 (Sm) [54] Because DBS electric current is proximal to the elec-trode [29 55] a 100mm times 40mm times 40mm subset of tissuearound the electrode was considered as the computationaldomain

Journal of Computational Medicine 9

class DBS Source public Source

DBS Source(TES data)

virtual dpreal valuePt(const Ptv(dpreal)amp x dpreal t = DUMMY)

dpreal DBS Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

if (4625 lt= x(1) ampamp x(1) lt= 5375 ampamp

4625 lt= x(2) ampamp x(2) lt= 5375 ampamp

3500 lt= x(3) ampamp x(3) lt= 4000 )

val = 0001

Code 6 DBS Source class definition and sample code from its valuePt function

00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(a) Isotropic conductivities00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(b) Anisotropic conductivities

Figure 4 Simulation 1 current density results viewed from above with the nasion facing up Anode was placed at C3 and cathode at C4

To simulate DBS with the existing TES software frame-work no existing code required modification Rather theonly addition was a new subclass of class Source that defines119891() (1a) for DBS in total less than ten lines of codewere added Code 6 displays this new subclass definitionSource DBS and highlights of its valuePt function imple-mentation which in this simplified scenario simply injects10mA of current from the anode contact into the surround-ing tissue In practice DBS stimulations are time-varyingpulses and differing stimulation frequencies impact GM andWM tissue conductivities [56] However when examiningelectric field dispersion around a DBS electrode as in thissimulation a constant-valued source term in (1a) can beutilized [57]

3 Results and Discussion

31 Simulation 1 Electric current density results on thesurface of the brain tissue are displayed in Figure 4 Viewing

perspective is from above the head with the nasion facingup As expected the largest electric current density valuesare attained near the anode and cathode locations Despitean overall similar pattern of electric current distribution thesimulated current densities particularly in the motor cortexipsilateral to the anode electrode are significantly differentbetween the isotropic and anisotropic simulations For exam-ple the maximal anisotropic current density value (0434 (Am2)) is approximately 182 higher than in the isotropic case(0367 (Am2)) Similar discrepancies are observed through-out the top surface of the brain including a substantialimpact on the paracentral lobule contralateral to the anodeIn addition these discrepancies extend to the GM and WMinteriors These results reinforce the importance of usinganisotropic conductivities to most accurately model TESadministrations and in addition showcase the capabilities ofthe object-oriented framework to support both isotropic andanisotropic TES simulations

10 Journal of Computational Medicine

Elec

tric

pot

entia

l (V

)

00

005

010

015

(a) tDCS electric potential00

0015

003

0045

Elec

tric

pot

entia

l (V

)

(b) HD-tDCS electric potential

00

015

030

045

Curr

ent d

ensit

y (A

m2)

(c) tDCS electric current density00

0033

0067

01

Curr

ent d

ensit

y (A

m2)

(d) HD-tDCS electric current density

Figure 5 Simulation 2 electric potential and current density results The tDCS montage positioned the anode at C3 and the cathode overthe contralateral supraorbital A 4 times 1 configuration was used for HD-tDCS with a single anode positioned over C3

32 Simulation 2 Electric potential and electric currentdensity results are displayed in Figure 5 The tDCS montageresults in a noticeably larger range of electric potential values(Figures 5(a) and 5(b)) However the focus of the tDCScurrent density on the targeted region in this case the motorcortex under C3 is much less than the HD-tDCS electrodemontage (Figures 5(c) and 5(d)) Specifically the brain tissueoutside of the square formed by the HD-tDCS cathodesis virtually unstimulated whereas tDCS results in a muchgreater electric current dispersion

One limitation of this HD-tDCS electrode arrangementis the lower concentration of electric current that reaches thebrain tissue Specifically the maximal electric current densityin the brain fromHD-tDCS is just approximately 23 of thatachieved with traditional tDCS The culprit for this effect isthe shunting of the electric current around the poorly con-ducting skull the HD-tDCS montage used in this simulationyields a minuscule amount of current that penetrates theskull to reach the CSF and brain tissues (Figure 6) Potentialremedies for this behavior are a greater anode stimulation orpositioning the cathodes at greater distances from the anode[3]

This simulation demonstrates the frameworkrsquos ability tosupport varying TES electrode montages including high-definition electrode configurations Results of this simulation

Curr

ent d

ensit

y (A

m2)

00

05

10

15

Figure 6 Simulation 2 HD-tDCS electric current density Crosssection is through two diagonally positioned cathodes

corroborate that HD-tDCS offers greater electric currentfocality however its net stimulation of brain tissue is poten-tially much lower than tDCS

33 Simulation 3 Electric potential and current densityresults on the head surface are displayed in Figure 7 Viewing

Journal of Computational Medicine 11

00

004

008

012

Elec

tric

pot

entia

l (V

)

(a) Electric potential00

05

10

15

20

Curr

ent d

ensit

y (A

m2)

(b) Current density

Figure 7 Simulation 3 electric potential and current density results viewed from the back of the head The anode was positioned at CZ andthe cathode at OZ

perspective is frombehind the head and as anticipatedmaxi-mal andminimal electric potential and current density valuesoccur at the anode and cathode respectivelyThe shunting ofthe electric current around the skull due to its low electricalconductivity results in the segregated current density patternaround the anode and cathode centers (Figure 7(b)) Thisphenomenon has been previously observed [1] however itis highlighted by the very fine mesh resolution used in thissimulation

Figure 8 displays convergence history curves and perfor-mance metrics for each CG preconditioning strategy Withno preconditioning the CG method will eventually conver-gence but will accomplish this extremely slowly requiringmore than 6 hours to solve the linear system The SSORand RILU preconditioners demonstrate comparable perfor-mances both in solution time and number of iterationsMultigrid preconditioning with two grid levels has far feweriterations with 166 than both SSOR and RILU and yet has agreater run time This observation can be explained by thefact that a single iteration of MG has embedded iterationson the different mesh refinements [37] However three-grid-level MG noticeably accelerates convergence rates with boththe V- and W-cycles outperforming the other precondition-ers Three-grid-level MG with a W-cycle pattern has slightlyfewer iterations than its corresponding V-cycle yet this V-cycle preconditioner is approximately 113 faster

The ability of the framework to support numerically ori-ented TES research is presented in this simulation exampleThe results indicate that the CG method combined with anappropriately configured MG preconditioner is highly effi-cient in solving the linear systems produced in TES compu-tational simulations

34 Simulation 4 Figure 9 displays the electric currentdensities produced by the DBS electrode using isotropic(Figure 9(a)) and anisotropic (Figure 9(b)) conductivitiesIn both cases the majority of the current density is prox-imal to the electrode indicating that accurate placementof electrodes in DBS procedures is paramount [56] While

1

0

minus1

minus2

minus3

minus4

minus5

minus6

minus7

minus8

minus9

Iterations0 100 200 300 400 500 600 700 800 900

SSORRILUMG 2-V

MG 3-VMG 3-W

log10(r

elat

ive r

esid

ual)

(a) Convergence history

Preconditioner Iterations Time (min)NoneSSORRILUMG 2-grid V-cycleMG 3-grid V-cycleMG 3-grid W-cycle

gt5000 gt360

860

885

166

113

106

1134

1175

1264

574647

(b) Numerical iterations and linear system solve time Boldfacevalues indicate best convergence results

Figure 8 Convergence performances of the preconditioned conju-gate gradient methods

themaximal current densities of the isotropic and anisotropicscenarios are similar other differences between them areobservable First the current density around the electrodeis nonsymmetric in the anisotropic case as is expectedwith directionally dependent conductivity data In addition

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 8: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

8 Journal of Computational Medicine

05mm05mm05mm10mm

075mm

minus

+

Figure 3 Simulation 4 DBS electrode positioning (subthalamic nucleus) and dimensions Anode and cathode contacts are denoted with ldquo+rdquoand ldquominusrdquo symbols respectively

Then anisotropic conductivity data were used via theMatlabConductivity class as previously described (seeCode 1)

Simulation 2 (comparison of tDCS and HD-tDCS electrodemontages) High-definition TES electrodes have demon-strated a greater ability to focus its electrical current on atargeted brain region than traditional tDCS which uses twolarger electrodes [2 3] Using the same computational gridas Simulation 1 the current densities produced by tDCS andHD-tDCS were compared

For tDCS the anodewas positioned over C3 and the cath-ode over the contralateral supraorbital each with a surfacearea of approximately 16 cm2 In comparison high-definitionelectrodes each circular with a 12mm diameter were posi-tioned according to a 4 times 1 configuration a single anode waspositioned over C3 and four cathodes were placed approxi-mately 5 cm radially from the anode forming a square Bothof these montages are known to target the motor cortexregion ipsilateral to the anode electrode [15 47ndash50] Anodestimulation strength for each simulation was once again10mA and both utilized anisotropic conductivities

Simulation 3 (comparison of finite element linear systemsolvers) Finite element based simulations of TES requirethe solution of large systems of linear equations which canbecome a computational bottleneck for simulations per-formed on very fine meshes Therefore the effectiveness ofa TES simulation is directly related to the efficiency of thechosen linear solverTheCGmethod is ideal for solving theselinear systems and appropriate preconditioning can rapidlyaccelerate numerical results [36 38]

The numerical efficiency of the preconditioned CGmethod was evaluated with TES simulations on the three-dimensional volume mesh (Figure 2) with approximately

29 million linear tetrahedra finite elements and roughly 51million unknowns The anode was positioned at CZ with astimulation strength of 10mA and the cathode at OZ [12 51]Simulations were performed with the CG method precon-ditioned with symmetric successive overrelaxation (SSOR)relaxed incomplete LUdecomposition (RILU) andmultigridThe RILU relaxation parameter was set to 05 [27] The MGpreconditioner was simulated with a V-cycle with both twoand three grid levels and aW-cycle with three grid levelsTherelative residual convergence tolerance was set to 10minus8 for allnumerical experiments

Simulation 4 (impact of conductivity representation onDBS simulation results) The importance of incorporatinganisotropic conductivities in TES simulations suggests thataccurately simulating other neurostimulationmodalitiesmaydepend on this conductivity representation as well In thisnumerical experiment we compared DBS simulation resultsusing both isotropic and anisotropic conductivities A singleelectrode was positioned in the subthalamic nucleus (STN)the most commonly targeted location for DBS [52] The elec-trode is a simplified version of the Medtronic (Model 3387)electrode used in humans [53] The lower 50mm of the elec-trode was modeledThe anode is positioned 10mm from theelectrode tip and the cathode is separated by 05mm from theanode Both the anode and cathode are 05mm in height andthe overall electrode diameter was set to 075mm (Figure 3)The anode and cathode metal contacts were modeled asconductors by setting the electrical conductivities of theseregions to 106 (Sm) and the remaining electrode shaft wasmodeled as an insulator with conductivity equal to 10minus6 (Sm) [54] Because DBS electric current is proximal to the elec-trode [29 55] a 100mm times 40mm times 40mm subset of tissuearound the electrode was considered as the computationaldomain

Journal of Computational Medicine 9

class DBS Source public Source

DBS Source(TES data)

virtual dpreal valuePt(const Ptv(dpreal)amp x dpreal t = DUMMY)

dpreal DBS Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

if (4625 lt= x(1) ampamp x(1) lt= 5375 ampamp

4625 lt= x(2) ampamp x(2) lt= 5375 ampamp

3500 lt= x(3) ampamp x(3) lt= 4000 )

val = 0001

Code 6 DBS Source class definition and sample code from its valuePt function

00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(a) Isotropic conductivities00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(b) Anisotropic conductivities

Figure 4 Simulation 1 current density results viewed from above with the nasion facing up Anode was placed at C3 and cathode at C4

To simulate DBS with the existing TES software frame-work no existing code required modification Rather theonly addition was a new subclass of class Source that defines119891() (1a) for DBS in total less than ten lines of codewere added Code 6 displays this new subclass definitionSource DBS and highlights of its valuePt function imple-mentation which in this simplified scenario simply injects10mA of current from the anode contact into the surround-ing tissue In practice DBS stimulations are time-varyingpulses and differing stimulation frequencies impact GM andWM tissue conductivities [56] However when examiningelectric field dispersion around a DBS electrode as in thissimulation a constant-valued source term in (1a) can beutilized [57]

3 Results and Discussion

31 Simulation 1 Electric current density results on thesurface of the brain tissue are displayed in Figure 4 Viewing

perspective is from above the head with the nasion facingup As expected the largest electric current density valuesare attained near the anode and cathode locations Despitean overall similar pattern of electric current distribution thesimulated current densities particularly in the motor cortexipsilateral to the anode electrode are significantly differentbetween the isotropic and anisotropic simulations For exam-ple the maximal anisotropic current density value (0434 (Am2)) is approximately 182 higher than in the isotropic case(0367 (Am2)) Similar discrepancies are observed through-out the top surface of the brain including a substantialimpact on the paracentral lobule contralateral to the anodeIn addition these discrepancies extend to the GM and WMinteriors These results reinforce the importance of usinganisotropic conductivities to most accurately model TESadministrations and in addition showcase the capabilities ofthe object-oriented framework to support both isotropic andanisotropic TES simulations

10 Journal of Computational Medicine

Elec

tric

pot

entia

l (V

)

00

005

010

015

(a) tDCS electric potential00

0015

003

0045

Elec

tric

pot

entia

l (V

)

(b) HD-tDCS electric potential

00

015

030

045

Curr

ent d

ensit

y (A

m2)

(c) tDCS electric current density00

0033

0067

01

Curr

ent d

ensit

y (A

m2)

(d) HD-tDCS electric current density

Figure 5 Simulation 2 electric potential and current density results The tDCS montage positioned the anode at C3 and the cathode overthe contralateral supraorbital A 4 times 1 configuration was used for HD-tDCS with a single anode positioned over C3

32 Simulation 2 Electric potential and electric currentdensity results are displayed in Figure 5 The tDCS montageresults in a noticeably larger range of electric potential values(Figures 5(a) and 5(b)) However the focus of the tDCScurrent density on the targeted region in this case the motorcortex under C3 is much less than the HD-tDCS electrodemontage (Figures 5(c) and 5(d)) Specifically the brain tissueoutside of the square formed by the HD-tDCS cathodesis virtually unstimulated whereas tDCS results in a muchgreater electric current dispersion

One limitation of this HD-tDCS electrode arrangementis the lower concentration of electric current that reaches thebrain tissue Specifically the maximal electric current densityin the brain fromHD-tDCS is just approximately 23 of thatachieved with traditional tDCS The culprit for this effect isthe shunting of the electric current around the poorly con-ducting skull the HD-tDCS montage used in this simulationyields a minuscule amount of current that penetrates theskull to reach the CSF and brain tissues (Figure 6) Potentialremedies for this behavior are a greater anode stimulation orpositioning the cathodes at greater distances from the anode[3]

This simulation demonstrates the frameworkrsquos ability tosupport varying TES electrode montages including high-definition electrode configurations Results of this simulation

Curr

ent d

ensit

y (A

m2)

00

05

10

15

Figure 6 Simulation 2 HD-tDCS electric current density Crosssection is through two diagonally positioned cathodes

corroborate that HD-tDCS offers greater electric currentfocality however its net stimulation of brain tissue is poten-tially much lower than tDCS

33 Simulation 3 Electric potential and current densityresults on the head surface are displayed in Figure 7 Viewing

Journal of Computational Medicine 11

00

004

008

012

Elec

tric

pot

entia

l (V

)

(a) Electric potential00

05

10

15

20

Curr

ent d

ensit

y (A

m2)

(b) Current density

Figure 7 Simulation 3 electric potential and current density results viewed from the back of the head The anode was positioned at CZ andthe cathode at OZ

perspective is frombehind the head and as anticipatedmaxi-mal andminimal electric potential and current density valuesoccur at the anode and cathode respectivelyThe shunting ofthe electric current around the skull due to its low electricalconductivity results in the segregated current density patternaround the anode and cathode centers (Figure 7(b)) Thisphenomenon has been previously observed [1] however itis highlighted by the very fine mesh resolution used in thissimulation

Figure 8 displays convergence history curves and perfor-mance metrics for each CG preconditioning strategy Withno preconditioning the CG method will eventually conver-gence but will accomplish this extremely slowly requiringmore than 6 hours to solve the linear system The SSORand RILU preconditioners demonstrate comparable perfor-mances both in solution time and number of iterationsMultigrid preconditioning with two grid levels has far feweriterations with 166 than both SSOR and RILU and yet has agreater run time This observation can be explained by thefact that a single iteration of MG has embedded iterationson the different mesh refinements [37] However three-grid-level MG noticeably accelerates convergence rates with boththe V- and W-cycles outperforming the other precondition-ers Three-grid-level MG with a W-cycle pattern has slightlyfewer iterations than its corresponding V-cycle yet this V-cycle preconditioner is approximately 113 faster

The ability of the framework to support numerically ori-ented TES research is presented in this simulation exampleThe results indicate that the CG method combined with anappropriately configured MG preconditioner is highly effi-cient in solving the linear systems produced in TES compu-tational simulations

34 Simulation 4 Figure 9 displays the electric currentdensities produced by the DBS electrode using isotropic(Figure 9(a)) and anisotropic (Figure 9(b)) conductivitiesIn both cases the majority of the current density is prox-imal to the electrode indicating that accurate placementof electrodes in DBS procedures is paramount [56] While

1

0

minus1

minus2

minus3

minus4

minus5

minus6

minus7

minus8

minus9

Iterations0 100 200 300 400 500 600 700 800 900

SSORRILUMG 2-V

MG 3-VMG 3-W

log10(r

elat

ive r

esid

ual)

(a) Convergence history

Preconditioner Iterations Time (min)NoneSSORRILUMG 2-grid V-cycleMG 3-grid V-cycleMG 3-grid W-cycle

gt5000 gt360

860

885

166

113

106

1134

1175

1264

574647

(b) Numerical iterations and linear system solve time Boldfacevalues indicate best convergence results

Figure 8 Convergence performances of the preconditioned conju-gate gradient methods

themaximal current densities of the isotropic and anisotropicscenarios are similar other differences between them areobservable First the current density around the electrodeis nonsymmetric in the anisotropic case as is expectedwith directionally dependent conductivity data In addition

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 9: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

Journal of Computational Medicine 9

class DBS Source public Source

DBS Source(TES data)

virtual dpreal valuePt(const Ptv(dpreal)amp x dpreal t = DUMMY)

dpreal DBS Source valuePt(const Ptv(dpreal)amp x dpreal t)

dpreal val = 00

if (4625 lt= x(1) ampamp x(1) lt= 5375 ampamp

4625 lt= x(2) ampamp x(2) lt= 5375 ampamp

3500 lt= x(3) ampamp x(3) lt= 4000 )

val = 0001

Code 6 DBS Source class definition and sample code from its valuePt function

00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(a) Isotropic conductivities00

011

022

033

044

Curr

ent d

ensit

y (A

m2)

(b) Anisotropic conductivities

Figure 4 Simulation 1 current density results viewed from above with the nasion facing up Anode was placed at C3 and cathode at C4

To simulate DBS with the existing TES software frame-work no existing code required modification Rather theonly addition was a new subclass of class Source that defines119891() (1a) for DBS in total less than ten lines of codewere added Code 6 displays this new subclass definitionSource DBS and highlights of its valuePt function imple-mentation which in this simplified scenario simply injects10mA of current from the anode contact into the surround-ing tissue In practice DBS stimulations are time-varyingpulses and differing stimulation frequencies impact GM andWM tissue conductivities [56] However when examiningelectric field dispersion around a DBS electrode as in thissimulation a constant-valued source term in (1a) can beutilized [57]

3 Results and Discussion

31 Simulation 1 Electric current density results on thesurface of the brain tissue are displayed in Figure 4 Viewing

perspective is from above the head with the nasion facingup As expected the largest electric current density valuesare attained near the anode and cathode locations Despitean overall similar pattern of electric current distribution thesimulated current densities particularly in the motor cortexipsilateral to the anode electrode are significantly differentbetween the isotropic and anisotropic simulations For exam-ple the maximal anisotropic current density value (0434 (Am2)) is approximately 182 higher than in the isotropic case(0367 (Am2)) Similar discrepancies are observed through-out the top surface of the brain including a substantialimpact on the paracentral lobule contralateral to the anodeIn addition these discrepancies extend to the GM and WMinteriors These results reinforce the importance of usinganisotropic conductivities to most accurately model TESadministrations and in addition showcase the capabilities ofthe object-oriented framework to support both isotropic andanisotropic TES simulations

10 Journal of Computational Medicine

Elec

tric

pot

entia

l (V

)

00

005

010

015

(a) tDCS electric potential00

0015

003

0045

Elec

tric

pot

entia

l (V

)

(b) HD-tDCS electric potential

00

015

030

045

Curr

ent d

ensit

y (A

m2)

(c) tDCS electric current density00

0033

0067

01

Curr

ent d

ensit

y (A

m2)

(d) HD-tDCS electric current density

Figure 5 Simulation 2 electric potential and current density results The tDCS montage positioned the anode at C3 and the cathode overthe contralateral supraorbital A 4 times 1 configuration was used for HD-tDCS with a single anode positioned over C3

32 Simulation 2 Electric potential and electric currentdensity results are displayed in Figure 5 The tDCS montageresults in a noticeably larger range of electric potential values(Figures 5(a) and 5(b)) However the focus of the tDCScurrent density on the targeted region in this case the motorcortex under C3 is much less than the HD-tDCS electrodemontage (Figures 5(c) and 5(d)) Specifically the brain tissueoutside of the square formed by the HD-tDCS cathodesis virtually unstimulated whereas tDCS results in a muchgreater electric current dispersion

One limitation of this HD-tDCS electrode arrangementis the lower concentration of electric current that reaches thebrain tissue Specifically the maximal electric current densityin the brain fromHD-tDCS is just approximately 23 of thatachieved with traditional tDCS The culprit for this effect isthe shunting of the electric current around the poorly con-ducting skull the HD-tDCS montage used in this simulationyields a minuscule amount of current that penetrates theskull to reach the CSF and brain tissues (Figure 6) Potentialremedies for this behavior are a greater anode stimulation orpositioning the cathodes at greater distances from the anode[3]

This simulation demonstrates the frameworkrsquos ability tosupport varying TES electrode montages including high-definition electrode configurations Results of this simulation

Curr

ent d

ensit

y (A

m2)

00

05

10

15

Figure 6 Simulation 2 HD-tDCS electric current density Crosssection is through two diagonally positioned cathodes

corroborate that HD-tDCS offers greater electric currentfocality however its net stimulation of brain tissue is poten-tially much lower than tDCS

33 Simulation 3 Electric potential and current densityresults on the head surface are displayed in Figure 7 Viewing

Journal of Computational Medicine 11

00

004

008

012

Elec

tric

pot

entia

l (V

)

(a) Electric potential00

05

10

15

20

Curr

ent d

ensit

y (A

m2)

(b) Current density

Figure 7 Simulation 3 electric potential and current density results viewed from the back of the head The anode was positioned at CZ andthe cathode at OZ

perspective is frombehind the head and as anticipatedmaxi-mal andminimal electric potential and current density valuesoccur at the anode and cathode respectivelyThe shunting ofthe electric current around the skull due to its low electricalconductivity results in the segregated current density patternaround the anode and cathode centers (Figure 7(b)) Thisphenomenon has been previously observed [1] however itis highlighted by the very fine mesh resolution used in thissimulation

Figure 8 displays convergence history curves and perfor-mance metrics for each CG preconditioning strategy Withno preconditioning the CG method will eventually conver-gence but will accomplish this extremely slowly requiringmore than 6 hours to solve the linear system The SSORand RILU preconditioners demonstrate comparable perfor-mances both in solution time and number of iterationsMultigrid preconditioning with two grid levels has far feweriterations with 166 than both SSOR and RILU and yet has agreater run time This observation can be explained by thefact that a single iteration of MG has embedded iterationson the different mesh refinements [37] However three-grid-level MG noticeably accelerates convergence rates with boththe V- and W-cycles outperforming the other precondition-ers Three-grid-level MG with a W-cycle pattern has slightlyfewer iterations than its corresponding V-cycle yet this V-cycle preconditioner is approximately 113 faster

The ability of the framework to support numerically ori-ented TES research is presented in this simulation exampleThe results indicate that the CG method combined with anappropriately configured MG preconditioner is highly effi-cient in solving the linear systems produced in TES compu-tational simulations

34 Simulation 4 Figure 9 displays the electric currentdensities produced by the DBS electrode using isotropic(Figure 9(a)) and anisotropic (Figure 9(b)) conductivitiesIn both cases the majority of the current density is prox-imal to the electrode indicating that accurate placementof electrodes in DBS procedures is paramount [56] While

1

0

minus1

minus2

minus3

minus4

minus5

minus6

minus7

minus8

minus9

Iterations0 100 200 300 400 500 600 700 800 900

SSORRILUMG 2-V

MG 3-VMG 3-W

log10(r

elat

ive r

esid

ual)

(a) Convergence history

Preconditioner Iterations Time (min)NoneSSORRILUMG 2-grid V-cycleMG 3-grid V-cycleMG 3-grid W-cycle

gt5000 gt360

860

885

166

113

106

1134

1175

1264

574647

(b) Numerical iterations and linear system solve time Boldfacevalues indicate best convergence results

Figure 8 Convergence performances of the preconditioned conju-gate gradient methods

themaximal current densities of the isotropic and anisotropicscenarios are similar other differences between them areobservable First the current density around the electrodeis nonsymmetric in the anisotropic case as is expectedwith directionally dependent conductivity data In addition

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 10: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

10 Journal of Computational Medicine

Elec

tric

pot

entia

l (V

)

00

005

010

015

(a) tDCS electric potential00

0015

003

0045

Elec

tric

pot

entia

l (V

)

(b) HD-tDCS electric potential

00

015

030

045

Curr

ent d

ensit

y (A

m2)

(c) tDCS electric current density00

0033

0067

01

Curr

ent d

ensit

y (A

m2)

(d) HD-tDCS electric current density

Figure 5 Simulation 2 electric potential and current density results The tDCS montage positioned the anode at C3 and the cathode overthe contralateral supraorbital A 4 times 1 configuration was used for HD-tDCS with a single anode positioned over C3

32 Simulation 2 Electric potential and electric currentdensity results are displayed in Figure 5 The tDCS montageresults in a noticeably larger range of electric potential values(Figures 5(a) and 5(b)) However the focus of the tDCScurrent density on the targeted region in this case the motorcortex under C3 is much less than the HD-tDCS electrodemontage (Figures 5(c) and 5(d)) Specifically the brain tissueoutside of the square formed by the HD-tDCS cathodesis virtually unstimulated whereas tDCS results in a muchgreater electric current dispersion

One limitation of this HD-tDCS electrode arrangementis the lower concentration of electric current that reaches thebrain tissue Specifically the maximal electric current densityin the brain fromHD-tDCS is just approximately 23 of thatachieved with traditional tDCS The culprit for this effect isthe shunting of the electric current around the poorly con-ducting skull the HD-tDCS montage used in this simulationyields a minuscule amount of current that penetrates theskull to reach the CSF and brain tissues (Figure 6) Potentialremedies for this behavior are a greater anode stimulation orpositioning the cathodes at greater distances from the anode[3]

This simulation demonstrates the frameworkrsquos ability tosupport varying TES electrode montages including high-definition electrode configurations Results of this simulation

Curr

ent d

ensit

y (A

m2)

00

05

10

15

Figure 6 Simulation 2 HD-tDCS electric current density Crosssection is through two diagonally positioned cathodes

corroborate that HD-tDCS offers greater electric currentfocality however its net stimulation of brain tissue is poten-tially much lower than tDCS

33 Simulation 3 Electric potential and current densityresults on the head surface are displayed in Figure 7 Viewing

Journal of Computational Medicine 11

00

004

008

012

Elec

tric

pot

entia

l (V

)

(a) Electric potential00

05

10

15

20

Curr

ent d

ensit

y (A

m2)

(b) Current density

Figure 7 Simulation 3 electric potential and current density results viewed from the back of the head The anode was positioned at CZ andthe cathode at OZ

perspective is frombehind the head and as anticipatedmaxi-mal andminimal electric potential and current density valuesoccur at the anode and cathode respectivelyThe shunting ofthe electric current around the skull due to its low electricalconductivity results in the segregated current density patternaround the anode and cathode centers (Figure 7(b)) Thisphenomenon has been previously observed [1] however itis highlighted by the very fine mesh resolution used in thissimulation

Figure 8 displays convergence history curves and perfor-mance metrics for each CG preconditioning strategy Withno preconditioning the CG method will eventually conver-gence but will accomplish this extremely slowly requiringmore than 6 hours to solve the linear system The SSORand RILU preconditioners demonstrate comparable perfor-mances both in solution time and number of iterationsMultigrid preconditioning with two grid levels has far feweriterations with 166 than both SSOR and RILU and yet has agreater run time This observation can be explained by thefact that a single iteration of MG has embedded iterationson the different mesh refinements [37] However three-grid-level MG noticeably accelerates convergence rates with boththe V- and W-cycles outperforming the other precondition-ers Three-grid-level MG with a W-cycle pattern has slightlyfewer iterations than its corresponding V-cycle yet this V-cycle preconditioner is approximately 113 faster

The ability of the framework to support numerically ori-ented TES research is presented in this simulation exampleThe results indicate that the CG method combined with anappropriately configured MG preconditioner is highly effi-cient in solving the linear systems produced in TES compu-tational simulations

34 Simulation 4 Figure 9 displays the electric currentdensities produced by the DBS electrode using isotropic(Figure 9(a)) and anisotropic (Figure 9(b)) conductivitiesIn both cases the majority of the current density is prox-imal to the electrode indicating that accurate placementof electrodes in DBS procedures is paramount [56] While

1

0

minus1

minus2

minus3

minus4

minus5

minus6

minus7

minus8

minus9

Iterations0 100 200 300 400 500 600 700 800 900

SSORRILUMG 2-V

MG 3-VMG 3-W

log10(r

elat

ive r

esid

ual)

(a) Convergence history

Preconditioner Iterations Time (min)NoneSSORRILUMG 2-grid V-cycleMG 3-grid V-cycleMG 3-grid W-cycle

gt5000 gt360

860

885

166

113

106

1134

1175

1264

574647

(b) Numerical iterations and linear system solve time Boldfacevalues indicate best convergence results

Figure 8 Convergence performances of the preconditioned conju-gate gradient methods

themaximal current densities of the isotropic and anisotropicscenarios are similar other differences between them areobservable First the current density around the electrodeis nonsymmetric in the anisotropic case as is expectedwith directionally dependent conductivity data In addition

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 11: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

Journal of Computational Medicine 11

00

004

008

012

Elec

tric

pot

entia

l (V

)

(a) Electric potential00

05

10

15

20

Curr

ent d

ensit

y (A

m2)

(b) Current density

Figure 7 Simulation 3 electric potential and current density results viewed from the back of the head The anode was positioned at CZ andthe cathode at OZ

perspective is frombehind the head and as anticipatedmaxi-mal andminimal electric potential and current density valuesoccur at the anode and cathode respectivelyThe shunting ofthe electric current around the skull due to its low electricalconductivity results in the segregated current density patternaround the anode and cathode centers (Figure 7(b)) Thisphenomenon has been previously observed [1] however itis highlighted by the very fine mesh resolution used in thissimulation

Figure 8 displays convergence history curves and perfor-mance metrics for each CG preconditioning strategy Withno preconditioning the CG method will eventually conver-gence but will accomplish this extremely slowly requiringmore than 6 hours to solve the linear system The SSORand RILU preconditioners demonstrate comparable perfor-mances both in solution time and number of iterationsMultigrid preconditioning with two grid levels has far feweriterations with 166 than both SSOR and RILU and yet has agreater run time This observation can be explained by thefact that a single iteration of MG has embedded iterationson the different mesh refinements [37] However three-grid-level MG noticeably accelerates convergence rates with boththe V- and W-cycles outperforming the other precondition-ers Three-grid-level MG with a W-cycle pattern has slightlyfewer iterations than its corresponding V-cycle yet this V-cycle preconditioner is approximately 113 faster

The ability of the framework to support numerically ori-ented TES research is presented in this simulation exampleThe results indicate that the CG method combined with anappropriately configured MG preconditioner is highly effi-cient in solving the linear systems produced in TES compu-tational simulations

34 Simulation 4 Figure 9 displays the electric currentdensities produced by the DBS electrode using isotropic(Figure 9(a)) and anisotropic (Figure 9(b)) conductivitiesIn both cases the majority of the current density is prox-imal to the electrode indicating that accurate placementof electrodes in DBS procedures is paramount [56] While

1

0

minus1

minus2

minus3

minus4

minus5

minus6

minus7

minus8

minus9

Iterations0 100 200 300 400 500 600 700 800 900

SSORRILUMG 2-V

MG 3-VMG 3-W

log10(r

elat

ive r

esid

ual)

(a) Convergence history

Preconditioner Iterations Time (min)NoneSSORRILUMG 2-grid V-cycleMG 3-grid V-cycleMG 3-grid W-cycle

gt5000 gt360

860

885

166

113

106

1134

1175

1264

574647

(b) Numerical iterations and linear system solve time Boldfacevalues indicate best convergence results

Figure 8 Convergence performances of the preconditioned conju-gate gradient methods

themaximal current densities of the isotropic and anisotropicscenarios are similar other differences between them areobservable First the current density around the electrodeis nonsymmetric in the anisotropic case as is expectedwith directionally dependent conductivity data In addition

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 12: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

12 Journal of Computational Medicine

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(a) Isotropic

Curr

ent d

ensit

y (A

m2)

Curr

ent d

ensit

y (A

m2)

00

01

02

03

04

00

01

02

03

04

(b) Anisotropic

Figure 9 Simulation 4 electric current density magnitudes and field lines Current densities in the figures on the left are from a coronal crosssection through the electrode center

anisotropic conductivities result in a greater electrical currentintensity adjacent to the electrode and more dispersion intothe neighbouring tissueThis is also observed in the electricalfield lines where anisotropic conductivities produce a moreintense and further-reaching current

With a straightforward extension DBS was simulatedwith the object-oriented TES framework The entirety ofthe framework is reused in the DBS simulation whichdemonstrates how object-oriented design can produce effi-cient and scalable software implementations This particularexample further reinforces the importance that anisotropicconductivities play in accurately modeling neurostimulation

While this DBS scenario utilizes a constant source termto assess electrode electric field dispersion [57] alternativeapplications may demand the use of time-dependent pulsessuch as those that examine temporal neuronal responses tononconstant electric current administrations In these casesdifferent stimulation frequencies have an impact on the elec-trical impedance specifically WM and GM conductivitiesare frequency dependent where an increase in stimulationfrequency yields an increase in electrical conductivity

Applications such as these are supported by the softwareframework First since isotropic tissue conductivity valuesare specified within the configuration input file and nothard-coded in the software alternative DBS pulses can

be accurately simulated by modifying these values Foranisotropic data modifications to support frequency-dependent conductivities can be made within the Conduc-tivity classes For example the SimNIBS softwarepackage volume normalizes the WM and GM anisotropicconductivities such that the mean conductivity value ofeach tensor is maintained to the associated tissuersquos isotropicvalue [35] Therefore for different DBS frequencies tensorscould be updated to be normalized to different isotropicvalues within the frameworkrsquos Conductivity componentsTo implement the time-varying source itself the existingdefinition of the valuePt function in class Sourcecontains an argument for time namely dpreal t Thusimplementations of valuePt in the Source DBS class canbe based on time and system (1a)ndash(1d) can then be iterativelysolved for with time-based source values

4 Conclusions

Computational simulations of neurostimulation are a valu-able tool that enable researchers to investigate this formof brain therapy in silico and as simulations become morerefined their utility to medical and biomedical researchgrowsWhile prebuilt simulation software programs can sim-plify and expedite TES model implementation they possess

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 13: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

Journal of Computational Medicine 13

application and portability limitations In addition recreatingcustom software as applications and research objectiveschange is inefficient error-prone and tedious to maintain

Since the mathematics and physiology that govern allforms of neurostimulation are the same a single well-designed software code can support a versatile range of neu-rostimulation simulations In this paper we have presentedone such software framework described its design and imple-mentation and demonstrated its abilities to support diverseneurostimulation research objectives The cornerstone of thedesign stage was to encapsulate general neurostimulationconcepts into modular software objects In doing so amultitude of TES simulation areas are supported and inaddition alternative forms of neurostimulation for exampleDBS can be simulated with the same software

Simulation results show the importance of usinganisotropic conductivities in both TES and DBS This isespecially important for simulations utilized in selectingpatient-specific neurostimulation parameters In additionresults demonstrate the ability of HD-tDCS to focus theelectrical current on a specific brain region howeverthis capability must be balanced with a potentially lowconcentration of electric current actually reaching thetarget The object-oriented TES framework is an ideal toolfor this scenario enabling different permutations of HD-tDCS electrode montages and stimulation strengths to beconveniently investigated to identify an optimal configura-tion for a particular patientrsquos data and therapeutic objectives

Results also illustrate that appropriately configuredmulti-grid preconditioning can achieve superior convergence ratesIt is conceivable that hundreds of simulations could be run toidentify an optimal electrode montage and neurostimulationparameters for a particular patient Hence efficiently solvingthe linear system of equations resulting from TES finiteelement simulations is crucial and MG can be used in thiscapacity to greatly decrease simulation run times Finally wedemonstrated how a minor addition to the object-orientedTES framework enables simulations of DBS The DBS sim-ulation example that was performed utilizes a constantstimulation source term however the software frameworkdescription and simulation ensemble presented in this papermotivate how the framework could be used to address DBSresearch related to electrode placement and parameter values

In future work we plan to extend the framework to sup-port anisotropic transcranial magnetic stimulation (TMS) ina similar fashion as was demonstrated for DBS In additionwe plan to utilize the framework to more thoroughly investi-gate correlations between HD-tDCS interelectrode distancesand electric current distributions

Appendix

Weak Formulation

Wemultiply (1a) by a test function V = V() and integrate overΩ to obtain

minusint

Ω

V (nabla sdot (MnablaΦ)) 119889119909 = intΩ

V119891119889119909 (A1)

and using Greenrsquos theorem we have

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω

V (MnablaΦ sdot ) 119889119904 + intΩ

V119891119889119909 (A2)

Expanding the surface integral gives

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119878

V (MnablaΦ sdot ) 119889119904

+ int

Ω

V119891119889119909

(A3)

and substituting the boundary conditions (1c) and (1d) yields

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119862

V (MnablaΦ sdot ) 119889119904

+ int

120597Ω119860

V119868 119889119904 + intΩ

V119891119889119909(A4)

For these integrals to exist we require V Φ isin 1198671(Ω) and 119891 isin119871

2(Ω) where

119867

1(Ω) = 119906 | 119906 isin 1198712 (

Ω)

120597119906

120597119909119894

isin 119871

2 (Ω)

1198712 (Ω) = 119901 | int

Ω

1003816

1003816

1003816

1003816

119901

1003816

1003816

1003816

1003816

2119889119909 lt infin

(A5)

and we enforce the Dirichlet boundary condition (1b) on oursolution space by further stipulating that V Φ isin 1198671

0= 119906 |

119906 isin 119867

1(Ω) 119906 = 0 for isin 120597Ω

119862

Consequently we have the following weak formulationGiven 119891() isin 119871

2(Ω) find Φ() isin 1198671

0(Ω) such that

int

Ω

nablaV sdotMnablaΦ119889119909 = int120597Ω119860

V119868 119889119904 + intΩ

119891V 119889119909

forallV () isin 11986710(Ω)

(A6)

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

The authors would like to acknowledge Frank Vogel and theentire inuTech team for their assistance with Diffpack Theauthors would also like to acknowledge the financial supportreceived fromVirginia Techrsquos Open Access Subvention Fund

References

[1] A Datta X Zhou Y Su L C Parra andM Bikson ldquoValidationof finite element model of transcranial electrical stimulationusing scalp potentials implications for clinical doserdquo Journal ofNeural Engineering vol 10 no 3 Article ID 036018 2013

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 14: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

14 Journal of Computational Medicine

[2] A Datta V Bansal J Diaz J Patel D Reato and M BiksonldquoGyri-precise head model of transcranial direct current stim-ulation improved spatial focality using a ring electrode versusconventional rectangular padrdquo Brain Stimulation vol 2 no 4pp 201ndash207 2009

[3] P Faria M Hallett and P CMiranda ldquoA finite element analysisof the effect of electrode area and inter-electrode distance on thespatial distribution of the current density in tDCSrdquo Journal ofNeural Engineering vol 8 no 6 Article ID 066017 2011

[4] P S Boggio R Ferrucci S P Rigonatti et al ldquoEffects of transcra-nial direct current stimulation on working memory in patientswith Parkinsonrsquos diseaserdquo Journal of the Neurological Sciencesvol 249 no 1 pp 31ndash38 2006

[5] P S Boggio L P Khoury D C S Martins O E M S MartinsE C deMacedo and F Fregni ldquoTemporal cortex direct currentstimulation enhances performance on a visual recognitionmemory task in Alzheimer diseaserdquo Journal of NeurologyNeurosurgery and Psychiatry vol 80 no 4 pp 444ndash447 2009

[6] P S Boggio C A Valasek C Campanha et al ldquoNon-invasivebrain stimulation to assess and modulate neuroplasticity inAlzheimerrsquos diseaserdquo Neuropsychological Rehabilitation vol 21no 5 pp 703ndash716 2011

[7] R Ferrucci M Bortolomasi M Vergari et al ldquoTranscra-nial direct current stimulation in severe drug-resistant majordepressionrdquo Journal of Affective Disorders vol 118 no 1ndash3 pp215ndash219 2009

[8] P S Boggio S P Rigonatti R B Ribeiro et al ldquoA randomizeddouble-blind clinical trial on the efficacy of cortical direct cur-rent stimulation for the treatment of major depressionrdquo Inter-national Journal of Neuropsychopharmacology vol 11 no 2 pp249ndash254 2008

[9] P Homan J Kindler A Federspiel et al ldquoMuting the voice acase of arterial spin labeling-monitored transcranial direct cur-rent stimulation treatment of auditory verbal hallucinationsrdquoThe American Journal of Psychiatry vol 168 no 8 pp 853ndash8542011

[10] J Brunelin MMondino F Haesebaert M Saoud M F Suaud-Chagny and E Poulet ldquoEfficacy and safety of bifocal tDCS asan interventional treatment for refractory schizophreniardquo BrainStimulation vol 5 no 3 pp 431ndash432 2012

[11] A Antal andW Paulus ldquoTranscranial alternating current stim-ulation (tACS)rdquo Frontiers in Human Neuroscience vol 7 article317 2013

[12] T Neuling S Wagner C H Wolters T Zaehle and C S Her-rmann ldquoFinite-element model predicts current density distri-bution for clinical applications of tDCS and tACSrdquo Frontiers inPsychiatry vol 3 article 83 2012

[13] F Gasca L Marshall S Binder A Schlaefer U G Hofmannand A Schweikard ldquoFinite element simulation of transcranialcurrent stimulation in realistic rat head modelrdquo in Proceedingsof the 5th International IEEEEMBS Conference on NeuralEngineering (NER 2011) pp 36ndash39 IEEE Cancun Mexico May2011

[14] P C Miranda M Lomarev and M Hallett ldquoModeling thecurrent distribution during transcranial direct current stimu-lationrdquo Clinical Neurophysiology vol 117 no 7 pp 1623ndash16292006

[15] E M Caparelli-Daquer T J Zimmermann E Mooshagian etal ldquoA pilot study on effects of 4times 1 high-definition tDCS onmotor cortex excitabilityrdquo in Proceedings of the IEEE AnnualInternational Conference of the Engineering in Medicine and

Biology Society (EMBC rsquo12) vol 735 pp 735ndash738 San DiegoCalif USA September 2012

[16] S K Kessler P Minhas A J Woods A Rosen C Gorman andM Bikson ldquoDosage considerations for transcranial direct cur-rent stimulation in children a computational modeling studyrdquoPLoS ONE vol 8 no 9 Article ID e76112 2013

[17] H S Suh W H Lee and T-S Kim ldquoInfluence of anisotropicconductivity in the skull andwhitematter on transcranial directcurrent stimulation via an anatomically realistic finite elementhead modelrdquo Physics in Medicine and Biology vol 57 no 21 pp6961ndash6980 2012

[18] S Wagner S M Rampersad U Aydin et al ldquoInvestigationof tDCS volume conduction effects in a highly realistic headmodelrdquo Journal of Neural Engineering vol 11 no 1 Article ID016002 2014

[19] S Lew C H Wolters T Dierkes C Roer and R S MacLeodldquoAccuracy and run-time comparison for different potentialapproaches and iterative solvers in finite element method basedEEG source analysisrdquo Applied Numerical Mathematics vol 59no 8 pp 1970ndash1988 2009

[20] W Aquino ldquoAn object-oriented framework for reduced-ordermodels using proper orthogonal decomposition (POD)rdquo Com-puter Methods in Applied Mechanics and Engineering vol 196no 41ndash44 pp 4375ndash4390 2007

[21] R I Mackie ldquoAn object-oriented approach to fully interactivefinite element softwarerdquo Advances in Engineering Software vol29 no 2 pp 139ndash149 1998

[22] R Sampath and N Zabaras ldquoAn object-oriented frameworkfor the implementation of adjoint techniques in the design andcontrol of complex continuum systemsrdquo International Journalfor Numerical Methods in Engineering vol 48 no 2 pp 239ndash266 2000

[23] M Hakman and T Groth ldquoObject-oriented biomedical systemmodelingmdashthe rationalerdquo Computer Methods and Programs inBiomedicine vol 59 no 1 pp 1ndash17 1999

[24] S C Lee K Bhalerao and M Ferrari ldquoObject-oriented designtools for supramolecular devices and biomedical nanotechnol-ogyrdquo Annals of the New York Academy of Sciences vol 1013 pp110ndash123 2004

[25] S Tuchschmid M Grassi D Bachofen et al ldquoA flexibleframework for highly-modular surgical simulation systemsrdquo inBiomedical Simulation vol 4072 of Lecture Notes in ComputerScience pp 84ndash92 Springer Berlin Germany 2006

[26] A Doronin and I Meglinski ldquoOnline object oriented MonteCarlo computational tool for the needs of biomedical opticsrdquoBiomedical Optics Express vol 2 no 9 pp 2461ndash2469 2011

[27] H P Langtangen Computational Partial Differential EquationsNumerical Methods and Diffpack Programming Texts in Com-putational Science and Engineering Springer Berlin Germany2003

[28] H P Langtangen and A Tveito Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming LectureNotes inComputational Scienceand Engineering Springer Berlin Germany 2003

[29] M Astrom L U Zrinzo S Tisch E Tripoliti M I Hariz andK Wardell ldquoMethod for patient-specific finite element mod-eling and simulation of deep brain stimulationrdquo Medical andBiological Engineering and Computing vol 47 no 1 pp 21ndash282009

[30] T Budd An Introduction to Object-Oriented ProgrammingAddison-Wesley Boston Mass USA 2002

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 15: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

Journal of Computational Medicine 15

[31] A M Bruaset and H P Langtangen ldquoDiffpack a software envi-ronment for rapid prototyping of PDE solversrdquo in Proceedings ofthe 15th IMACSWorld Congress on Scientific ComputationMod-eling and Applied Mathematics pp 553ndash558 Berlin GermanyAugust 1997

[32] B Stroustrup The C++ Programming Language Addison-Wesley Upper Saddle River NJ USA 2013

[33] S PrataC++Primer Plus Addison-Wesley Upper Saddle RiverNJ USA 2012

[34] MATLABVersion 820701 (R2013b)MathWorks NatickMassUSA 2013

[35] M Windhoff A Opitz and A Thielscher ldquoElectric fieldcalculations in brain stimulation based on finite elements anoptimized processing pipeline for the generation and usage ofaccurate individual head modelsrdquo Human Brain Mapping vol34 no 4 pp 923ndash935 2013

[36] H A van der Vorst Iterative Krylov Methods for Large LinearSystems Cambridge Monographs on Applied and Computa-tional Mathematics Cambridge University Press 2003

[37] W L BriggsAMultigrid Tutorial SIAM Philadelphia PaUSA2000

[38] K AMardal GW Zumbusch andH P Langtangen ldquoSoftwaretools for multigrid methodsrdquo in Advanced Topics in Compu-tational Partial Differential Equations Numerical Methods andDiffpack Programming H P Langtangen and A Tveito EdsLecture Notes in Computational Science and Engineering pp97ndash152 Springer Berlin Germany 2003

[39] C Geuzaine and J-F Remacle ldquoGmsh a 3-D finite elementmesh generator with built-in pre- and post-processing facili-tiesrdquo International Journal for Numerical Methods in Engineer-ing vol 79 no 11 pp 1309ndash1331 2009

[40] A Henderson J Ahrens and C Law The Paraview GuideKitware Inc Clifton Park NY USA 2004

[41] TWilliams C Kelley et al ldquoGnuplot 44 an interactive plottingprogramrdquo March 2011

[42] A Opitz M Windhoff R M Heidemann R Turner andA Thielscher ldquoHow the brain tissue shapes the electric fieldinduced by transcranial magnetic stimulationrdquo NeuroImagevol 58 no 3 pp 849ndash859 2011

[43] M A Nitsche L G Cohen E M Wassermann et al ldquoTran-scranial direct current stimulation state of the art 2008rdquo BrainStimulation vol 1 no 3 pp 206ndash223 2008

[44] M Okamoto H Dan K Sakamoto et al ldquoThree-dimensionalprobabilistic anatomical cranio-cerebral correlation via theinternational 10-20 system oriented for transcranial functionalbrain mappingrdquo NeuroImage vol 21 no 1 pp 99ndash111 2004

[45] E K Kang and N-J Paik ldquoEffect of a tDCS electrode montageon implicit motor sequence learning in healthy subjectsrdquoExperimental and Translational Stroke Medicine vol 3 no 1article 4 2011

[46] A Datta J M Baker M Bikson and J Fridriksson ldquoIndi-vidualized model predicts brain current flow during transcra-nial direct-current stimulation treatment in responsive strokepatientrdquo Brain Stimulation vol 4 no 3 pp 169ndash174 2011

[47] G Schlaug V Renga and D Nair ldquoTranscranial direct currentstimulation in stroke recoveryrdquo Archives of Neurology vol 65no 12 pp 1571ndash1576 2008

[48] A F DaSilva M S Volz M Bikson and F Fregni ldquoElectrodepositioning and montage in transcranial direct current stimu-lationrdquo Journal of Visualized Experiments no 51 2011

[49] A Antal D Terney C Poreisz and W Paulus ldquoTowardsunravelling task-related modulations of neuroplastic changesinduced in the human motor cortexrdquo European Journal ofNeuroscience vol 26 no 9 pp 2687ndash2691 2007

[50] D Q Truong G Magerowski G L Blackburn M Bikson andM Alonso-Alonso ldquoComputational modeling of transcranialdirect current stimulation (tDCS) in obesity impact of head fatand dose guidelinesrdquoNeuroImage Clinical vol 2 no 1 pp 759ndash766 2013

[51] A Antal K Boros C Poreisz L Chaieb D Terney and WPaulus ldquoComparatively weak after-effects of transcranial alter-nating current stimulation (tACS) on cortical excitability inhumansrdquo Brain Stimulation vol 1 no 2 pp 97ndash105 2008

[52] S Miocinovic S Somayajula S Chitnis and J L Vitek ldquoHis-tory applications and mechanisms of deep brain stimulationrdquoJAMA Neurology vol 70 no 2 pp 163ndash171 2013

[53] L M Zitella K Mohsenian M Pahwa C Gloeckner and MD Johnson ldquoComputational modeling of pedunculopontinenucleus deep brain stimulationrdquo Journal of Neural Engineeringvol 10 no 4 Article ID 045005 2013

[54] S Miocinovic M Parent C R Butson et al ldquoComputationalanalysis of subthalamic nucleus and lenticular fasciculus acti-vation during therapeutic deep brain stimulationrdquo Journal ofNeurophysiology vol 96 no 3 pp 1569ndash1580 2006

[55] C C Mcintyre and T J Foutz ldquoComputational modeling ofdeep brain stimulationrdquo Handbook of Clinical Neurology vol116 pp 55ndash61 2013

[56] D TarsyDeep Brain Stimulation InNeurological And PsychiatricDisorders Humana Press Totowa NJ USA 2008

[57] M Astrom Modelling simulation and visualization of deepbrain stimulation [PhD thesis] Linkoping University Linkop-ing Sweden 2011

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom

Page 16: Research Article An Object-Oriented Framework for ...€¦ · An Object-Oriented Framework for Versatile Finite Element Based Simulations of Neurostimulation EdwardT.Dougherty 1 andJamesC.Turner

Submit your manuscripts athttpwwwhindawicom

Stem CellsInternational

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MEDIATORSINFLAMMATION

of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Behavioural Neurology

EndocrinologyInternational Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Disease Markers

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

BioMed Research International

OncologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Oxidative Medicine and Cellular Longevity

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

PPAR Research

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Immunology ResearchHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

ObesityJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Computational and Mathematical Methods in Medicine

OphthalmologyJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Diabetes ResearchJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Research and TreatmentAIDS

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Gastroenterology Research and Practice

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Parkinsonrsquos Disease

Evidence-Based Complementary and Alternative Medicine

Volume 2014Hindawi Publishing Corporationhttpwwwhindawicom