13
  Journal of Neuroscience Methods 190 (2010) 258–270 Contents lists available at  ScienceDirect  Journal of Neuroscience Methods  j o u r nal home p a g e :  www.elsevier.com/locate/jneumeth Neuroelectromagnetic Forward Head Modeling Toolbox Zeynep Akalin Acar , Scott Makeig Swartz Center for Computational Neuroscience, Institute for Neural Computation, University of California San Diego 0961, La Jolla, CA 92093-0961, United States a r t i c l e i n f o  Article history: Received 10 September 2009 Received in revised form 28 April 2010 Accepted 29 April 2010 Keyword: MATLAB Software Head modeling EEG Boundary Element Method BEM Realistic 4-layer head model MNI Inverse problem Source localization a b s t r a c t This paper introd uces a Neuroe lectro magnet ic Forwar d Head Modeling Toolbox (NFT) running under MATLAB (The Mathworks, Inc.) for generating realistic head models from available data (MRI and/or electrode locations) and for computing numerical solutions for the forward problem of electromagnetic source imaging. The NFT includes tools for segmenting scalp, skull, cerebrospinal uid (CSF) and brain tissue s fromT1-weighte d magne tic resona nce (MR)images. The Bounda ry Eleme nt Metho d (BEM)is used for the numerical solution of the forward problem. After extracting segmented tissue volumes, surface BEM meshes can be generated. When a subject MR image is not available, a template head model can be warped to measured electrode locations to obtain an individualized head model. Toolbox functions may be called either from a graphic user interface compatible with EEGLAB (http://sccn.ucsd.edu/eeglab), or from the MATLAB command line. Function help messages and a user tutorial are included. The toolbox is freely available under the GNU Public License for noncommercial use and open source development. © 2010 Elsevier B.V. All rights reserved. 1. Intro ducti on In brain electromagnetic source imaging (EMSI), the forward problem is to predict the electromagnetic elds measurable on or near to the scalp given a source distribution in the brain. For accurate source localization, the forward problem must rst be solved numerically using a realistic head model. This study intro- duces the Neuroelectromagnetic Forward Head Modeling Toolbox (NFT), written in C++ and MATLAB. The NFT can be launched from with in EEGL AB (Del ormeand Make ig, 2004) or use d as a sta ndalo ne solver. The NFT contains tools to generate realistic BEM models from ava ila blesubje ct da ta and usi ng theMETU-FP Too lki t (Akalın- Acar and Genc ¸ er, 2004) as the for war d pro blem solver (Akali n Acar and Makeig, 2008). Source localization and source imaging are valuable tools for investiga tin g electrical act ivi ty in the brain. The accuracy of sou rce localization depends largely on the head model used for source localization. Realistic head models employing the Boundary Ele- ment Method (BEM) or the Finite Element Method (FEM) allow more accurate calculat ion of the electric al and magnet ic eld s This work is supported by NIH (NS047293-04), NSF (0613595), and a gift from The Swartz Foundation (Old Field, NY). Corresponding author. Tel.: +1 858 822 7536; fax: +1 858 822 7556. E-mail addresses: [email protected] (Z.A. Acar), [email protected] (S. Makeig). compa red to simple spherical head models. Hig h quality and high perfor manc e BEM and FEM forward problem solvers are available to the scientic community ( Akalın-Acar and Genc ¸ er, 2004 ; Genc ¸ er and Acar, 2004; Wolters et al., 2002 ).  However, most researchers use either spherical head models or numeri- cal met hods empl oyin g rela tive ly simp le, template -bas ed head mod els . The ma in reason for thi s is the dif cu lty of cre ati ng high quality, realistic, subject-specic head models. The goal of the NFT is to ass ist the use r in gene rat ing such head mod- els using any and all availab le infor mati on abou t the subject and recording session, and to provide a convenient inte rface f or using the resu ltin g mode ls in funct iona l BEM-b ased source imaging. Sour ce local izat ion accur acy and perf orman ce of anal ytica l head models have been investigated by many researchers.  Henderson and Butler (1975)  t ested a saline lled conductor and a spherical head model, reporting a mean 1-cm localization error.  Cohen et al. (1990) used sou rce s imp lan ted withina humanbrain. Usi ng sph er- ica l hea d model s, the average loc ali zat ion err or wa s 8 mm for MEG and 10mm for EEG.  Weinberg et al. (1986)  used a human skull with implanted sources and obtained a mean 3.5-mm localization error using a head model that used 25 spheres to model the skull. Zhang et al. showed that large errors may occur when estimating theparamet ers of twosimultan eous ly activ e dipol es whe n theshell mod el is mis spe cied (Zhangand Jewett, 1993; Zha ng et al. , 1994 ). Theseresul ts sug gest that ana lyt ica l head mod els arenot suf ci ent for accurate source localization. 0165-0270/$ – see front matter © 2010 Elsevier B.V. All rights reserved. doi:10.1016/j.jneumeth.2010.04.031

Zeynep NFT Toolbox10sss

Embed Size (px)

DESCRIPTION

sss

Citation preview

  • Journal of Neuroscience Methods 190 (2010) 258270

    Contents lists available at ScienceDirect

    Journal of Neuroscience Methods

    journa l homepage: www.e lsev ier .com/ locate / jneumeth

    Neuroelectromagnetic Forward Head Modeling T

    Zeynep ASwartz Center nia Sa

    a r t i c l

    Article history:Received 10 SeReceived in reAccepted 29 A

    Keyword:MATLABSoftwareHead modelinEEGBoundary ElemBEMRealistic4-layer head mMNIInverse probleSource localization

    magenerag numls forsonanarda subns tointer. Fune GN

    1. Introduction

    In brainproblem isor near to taccurate sosolved numduces the N(NFT), writtwithin EEGLsolver. Thefrom availaAcar and Geand Makeig

    Source linvestigatinlocalizationlocalizationment Methmore accur

    This workThe Swartz Fo

    CorresponE-mail add

    (S. Makeig).

    compared to simple spherical head models. High quality and

    0165-0270/$ doi:10.1016/j.electromagnetic source imaging (EMSI), the forwardto predict the electromagnetic elds measurable onhe scalp given a source distribution in the brain. Forurce localization, the forward problem must rst beerically using a realistic head model. This study intro-euroelectromagnetic Forward Head Modeling Toolboxen in C++ and MATLAB. The NFT can be launched fromAB (DelormeandMakeig, 2004) or used as a standaloneNFT contains tools to generate realistic BEM models

    ble subject data and using the METU-FP Toolkit (Akaln-ncer, 2004) as the forward problem solver (Akalin Acar, 2008).ocalization and source imaging are valuable tools forg electrical activity in the brain. The accuracy of sourcedepends largely on the head model used for source

    . Realistic head models employing the Boundary Ele-od (BEM) or the Finite Element Method (FEM) allowate calculation of the electrical and magnetic elds

    is supported by NIH (NS047293-04), NSF (0613595), and a gift fromundation (Old Field, NY).ding author. Tel.: +1 858 822 7536; fax: +1 858 822 7556.resses: [email protected] (Z.A. Acar), [email protected]

    high performance BEM and FEM forward problem solvers areavailable to the scientic community (Akaln-Acar and Gencer,2004; Gencer and Acar, 2004; Wolters et al., 2002). However,most researchers use either spherical head models or numeri-cal methods employing relatively simple, template-based headmodels. The main reason for this is the difculty of creatinghigh quality, realistic, subject-specic head models. The goal ofthe NFT is to assist the user in generating such head mod-els using any and all available information about the subjectand recording session, and to provide a convenient interfacefor using the resulting models in functional BEM-based sourceimaging.

    Source localization accuracy andperformance of analytical headmodels have been investigated by many researchers. Hendersonand Butler (1975) tested a saline lled conductor and a sphericalhead model, reporting a mean 1-cm localization error. Cohen et al.(1990) used sources implanted within a human brain. Using spher-ical head models, the average localization error was 8mm for MEGand 10mm for EEG. Weinberg et al. (1986) used a human skullwith implanted sources and obtained a mean 3.5-mm localizationerror using a head model that used 25 spheres to model the skull.Zhang et al. showed that large errors may occur when estimatingtheparameters of two simultaneously active dipoleswhen the shellmodel is misspecied (Zhang and Jewett, 1993; Zhang et al., 1994).These results suggest that analytical head models are not sufcientfor accurate source localization.

    see front matter 2010 Elsevier B.V. All rights reserved.jneumeth.2010.04.031kalin Acar , Scott Makeigfor Computational Neuroscience, Institute for Neural Computation, University of Califor

    e i n f o

    ptember 2009vised form 28 April 2010pril 2010

    g

    ent Method

    odel

    m

    a b s t r a c t

    This paper introduces a NeuroelectroMATLAB (The Mathworks, Inc.) for gelectrode locations) and for computinsource imaging. The NFT includes tootissues fromT1-weightedmagnetic refor the numerical solution of the forwBEM meshes can be generated. Whenwarped to measured electrode locatiobe called either from a graphic useror from the MATLAB command linetoolbox is freely available under thdevelopment.oolbox

    n Diego 0961, La Jolla, CA 92093-0961, United States

    netic Forward Head Modeling Toolbox (NFT) running underting realistic head models from available data (MRI and/orerical solutions for the forward problem of electromagneticsegmenting scalp, skull, cerebrospinal uid (CSF) and braince (MR) images. TheBoundary ElementMethod (BEM) is used

    problem. After extracting segmented tissue volumes, surfaceject MR image is not available, a template head model can beobtain an individualized head model. Toolbox functions mayface compatible with EEGLAB (http://sccn.ucsd.edu/eeglab),ction help messages and a user tutorial are included. TheU Public License for noncommercial use and open source

    2010 Elsevier B.V. All rights reserved.

  • Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270 259

    The desire for more accuracy has led to the use of realisticnumerical head models. Roth et al. (1993), Crouzeix et al. (1999),and Cufn (1996) investigated dipole localization accuracy usingspherical and realistic meshes in a 3-layer BEM model. They foundthat dipolemodels areskull bone,tionof scalpobserved ththese tissuebe improveproblem so

    One of thate the heainformationmenting 3-Dtomographbrain and stion Tool (B(1998), and(1996). Fretools to extthe Talairacsoftware pato extractsegmentaticompletely

    Variousization. BraPython forsource locaable Windotissues (Shadvanced Msource andtoolkit linketionof C andnmr.mgh.h

    The lackgenerationmodels in btinue to usmesh such ahead modeling the widinclude comhead image

    NFT begproblem sodeveloped itime uses frces and fordeveloped ucessing tooC++ and rel2004). Whithe forwardgration, buhave requirhave increaBEM meshsource toolangulationexist that atools alloweUsingMATL

    the graphical user interface (GUI) and to interface to the EEGLABenvironment and to native code tools. Thismade it possible to focuson providing a consistent user interface to the underlying tools,including providing default parameters that result in good quality

    odeNFTherse neode

    tionsuse

    ued dd EEimaadva

    torieimp

    rwar

    entaeneracturae a s-wei-quaendsissueabilitrsectents. Thethe

    pingimagel cah toa).stratd eleompricesratea hce Mtrom

    NFTmertailedtogeplecy o

    lbox

    s sentatiation

    unda

    Bounalmagd to susinglocalization improves by 12 cm when realistic headused. Ramon et al. (2004) examined the effects of softcerebrospinal uid (CSF) and gray matter on distribu-potentials using thenite elementmethod (FEM). Theyat the scalp potentials were signicantly affected bys. Thus, the accuracy of source localization can furtherd when more realistic head models are used in forwardlutions.e difculties in creating realistic head models is to cre-d mesh that provides the geometry and conductivityto the numerical solver. This is usually done by seg-structuralmagnetic resonance (MR) and/or computed

    y (CT) images. Some tools available for extracting thekull surfaces from MRI images include a Brain Extrac-ET) by Smith (2002), ANATOMIC by Heinonen et al.BRain ImageANalysis (BRIAN) byKruggel and LohmanneSurfer (http://surfer.nmr.mgh.harvard.edu/) providesract a high quality brain surface and to register it withh atlas (Talairach and Tournoux, 1998). Commercialckages such as ANALYZE and CURRY can also be usedskull, scalp and brain surfaces from MR images. Theon tools provided by these software packages are notautomated and require user input to some degree.toolkits are available for segmentation and source local-inVisa/Anatomist is an open source toolkit written inextracting cortical surfaces and performing EEG/MEGlization (Riviere et al., 2003). BrainSuite is a freely avail-ws application for extracting scalp, skull, CSF and brainattuck and Leahy, 2002). FreeSurfer, which providesRI segmentation, and surface extraction is also openfreely available for research purposes. MNE is a freed toFreeSurfer forEEG/MEGanalysis. It uses a combina-MATLAB, but source code is not available (http://www.

    arvard.edu/martinos/userInfo/data/sofMNE.php).of unied and freely available segmentation and meshtools has inhibited the use of high-quality realistic headrain electrophysiology research. Most researchers con-e either spherical head models, a xed template heads the Montreal Neurological Institutes (MNI) template, or low-quality realistic models. Other factors prevent-espread use of subject-specic realistic head modelsputational requirements and the unavailability of MRs for many subjects.an as an effort to integrate existing realistic forwardlvers, segmentation and mesh generation tools we haven previous research. It runs under MATLAB and to saveeely available C++ executables to generate BEM matri-some steps of mesh generation. NFT MATLAB wasnder MATLAB 7.3 and requires the MATLAB image pro-

    lbox. The state-of-the-art BEM solver was developed ineased as the METU-FP toolkit (Akaln-Acar and Gencer,le developing the toolbox, some of the functionality ofproblem solution is ported to MATLAB for better inte-

    t, re-implementing the BEM matrix generation woulded a lot of extra development and testing and wouldsed the memory requirements and computing time.generation also began as native code (C or C++). Opens and libraries such as ASC and Qslim are used for tri-and coarsening respectively. While MATLAB toolboxesllow similar functionality, using existing open sourced us to reduce development and testing considerably.AB as the integrationplatformmade it easier to develop

    head mThe

    researct of thhead mmentawidelycontinNFT ansourceducinglabora

    NFTand fo

    1. Segmof gstruerata T1

    2. Highdepels tinstinteelemsiblefrom

    3. WarMRmodmesvers

    4. Regiitizeto cmat

    5. Accuusessourelec

    Theand nuare denents,4, examefcien

    2. Too

    Thisegmeregistr

    2.1. Bo

    Theputatioelectrobe useWhenls.is released under an open source license, allowing

    to contribute to and improve on thiswork for the bene-uroscience community. By bringing together advancedling and forward problem solution methods and imple-within aneasy touse toolbox, theNFTcomplements thed EEGLAB environment, an open source toolkit underevelopment (Delorme and Makeig, 2004). Combined,GLAB form a freely available EEG (and in future, MEG)ging solution and an attractive environment for intro-nced inverse source localizationmethods into research

    s and courses.lements the major aspects of realistic head modelingd problem solution from available subject information:

    tion of T1-weighted MR images: The preferred methodting a realistic head model is to use a 3-D whole-headl MR image of the subjects head. The toolbox can gen-egmentation of scalp, skull, CSF and brain tissues fromghted image.lity BEM meshes: The accuracy of the BEM solutionon the quality of the underlying mesh that mod-conductance-change boundaries. To avoid numerical

    ies, themeshmust be topologically correctwith no self-ions. It should represent the surface using high-qualitywhile keeping the number of elements as small as pos-NFT can create high-quality linear surface BEMmesheshead segmentation.a template head model: When a whole-head structurale of the subject is not available, a semi-realistic headn be generated by warping a standard template BEMthe digitized electrode coordinates (instead of vice

    ion of electrode positions with the BEM mesh: The dig-ctrode locations and the BEM mesh must be aligned

    ute accurate forward problem solutions and lead eld.high-performance forward problem solution: The NFT

    igh-performance BEM implementation from the openETU-FP Toolkit (Akaln-Acar and Gencer, 2004) for bio-agnetic eld computations.

    has twomajorparts; generationof realisticheadmodelsical solution of the forward problem. Toolbox functions

    in Section 2. Section 3 describes the toolbox compo-ther with some screenshots from the GUI. In Sections of NFT head models are shown and the accuracy andf BEM-based equivalent dipole localization is estimated.

    functionality

    ction describes forward problem solutions, imageon, mesh generation, template warping, and co-of the electrode locations.

    ry Element Method

    ndary Element Method (BEM) is a numerical com-technique for solving partial differential equations. Innetic source imaging (EMSI) of brain activity, BEM mayolve the forward problem using realistic head models.BEMforheadmodeling, thehead is assumed tobe com-

  • 260 Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270

    Fig. 1. The seg nted uand watershed

    posed of unwhose tissuelements.

    The propas follows:

    1. To elimimethodemploye

    2. The Isolaical errorlayer. Thto allowskull. It hrects theand 112(Gencer a

    3. A recursaccuracythe surfaical integis repeatthe potenthe BEMthe comp

    4. The BEMelementsa smaller

    5. IntersectBEM meedge. ThCurrentlymeshes,validatioGencer, 2using a 3ity interfor differinhomogthan 1%.

    6. To decrethat relalocationsof electrimatrixv

    More desimple sphe

    , Aka.

    gmen

    en toible tT1-wral iavailskullthissegmhea

    whil5). Ftheuki,imagion, anyicalisotroterfaneh,unctbraie ITMR

    egmitial bmentation algorithm used in NFT. Scalp, brain, outer skull, and inner skull are segmesegmentation.

    iform conductivity regions (i.e., scalp, skull, brain, etc.)e boundaries may be represented by triangular surface

    erties of the BEM implementation may be summarized

    nate possible singularities in the BEM matrix, theof matrix deation (Lynn and Timlake, 1968) isd.tedProblemApproach (IPA) isused toovercomenumer-s caused by large conductivity differences near the skulle IPA used in this implementation of BEM is generalizedlayers within the modied boundary which is the inneras been shown that this implementation of IPA cor-electric eld by 1115% (RDM) for tangential dipoles,17% for radial dipoles in a 4-layer spherical head modelnd Akaln-Acar, 2005).

    ive integration technique is employed to increase theof the BEM implementation. In recursive integration,ce elements are divided into sub-elements and numer-ration is performed on each sub-element. This processed recursively until a subdivision criterion is met. Sincetial eld is calculated at the original nodes, the size ofmatrix equation remains the same, but the accuracy ofuted surface integral is improved.implementation allows the use of quadratic surfacein realistic head models for increased accuracy withnumber of elements.

    ing tissue boundaries are supported by allowing thesh to have more than two elements sharing a singleis allows modeling of complex tissues such as eyes., the toolbox does not support generating intersecting

    (1999)(2005)

    2.2. Se

    Whis possSincestructuwhenscalp,used in

    Thethe 3-Dimageal., 200old for(Nobuybinary3-D regFinallyphologFor anLAB inHamarusing f

    Forfrom thlteredbrain sThis inbut can use them if they are generated externally. Then of intersecting surfaces is given in (Akaln-Acar and004) by comparing BEM solutions with FEM solutions-layer head model with a disk-shaped inhomogene-

    secting the skull layer. The electric eld differencesent dipole positions and varying conductivity of theeneity between BEM and FEM solutions were smaller

    ase computation time, transfer matrices are computedte source projections to eld strengths at given sensor. Bypre-computing transfermatrices, forward solutionsc and magnetic eld problems are reduced to simpleector multiplications.

    tails of the BEM formulation and its accuracy usingrical head models can be found in Gencer and Tanzer

    is thin in tholding, mooperationstion includeand inferiowatershedof the lowe

    While simages, it icavities (si(inner skulthe scalp an

    An initiaolding thesegmentatiume is usedsing ltering, thresholding, region growing, morphologic operations,

    ln-Acar andGencer (2004) andGencer and Akaln-Acar

    tation

    mographic images of the subjects head are available, ito create a realistic model of the head tissue boundaries.eighted MR images are now commonly acquired formaging, the toolbox makes use of T1-weighted images,able, to generate a 4-layer head model consisting of, CSF, and brain surfaces. The segmentation algorithmstudy is shown in Fig. 1.entation procedure starts with anisotropic ltering ofd image to enhance image quality. This smoothes the

    e preserving gradient (boundary) information (Ibanez etiltering is followed by scalp segmentation. The thresh-scalp surface boundary is found by Otsu thresholding1979). After thresholding the 3-D image, the resultinge is morphologically closed. The toolbox then applies

    growing to eliminate any image noise outside the scalp.holes in the scalp are lled by applying the llingmor-operation in the sagittal, coronal and axial directions.pic ltering and Otsu thresholding, the MATITK MAT-

    ce to the ITK image processing toolkit is used (Chu and2005). The morphological operations are performed

    ions from MATLABs image processing toolbox.n segmentation, a watershed segmentation algorithmK toolkit is used (Ibanez et al., 2005). After masking theimage with segmented binary scalp image, an initial

    entation is performed using watershed segmentation.rain volumealso includes skullmarrowwhere the skull

    e MR image. To eliminate the bone marrow, thresh-

    rphological erosion and dilation, and region growingare applied. In some cases, the watershed segmenta-s tissues below the cerebellum such as the brain stem

    r scalp tissues. To prevent this, the lower boundary ofsegmentation is limited by a user-supplied indicationst point of the cerebellum.oft tissues are easy to identify from T1-weighted MRs difcult to distinguish skull from CSF and other headnuses). Therefore, skull and cerebrospinal uid (CSF)l) boundaries are deduced from segmented masks ford the brain.l segmentation for outer skull is performed by thresh-ltered MR image with the scalp mask. For nal skullon the segmented, eroded, and closed inner skull vol-. For some subjects, the eyes remain connected to the

  • Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270 261

    skull. To prevent this, the user selects a point in each eye from anaxial view inwhich the eyes are seen clearly. The eyes are extractedby region growing from the user-indicated points.

    The CSF boundary is obtained from the eroded skull and dilatedbrain boundsurfaces are

    2.3. Mesh g

    To solveobtainedbyical form (imeshes, andescribed bgeneratingdescribed b

    The rstmented imaskeleton clifor academal., 1998). FcompatibleASC whichThis resultsmesh needscan be used

    The triannal low-passuppress hiMR image. Dgulated surunchanged

    The numalgorithm bmetrics (Hetool is used(Garland anbor nodes wobtained.

    The resuical artifactedges and ssingle mani(Guziec et alowing stepquality mes

    Any isolattied and

    Edges wit(Guziec e

    For eachipped, if

    Very sma Elements

    shortest eand remo

    Isolated g

    As previdepend onthe brain swhen the m(Roth et al.,soning for tet al. (2007)

    ers are too close to each other. If the distance between two meshesis less than the edge length of the neighboring elements, then theaccuracy of the numerical solutions decreases. NFT handles this byperforming local mesh renement in regions where neighboring

    s areaime be, of twithis larch su

    are. Th

    ighboing fratioedgenodeted t

    he no

    gistr

    r crns mrdinh a rg therm pare cnslae beear

    arpin

    en thyusectrotivetemproaare

    red tlp sul poi. Thet of tromtherecoloca.r th

    he h. TheetersAll tarpsor

    paramplat

    com

    r ins, on taries. At the end of segmentation, the skull and scalpimproved to avoid thin regions in the skull.

    eneration

    the forward problem, the geometrical informationimage segmentation shouldbeconverted intoanumer-.e., as a set of meshes). To generate the BEM surfaceimproved version of the mesh generation algorithmy Akaln-Acar and Gencer (2004) is used. The steps forsurfacemeshes from segmented 3-D volume images areelow.step in mesh generation is the triangulation of the seg-ge. For this purpose, an implementation of the adaptivembing (ASC) algorithm is used that is freely availableic, research and internal business purposes (Poston etor each tissue, the volume is converted to a raw formatwith the ASC application. It is then triangulated usingplaces one or more triangles in each boundary voxel.in a very nemesh representing the tissue surface. Thisfurther processing and coarsening, however, before itas a BEM mesh.gulated surface is then smoothed using a surface sig-s lter algorithm (Taubin, 1995). This smoothing helpsgh frequencies caused by noise and slice effects in theuring the smoothing process, the vertices of the trian-

    face aremoved but the connectivity of the faces remains.ber of mesh triangles is reduced using a coarseningased on iterative edge contraction and quadric errorckbert and Garland, 1999). For this purpose, the QSlim, an open source tool available under the GPL licensed Shaffer, 2002). At every coarsening step, the neigh-ith lowest errors are connected and a coarser mesh is

    lting mesh may still contain some undesirable topolog-s such as disconnected or multiply-connected elementingular nodes. These artifacts are corrected to create afold surface that represents the given surface boundaryl., 2001). To summarize, multiple iterations of the fol-s are performed to obtain a topologically correct, highh:

    ed vertices (those with no elements attached) are iden-removed.h more than two elements are marked and correctedt al., 2001).edge, neighboring elements are checked; the edge ispossible, to improve the aspect ratio of the elements.ll face elements are identied and removed.with poor aspect ratios (elementswhere the ratio of thedge to longest edge is smaller than 0.3) are identiedved.roups of elements are removed.

    ously shown, the accuracy of BEM inverse solutionsthe eccentricity of the dipoles. As the dipoles approachurface, forward problem solution accuracy decreases;

    eshes are rened, solutions become more accurate1993; Akaln-Acar and Gencer, 2004). A theoretical rea-his fact was given in Drechsler et al. (2009) and Wolters. Another type of inaccuracy occurswhen twomesh lay-

    mesheThe

    distanclengthmentslengthFor easurfacerenedthe nebeginn(LMR)(meanof theconnecfrom t

    2.4. Re

    Aftelocatiothe coothrougisterintransfotrodesand tradistancnon-lin

    2.5. W

    Whquentl3-D elealternatemplathis apimagescompa

    Scaducia(Fig. 2)in fronhead. Fin bothby thesensorsystem

    Afteboth t(2006)param1999).same wthe senThesethe tem

    3. NFT

    Aftetypingclose to each other.of local mesh renement is to make sure that thetween meshes is not too small compared to edgehe neighboring elements. For this purpose, mesh ele-

    relatively long edges are rened when their edgeger than the local distance of two neighboring meshes.rface, edges that are close to the outer neighboringdetected, and elements belonging to that edge are

    is is repeated until there are no large edges close toring surface. This procedure is repeated for all surfacesrom the innermost layer. The local mesh renementused for this purpose is computed as: LMR(node,mesh) =length)/(mesh distance), where the mean edge lengthis calculated by averaging the lengths of all the edgeso that node, and mesh distance is the shortest distancede to the neighboring mesh.

    ation of electrode locations and scalp surface

    eating the head model from the MR image, electrodeust be mapped onto the scalp mesh. It is assumed thatate systems of the digitizer and the MRI can be mappedigid-body transform (rotation and translation). For reg-electrode locations to the head model, the rigid-bodyarameters that can best match the scalp and the elec-omputed. For this purpose, six parameters of rotationtion are calculated so as to minimize the total squaredtween the scalp mesh and the electrode positions usingoptimization (Akaln-Acar and Gencer, 2004).

    g

    e MR image of the subject head is not available, a fre-d approach to source localization is tomap the recordedde locations to a mean subject template head mesh. Anapproach suggested by Darvas et al. (2006) is to warp aesh tot theobservedsensor locations.NFT implementsch to generate subject-adapted head models when MRnot available. This results in more realistic head modelso mapping electrodes to a template mesh.rface warping parameters are computed based on threents: the nasion and left and right preauricular pointspreauricular points are dened as the bony indentationhe ears. The nasion is the bridge of the nose at the fore-these three points, the vertex of the scalp is computedtemplate model and the subject head surface impliedrded electrode locations. Using these four points, thetions and head model are brought into same coordinate

    is initial co-registration, 19 landmarks are located onead model and sensors, as described in Darvas et al.se landmarks are used to nd the best-tting warpingusing a non-rigid thin plate spline method (Bookstein,

    he surfaces and the source space are warped using theing parameters. Reverse warping parameters that warpcoordinates to the template mesh are also computed.eters can be used to map source localization results to

    e head.

    ponents

    talling and conguring the toolbox, one may start it byhe MATLAB commandline:

  • 262 Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270

    Fig. 2. The nasion and left and right preauricular points shown on an MNI headmodel.

    Neuroelectromagnetic Forward Modeling Toolboxor, if preferred, NFTThe main NFT window appears as shown in Fig. 3. This win-

    dow is divided into three panels. The top panel is used to selectthe working folder and to name the subject and session. The lowerpanel is the head modeling panel. The lowest panel in the mainNFTmenu initiates forwardmodel generation, opening the forwardmodel generation interface used to compute the BEM coefcient

    Fig. 3. The NFtop panel is usThe lower panNFT cues forw

    matrix, create the transfer matrices for each sensor, and generatelead eld matrices for a given source distribution.

    In the following sub-sections, NFT module components areintroduced. Inputs and outputs of each module are explained andtheir user in

    3.1. Head m

    The inpimage. Wheare shown fplayed by uDisplay imato display.volume, or

    The segmeffected bybutton checgeneity corused to exc

    Segmen

    1. Anisotro2. Scalp seg3. Brain seg

    tation; th4. Outer sk

    center of5. Inner sku

    The segmskull, CSF,any stage oimages areas a MATLA

    Fig. 5 shfor four sub

    nner

    ead m

    secoT meandr mese braskullGE sca

    3.2. H

    TheThe NFtation3-layeand thscalp,T main user interface. This window is divided into three panels. Theed to select the working folder and to name the subject and session.el is the head modeling panel. The lowest panel in the main menu ofard model generation.

    surface sepapply localone surface

    The mesmesh le ca

    Fig. 7 shFig. 5.

    3.3. Source

    A sourcevolume. Itmaps the amtials. An LFsingle-dipoestimate of

    The NFTspace consiby placing tterfaces are illustrated.

    odeling: segmentation

    ut to the segmentation module is a T1-weighted MRn the image is loaded, sagittal, axial, and coronal slicesor an indicated voxel. It is easy to change the slices dis-sing the scroll bars or clicking on the images (Fig. 4). Thege panel allows the user to select which image volumeThe available choices are the MR volume, the lteredthe image volume in various stages of segmentation.entation algorithm does not perform well for volumesinhomogeneity artifacts. The Check inhomogeneityks whether the current image volume needs inhomo-

    rection or not. The adjacent checkbox Swap L|R can behange left and right when needed.tation steps are performed in this order:

    pic ltering. (User inputs: lter parameters.)mentation.mentation. (User input: A seed point for brain segmen-e lowest point of the cerebellum.)ull segmentation. (User input: A seed point near theeither eye.)ll segmentation.

    entationmodule outputs lteredMR images and scalp,and brain masks. It is possible to save the results off segmentation in MATLAB data format. The ltered MRsaved in MATLAB double precision; the masks are savedB structure.ows segmentation results for scalp, skull, CSF, and brainjects whose MR head images were acquired using a 3-T.

    odeling: mesh generation

    nd step in realistic head modeling is mesh generation.sh generation module uses the results of the segmen-

    outputs either 3-layer or 4-layer BEM head meshes. Ah includes scalp, outer skull, and CSF surfaces. The CSFin are considered a single region. A 4-layermeshmodels, CSF, and brain by including an additional inner skullarating the CSF from the brain. It is also possible tomesh renement to locally rene the meshes wherecomes close to a neighbouring surface.h generation interface is shown in Fig. 6. The generatedn be used directly by the BEM solver.ows the meshes generated for the volumes shown in

    space generation

    space is a set of dipole sources placed within the brainis used to generate the lead eld matrix (LFM) thatplitudesof possible dipolar sources to electrodepoten-

    M using a regular grid source space can be used forle parametric inverse problem solution to give a coarsesource location.contains an option to generate a simple dipolar sourcesting of a regular 3-D voxel grid. The grid is generatedhree orthogonal dipoles at each grid location inside the

  • Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270 263

    Fig. 4. The NFT head tissue segmentation interface. When a T1-weighted MR image is loaded, anisotropic ltering, scalp, brain, outer skull, and inner skull segmentation areperformed.

    Fig. 5. Segmentation results showing (a) scalp, (b) skull, (c) CSF and (d) brain volumes computed from four subject MR head images acquired using a 3-T GE scanner.

  • 264 Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270

    Fig. 6. The NFT mesh generation user interface. The mesh generation module uses the results of the segmentation and outputs either 3-layer or 4-layer BEM head meshes.

    Fig. 7. BEM models of the scalp, skull, CSF and the brain for four subjects: (a) scalp mesh, (b) skull mesh, (c) CSF mesh, (d) brain mesh generated for the volumes shown inFig. 5.

  • Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270 265

    del to

    brain volumments andmesh. The gtwo dipoles

    3.4. Co-regi

    The BEMthe same cwith EEG reitizer mustco-registratinput to thtrode locatand the eleregistrationroughly co-the translasquared dis

    3.5. Head m

    When thtoolbox canThe templa(rather thahead modeand left andmodule arefrom a 3-D

    rpedlectrrametem

    olbox://wr hete mareae loodepladule

    rwar

    forwd incFig. 8. The NFT user interface for warping a template head mo

    e. User inputs are the spacing between the dipole ele-the minimum distance of a dipole element to the brainrid spacing determines theminimumdistance between.

    stration of electrode locations

    mesh is generated from the 3-D MR volume and usesoordinate system as the MR volume. When workingcordings, the electrode coordinates measured by a dig-be mapped to the mesh coordinates. This step is calledion of electrode locations to the mesh volume. Thee electrode co-registration module is the set of elec-ions. The subject scalp mesh is loaded automaticallyctrodes are co-registered to the scalp mesh. The co-is accomplished in two steps. First the user manually

    registers the sensors. The second, automated step ndstion and rotation parameters that minimize the totaltance between the sensors and the model scalp surface.

    the watted eing pato thethe toat httpanothetemplamarksmay bhead mthe teming moviews.

    3.6. Fo

    TheLAB anodeling using template warping

    e MR image of the subject head is not available, thegenerate a subject-adapted template head model.

    te head model is warped to the electrode locationsn warping the electrode positions to the templatel). The warping is based on three ducials: the nasion

    right preauricular points. The inputs of the warpingthese ducials and the electrode locations (obtainedposition digitizer). The outputs are the warped mesh,

    BEM matricpute the fofunctions cuser interfa

    The binaexecutablewith paramThe solver iexplicitly b

    The userMATLAB da

    Fig. 9. Three views of the nodes of the template mesh (blue) and the warped mesh (measured 3-D electrode locations.

    source space, indices of the electrodes on the mesh,ode locations, and the warping parameters. The warp-ters may be used to warp the localized sources backplate model. The template head model included inis based on the MNI averaged MR image available

    ww.bic.mni.mcgill.ca/software/. It is possible to usead model as a template head model by replacing theesh les as long as corresponding ducials and land-lso specied.Note that thenumberofwarpedelectrodeswer, since the MNI head is not a complete whole-l and some electrodes on the neck might lie belowte mesh. Fig. 8 shows the user interface for the warp-, and in Fig. 9, a warping result is shown in different

    d problem solutions: BEM

    ardproblemsolutionmodule iswrittenmainly inMAT-ludes a set of functions to read the mesh, generate the

    es, register the electrodes to the BEM mesh, and com-rward problem solution and lead eld matrices. Thesean also be accessed using the user interface. The BEMce is shown in Fig. 10.ry BEM solver that computes the BEM matrices is anprogram written in C++ that is launched from MATLABeters necessary to compute and save the BEM matrices.s called transparently byMATLABandneednot be calledy the user.interface for the forward problem module uses three

    ta structures to store the state of forward problem com-

    red). The warped mesh ts the electrode locations.

  • 266 Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270

    Fig. 10. The N load opanel) Predict

    putations:

    The meshtry of the

    The modeparamete

    The sessiocoordinat

    A BEM foing steps:

    1. Compute2. Compute

    tions.3. Obtain t

    source di

    The defaset to 0.33,1967). In Baature was fallows the usolution GU

    The toolbtoolbox (if iand lead-erunning NF

    matlavailable

    In paralltransfer and

    4. Results

    This secthe toolboxexample ofels.

    mpu

    comsizein thent staon c

    his sage

    al md brtivelyle 1warcomp

    le 2 shenodelreqFT BEM construction user interface has four panels: (Upper panels) Load a mesh,scalp potentials produced by given dipole(s).

    structure: stores the mesh information, i.e., the geome-head.l structure: holds the mesh coefcients, solver (i.e., IPA)rs, and tissue conductivities.n structure: contains the model structure and electrodees on the mesh.

    rward problem solution proceeds through the follow-

    the BEM matrices for the given head model.the transfer matrix for the given set of electrode loca-

    he electrode potentials generated by activity of eachpole.

    ult conductivity values for scalp, skull, and brain are

    4.1. Co

    Theto thenodesdiffererequire

    In thead imall. LocCSF, anrespec

    Taband forThesesor.

    Tabation wheadmeration0.0042, and 0.33 S/m, respectively (Geddes and Baker,umann et al. (1997), CSF conductivity at body temper-ound to be 1.79 S/m, here used by default. The toolboxser to change these values using the forward problemI. In this study we used the default values.ox canalsomakeuseof theMATLABParallel Processingnstalled) to distribute the computation of the transferld matrices to multiple processors. To do this, before

    T, the user must simply enterabpool(n) % n: the number of compute nodes

    el mode, wait bars do not appear while computing thelead-eld matrices.

    tion presents statistics on the runtime performance ofand the effect of local mesh renement, and gives an

    source localizations obtained using different headmod-

    tables.Themem

    the total siz

    Table 1Computationa

    SegmentatioMesh generaCo-registratBEM matrixTransfer maLead eld m

    Total

    Table 2Computationa

    Generation oCalculationCalculation

    Totalr generate BEM meshes, load or generate transfer matrices. (Lower

    tational complexity

    putational cost of using a realistic headmodel is relatedof the BEM matrices, which depend on the number ofmeshes. The aim of this section is to indicate how longgesof theheadmodeling and forwardproblemsolutionurrent (2009) computers.

    ection, a 4-layer realistic model generated from an MRis used. Themeshhad16,016nodes, and 32,024 faces inesh renement used an LMR ratio of 2. The scalp, skull,ain surfaces had 6944, 7084, 9298, and 8698 elements,.shows computation times for realistic head modelingd model generation of a head model from an MR image.utations used a single 2.4-GHz 64-bit Opteron proces-

    hows the computation times for forward model gener-the head model was obtained by warping a template.Warping a template headmodel and source space gen-uired only a few seconds, so these are not given in theoryused formatrix computations is slightly larger thane of the BEM matrices. The in-memory size of the BEM

    l complexity for the realistic model.

    n 25mintion 38min

    ion 25mingeneration (16,016 nodes) 120mintrix calculation (141 sensors) 192minatrix calculation (6075 dipoles) 60min

    735min (7.25h)

    l complexity for the warped model.

    f BEM matrices (6006 nodes) 19minof the transfer matrix (135 sensors) 15minof the lead eld matrix (10,131 dipoles) 30min

    64min (1.1h)

  • Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270 267

    Table 3Relativedifferencemeasures (%RDMsandRDM*s) for various tangential (x-directed)dipoles located on the z axis (z = 1 6 cm) in a 4-layer spherical head model. Theresults are presented for solutions with and without the use of IPA.

    Distance (cm

    1.01.52.02.53.03.54.04.55.05.56.0

    matrix is Neach entryis applied,stored. Thebytes respelayer and Nbrain if a 4head modemately 4.8G

    The trantion steps mParallel Prospeed-up bof a single c

    4.2. Accura

    To asseserror analystions obtainlayers repreities 0.33, 1model spheMeijs et al.et al. (1978)the RDM an

    A similaAcar (2005)spherical qunodes perconductivitconductivitby Bauman

    Percentadirected) dsolutions wIPA. Applicapared to thRDM and Rfor the soludoubled beboundary u

    Table4gThe errorstial dipolesof the numments canchange in t

    Table 4Relative difference measures (%RDMs and RDM*s) for various radial (z-directed)dipoles located on the z axis (z = 1 6 cm) in a 4-layer spherical head model. Theresults are presented for solutions with and without the use of IPA.

    ce (cm) With IPA Without IPA

    %RDM RDM* %RDM RDM*

    0.31 0.0009 28.21 0.01030.34 0.0019 28.02 0.01040.49 0.0040 27.74 0.01120.78 0.0073 27.36 0.01361.23 0.0120 26.88 0.01841.83 0.0181 26.31 0.02592.56 0.0255 25.80 0.03643.41 0.0339 25.51 0.05054.33 0.0431 24.17 0.07435.45 0.0512 26.08 0.2536

    s, howeasinface.singe thain l.

    urce

    s secodedipor BEMthisd 0.3ondu

    Effectcomp

    odes weayerce rfor

    nt ecere

    ted fce foumbctive(RamhowEEGloca) With IPA Without IPA

    %RDM RDM* %RDM RDM*

    0.30 0.0006 28.44 0.01050.31 0.0009 28.53 0.01090.31 0.0012 28.65 0.01120.31 0.0015 28.79 0.01160.32 0.0018 28.95 0.01200.32 0.0022 29.12 0.01240.33 0.0026 29.34 0.01390.35 0.0031 29.81 0.01980.39 0.0037 30.91 0.03540.44 0.0044 31.10 0.05031.42 0.0118 32.45 0.1366

    N 8 bytes, where N is the number of nodes anduses 8 bytes for double precision oating point. If IPAthen two additional matrices are also calculated andse two matrices consume N1 N 8, and N2 N2 8ctively, where N1 is the number of nodes of the skull2 is the number of nodes in the inner layers (CSF and-layer model is used). Similar realistic subject-specicls generated by NFT using IPA would require approxi-B of memory.

    sfer matrix computation and lead-eld matrix genera-ay be executed on multiple processors if the MATLAB

    cessing Toolbox is available. We have measured a 2.6y generating the transfer matrix on a quad-core insteadore processor.

    cy of the BEM implementation

    s the accuracy of the BEM solutions, we performed anis, comparing analytical solutions with numerical solu-ed using a 4-layer spherical BEM head model. The foursenting brain, CSF, skull, and the scalp had conductiv-.79, 0.0042, and 0.33 S/m, respectively. The radii of theres were 61, 65, 71, and 75mm as recommended in(1989). The analytical solutions provided by Kavanaghwere comparedwith theNFTnumerical solutionsusingd RDM* metrics (Meijs et al., 1989).r error analysis was performed in Gencer and Akaln-for the same BEM implementation. We used the sameadratic BEM mesh which has 512 elements and 1026

    layer. The only difference in the head model is they of the CSF. The previous study used 1.0 S/m for CSFy. This study used 1.79 S/m to match the value reportedn et al. (1997).ge RDM and RDM* values for various tangential (x

    Distan

    1.01.52.02.53.03.54.04.55.05.56.0

    dipoleby incrthe surdoes u

    Notthe brdipole

    4.3. So

    Thihead msingle4-layelowingwe usebrain c

    4.3.1.To

    layer mmodelthe 4-lreferenformeddifferebrain wgenerareferen

    A nconduizationhave stion ofsourceipoles along z axis are given in Table 3. The numericalere computed twice, once with IPA and once withouttion of IPA improved the solutions signicantly. Com-e earlier study of Gencer and Akaln-Acar (2005), theDM* values are very close when IPA was applied, whiletions derived without using IPA the RDM values almostcause of the higher conductivity difference at the skullsed in this study. The use of IPA eliminates this error.ives the same information for radial (z directed)dipoles.were higher for radial dipoles compared with tangen-as the dipole was closer to the surface. The accuracyerical solutions depends on how well the mesh ele-match changes in the eld. For tangential dipoles, thehe eld is distributed over many elements. For radial

    ductivities.the fourth (ment in so

    Table 5Properties of t

    Mesh name

    Mesh 3Mesh 3aMesh 3bMesh 4Mesh 4aMesh 4b13.61 0.0338 277.76 1.9164

    ever, the rapid changes in the eld need to be handledgly smaller elements as the dipole position is closer toUsing smaller elements helps increase this accuracy, ashigher order elements.at, the dipole at z = 6 cm is only 1mm away fromayer which accounts for the increased error for this

    localization comparisons

    tion presents source localization results using variousls. First, simulation studies are presented that comparele source localization differences between 3-layer andmeshes with and without local mesh renement. Fol-

    , localization resultswith realistic data are shown. Again3, 0.0042, 1.79, and 0.33 S/m for scalp, skull, CSF, andctivities, respectively.

    of LMR ratio on 3-layer and 4-layer BEM head modelsare the localization difference between 3-layer or 4-ls of different mesh complexity, six different head

    re generated using different LMR ratios. The results forBEM model with an LMR ratio of 1.6 were consideredesults, equivalent dipole source localization was per-these potentials. For testing purposes, 24 dipoles ofcentricities in three orthogonal directions inside thesimulated. Table 5 shows the properties of the meshesor this test. Mesh 4b, the nest mesh, was used as ar source localization.er of researchers have stated that including the highlyCSF layer inheadmodels is important for accurate local-on et al., 2004; Akalin Acar, 2005).Wendel et al. (2008)

    n how the CSF conductivity affects the scalp distribu-, and Rullmann et al. (2009) investigated the effects onlization of compartments (i.e., lesions) of varying con-

    Source localization results are shown in Table 6. AddingCSF) layer to the model gave an up to a 3-cm improve-urce localization. The effect of local mesh renement

    he meshes used in the simulations.

    Numberof layers

    Numberof nodes

    Numberof faces

    LMRratio

    3 10,337 20,678 None3 12,057 24,118 23 14,769 29,542 1.54 13,775 27,550 None4 18,499 36,998 24 20,789 41,578 1.6

  • 268 Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270

    Fig. 11. Scalprecording by inand (yellow dimaps and equidipole position

    is also visibimproved lo

    4.3.2. Real EIn this s

    models areEEG data wtrodes. InfoSejnowski,et al. (1996muscle actially indepensingle-dipo

    Table 6Localization er

    Mesh name

    Mesh 3Mesh 3aMesh 3bMesh 4Mesh 4aMesh 4bprojections (two left columns) and equivalent dipole source locations (right column) ofomax ICA. Top row: Scalp maps and equivalent dipole positions computed using the in

    poles) 3-layer. Middle row: Scalp maps and equivalent dipole positions in the electrode pvalent dipole positions based on electrode positions warped to the standard 3-layer MNI hs; their computed Talairach locations are shown (green/yellow lettering).

    le for the 4-layer meshes, for which mesh renementcalization accuracy by up to 1 cm.

    EG data exampleection, source localization results for different headcompared for one subject with an MR head image.ere collected during a reaching task using 140 elec-max Independent Component Analysis (ICA) (Bell and1995), developed for application to EEG data by Makeig) and Jung et al. (2001), was used to remove eye andvity artifacts and also to identify and separate function-dent cortical EEG processes. After ICA decomposition,

    le source localization was performed for two inde-

    ror (LE) for 24 dipoles relative to Mesh 4b (in mm).

    Mean LE Minimum LE Maximum LE

    17.1 7.1 23.716.1 3.9 26.216.9 4.1 29.35.6 2.6 9.10.9 0.2 1.80.0 0.0 0.0

    pendent coprojectioning the far-a single cor

    Four reathe subjectBEM mode(c) an elecstandard Mtions warpwas includeposition-watemplate heNFT, wherewerewarpe

    Fig. 11 ssource locamodel (midthe equivalcompared t(bottom roequivalentductive CSFf two independent components extracted from a 140-electrode EEGdividual subject MR-based BEM head models, (green dipoles) 4-layerosition-warped standard 3-layer MNI head model. Bottom row: Scalpead model. Slices shown are nearest to the (left posterior) equivalent

    mponent scalp maps that each highly resembled theof a single equivalent current dipole (likely represent-eld potential projected by coherent eld activity across

    tical source patch).listic head models were generated using NFT fromMR head image: (a) a subject-specic realistic 4-layerl; (b) a subject-specic realistic 3-layer BEM model;trode position-warped MNI template model; (d) theNI 3-layer BEM template model with electrode posi-ed to the model head. In the 3-layer model, the CSFd within the brain model compartment. The electroderped head model was generated by warping the MNIad model to the recorded scalp sensor locations usingas in the MNI model, the recorded electrode locationsd to themodelMNI scalp surfaceusingdipt in EEGLAB.hows the component scalp maps and equivalent dipolelization results. The electrode position-warped MNIdle row) is squeezed toward the back of the head andent dipole sources are localized closer to the surfaceo the sources localized using the standard MNI modelw). In the 4-layer BEM model (top right, green), thedipoles are closer to the cortex because the highly con-tissue layer concentrates the ow of current within

  • Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270 269

    Table 7The percentage residual variance (rv) of the scalp map versus the equivalent dipolemap.

    Head model % rv (left component) % rv (right component)

    MR-based 4MR-based 3Position-waStandard MN

    itself, reduthrough the

    The residipole mapels (Table 7equivalentels (Fig. 11,extensive cdipole sourences in eqvary with s

    4.4. Known

    A knownprocessingintensity thimage has ithe segmenthe currentfails the funtion using aexplains ho

    5. Conclus

    Here weHead Modeules for derealistic BEMhead modelor by warplocations.

    Using thgenerationMethod (FEmodels usinsue anisotrosuch as dirtensor (DT)accurate aslocations (A

    The accuof the BEMbetween layical four layThe most mof BEM matfor matrix cBEM matricthe toolboxand 3GB no1.6GB for g

    While thwithin thefer matrice

    take much less memory and computational resources. It may bepossible to reduce thememory requirements further byparalleliza-tion (Ataseven et al., 2008). On-disk size of the matrices can alsobe reduced by using data compression techniques. These features

    nnedage sncrere focortim soing cNFTndolbofrom

    /sccn

    wled

    authann. Yijue too reantatiisionation

    nces

    , Gencraticembecar Z.is. Uncar ZtationBiol

    car Z,ings on Y, Alerate;46:6n S, WpinalSejnowblindin F. Lthe bemicamarilable, Cufus EEGrol 19A, Yv

    racy w;110:B. EEGels. IE, Ermeysis. H

    A, MEEG;134:r F, Wnite-layer 3.9 7.1-layer 4.2 7.2rped MNI 2.9 7.5I 3.0 7.0

    cing the diffusion produced by the current passingskull (Wolters et al., 2006; Wendel et al., 2008).

    dual variances of the scalp maps versus the equivalents are close to each other across the different head mod-), although the computed Talairach coordinates of thedipoles for the left component in the four head mod-right column) differed by up to more than 1 cm. Moreomparisons for a large number of simulated equivalentce positions (not shown here) demonstrate that differ-uivalent dipole locations between these head modelsource location and orientation.

    issues

    problem with the segmentation module occurs whenMR images with high inhomogeneity. Using xed MRIresholds for scalp, skull and brain is insufcient if thenhomogeneity. The Check Inhomogeneity button intation user interface can be used to determine whetherimage needs correction. If this inhomogeneity checkction recommends performing inhomogeneity correc-tool such as found in Freesurfer. The NFT user manualw to pre-process MR images.

    ion and discussion

    have introduced the Neuroelectromagnetic Forwardling Toolbox (NFT), a GUI-integrated collection of mod-ning and solving the EEG forward problem using

    or semi-realistic warped template head models. BEMs may be generated from T1-weighted MR head imagesing a template head mesh to recorded 3-D electrode

    e Boundary Element Method (BEM) allows easier meshfrom available data compared with the Finite ElementM). While FEM potentially allows more accurate headg more tissue types and allowing specication of tis-py, generating thesemodels requires extra informationection anisotropy information gleaned from diffusionimages. For isotropic head models, BEM is at least asFEM and also provides better control over source dipolecar and Gencer, 1999).racy of the forward solution is also related to the sizemesh used to solve the forward problem. The distanceers determine the maximum size of the elements. Typ-er meshes generated by NFT have about 19,000 nodes.emory intensive computation in NFT is the generationrices done by the METU-BEM toolkit. The memory usedomputations is slightly larger than the total size of thees. For subject-specic realistic models generated by

    are plaing imallow isoftwalutionproblealso be

    Thetions aThe toloaded(http:/

    Ackno

    TheRen Duand Dralso likment tsegmesupervFound

    Refere

    Acar CEquadSept

    Akalin AThes

    Akaln-AmenMedfp/].

    Akalin Aceed

    Ataseveacce2008

    Baumanbros

    Bell AJ,and

    BooksteandAcad

    Chu V, H[ava

    Cohen DversNeu

    Crouzeixaccu1999

    Cufn Nmod

    Darvas Fanal

    Delormetrial2004

    Drechslefor , this will be approximately 4.8GB of memory using IPAt using IPA. A 3-layer mesh without IPA requires onlyenerating the matrices.e BEM matrix generation is resource intensive, it iscapabilities of modern workstations. Once the trans-s are generated, individual forward problem solutions

    tetrahedraGarlandM, Sh

    alization;Geddes LA, B

    pendium1967;5:27

    Gencer NG, Acity. Phys Mfor future releases. Other future plans include improv-egmentation to use multi-modal MR images which willased accuracy of CSF segmentation. We also plan to addr performing inverse source imaging using a high reso-cal surface-derived source space. Adding other forwardlvers including FEM and analytical concentric spheres isonsidered.includes an interface to EEGLAB, and EEGLAB func-

    data structures are compatible with NFT structures.x released under the GPL(v2) license may be down-

    http://sccn.ucsd.edu/nft or via the EEGLAB web site.ucsd.edu/eeglab/)

    gments

    ors gratefully acknowledge the assistance of Dr. Jeng-and Dr. Ruey-Song Huang in acquiring the MR imagesn Wang in processing the EEG data. The authors wouldthank Dr. Nevzat Gencer, for his vision and commit-listic head modeling. The BEM solver and parts of theon and mesh generation effort were created under his. This work was supported by gifts from the Swartz(Old Field, NY) and by NIH/NINDS (NS047293-04).

    er NG. Forward problem solution of ESI using FEM and BEM withisoparametric elements. In: Proceedings of IEEE EMBS conference;r, 1999.Electro-magnetic source imaging using realistic head models. Ph.D.iversity of Middle East Technical University, Ankara; 2005., Gencer NG. An advanced boundary element method (BEM) imple-for the forward problem of electromagnetic source imaging. Phys2004;49:501128 [available at http://www.eee.metu.edu.tr/metu-

    Makeig S. Neuroelectromagnetic forward modeling toolbox. In: Pro-f IEEE EMBC; 2008.kalin-Acar Z, Acar CE, Gencer NG. Parallel implementation of thed BEM approach for EMSI of the human brain. Med Biol Eng Comput719.ozny D, Kelly S, Meno F. The electrical conductivity of human cere-

    uid at body temperature. IEEE Trans Biomed Eng 1997;3:2203.ski TJ. An information-maximization approach to blind seperation

    deconvolution. Neural Comput 1995;7:112959.inear methods for nonlinear maps: procrustes ts, thin-plate splines,iometric analysis of shape variability. In: Brain warping. New York:Press; 1999. p. 15781.neh G. Matitk: extending MATLAB with ITK. The Insight Journal; 2005at http://www.sfu.ca/ vwchu/matitk.html].n NB, Yunokuchi K, Maniewski R, Purcell C, Cosgrove RG, et al. MEGlocalization test using implanted sources in the human brain. Ann

    90;28(6):8117.ert B, Bertrand O, Pernier J. An evaluation of dipole reconstructionith spherical and realistic head models in MEG. Clin Neurophysiol

    217688.localization accuracy improvements using realistically shaped head

    EE Trans Biomed Eng 1996;44(3):299303.r J,Mosher J, Leahy R. Generic headmodels for atlas-based EEG sourceum Brain Map 2006;27:12943.akeig S. Eeglab: an open source toolbox for analysis of single-

    dynamics including independent component analysis. J Neurosci M921 [available at http://www.sccn.ucsd.edu/eeglab/.olters C, Dierkes T, Si H, Grasedyck L. A full subtraction approach

    element method based source analysis using constrained delaunaylisation. NeuroImage 2009;46(3):105565.affer E. Amultiphase approach to efcient surface simplication. Visu-2002:11724 [available at http://mgarland.org/software/qslim.html.aker LE. The specic resistance of biological materialsa com-of data for the biomedical engineer and physiologist. Med Biol Eng193.ar CE. Sensitivity of EEG and MEG measurements to tissue conductiv-ed Biol 2004;49:70117.

  • 270 Z.A. Acar, S. Makeig / Journal of Neuroscience Methods 190 (2010) 258270

    Gencer NG, Akaln-Acar Z. Use of the isolated problem approach for multi-compartment BEM models of electro-magnetic source imaging. Phys Med Biol2005;50:300722.

    Gencer NG, Tanzer IO. Forward problem solution of electromagnetic source imag-ing using a new BEM formulation with high-order elements. Phys Med Biol1999;44:227587.

    Guziec A, Taubin G, Lazarus F, Horn B. Cutting and stitching: converting sets ofpolygons to manifold surfaces. IEEE Trans Visual Comput Graph 2001;7(2):13651.

    Heckbert PS, Garland M. Optimal triangulation and quadric-based surface simpli-cation. Comput Geomet 1999;14:4965.

    Heinonen T, Dastidar P, Kauppinen P, Malmivuo J, Eskola H. Semi-automatic tool forsegmentation and volumetric analysis of medical images. Med Biol Eng Comput1998;36:2916.

    Henderson CJ, Butler SR. The localization of equivalent dipoles of EEG sourcesby the application of electrical eld theory. Neurophysiology 1975;39:11730.

    Ibanez L, Schroeder W, Ng L, Cates L. The ITK software guide, second edition, NewYork: Kitware, Inc; 2005 [available online at http://www.itk.org/].

    Jung T, Makeig S, Mckeown MJ, Bell AJ, Lee T, Sejnowski TJ. Imaging brain dynamicsusing independent component analysis. Proc IEEE 2001;89:110722.

    Kavanagh RN, Darcey TM, Lehmann D, Fender DH. Evaluation of method for three-dimensional localization of electrical sources in the human brain. IEEE TransBiomed Eng 1978;25:4219.

    Kruggel F, Lohmann G. Brian a toolkit for the analysis of multimodal brain datasets.In: Proceedings of the computer aided radiology; 1996. p. 3238.

    LynnMS, TimlakeWP. Theuse ofmultiple deations in thenumerical solution of sin-gular systems of equations, with applications to potential theory. SIAM J NumerAnal 1968;5:30322.

    Makeig S, Bell AJ, Jung T, Sejnowski T. Independent component analysis of electroen-cephalographicdata. In:Advances inneural informationprocessing systems, vol.8. Cambridge: MIT Press; 1996. p. 14551.

    Meijs JWH, Weier O, Peters MJ. On the numerical accuracy of the boundary elementmethod. IEEE Trans Biomed Eng 1989;36:103849.

    Nobuyuki O. A threshold selection method from gray-level histograms. IEEE TransSyst Man Cybern 1979;SMC-9(1):626.

    Poston T, Wong T, Heng P. Multiresolution isosurface extraction with adaptiveskeleton climbing. In: Proceedings of eurographics, vol. 17; 1998 [available athttp://www.cse.cuhk.edu.hk/ ttwong/papers/asc/asc.html].

    Ramon C, Schimpf P, Haueisen J, Holmes M, Ishimaru A. Role of soft bone, CSF andgray matter in EEG simulations. Brain Topography 2004;16(4):2458.

    Riviere D, Regis J, Cointepas Y, Papadopoulos-Orfanos D, Ochiai T, Cachia A et al.A freely available anatomist/brainvisa package for structural morphometry ofthe cortical sulci. In: Proceedings 9th HBM CD-rom neuroimage, vol. 19; 2003[available at http://brainvisa.info/].

    Roth BJ, Balish M, Gorbach A, Sato S. How well does a three-sphere model predictpositions of dipoles in a realistically shaped head? Electroenceph Clin Neuro-physiol 1993;87:17584.

    RullmannM,AnwanderA, DannhauerM,Wareld S, Duffy FH,Wolters C. EEG sourceanalysis of epileptiform activity using a 1mm anisotropic hexahedra nite ele-ment head model. NeuroImage 2009;44(2):399410.

    Shattuck DW, Leahy RM. Brainsuite: an automated cortical surface identicationtool. Med Image Anal 2002;6:12942 [available at http://brainsuite.usc.edu/.

    Smith S. Fast robust automated brain extraction. Hum Brain Map 2002;17:14355.Talairach J, Tournoux P. Co-planar stereotaxic atlas of the human brain. New York:

    Thieme Medical Publishers; 1998.Taubin G. A signal processing approach to fair surface design. In: Proceedings of

    Siggraph; 1995. p. 3518.Weinberg H, Brickett P, Coolsma F, Baff M. Magnetic localization of intracranial

    dipoles: simulation with a physical model. Electroenceph Clin Neurophysiol1986;64:15970.

    Wendel K, Narra N, Hannula M, Kauppinen P, Malmivuo J. The inuence of CSF onEEG sensitivity distributions of multilayered head models. IEEE Trans BiomedEng 2008;55(4):14546.

    Wolters C, Anwander A, Tricoche X, Weinstein D, Koch M, MacLeod R. Inuenceof tissue conductivity anisotropy on EEG/MEG eld and return current com-putation in a realistic head model: a simulation and visualization study usinghigh-resolution nite element modelling. NeuroImage 2006;30(3):81326.

    Wolters C, Kstler H, Mller C, Hrtlein J, Grasedyck L, Hackbusch W. Numericalmathematics of the subtraction method for the modeling of a current dipole inEEG source reconstruction using nite element head models. SIAM J Sci Comput2007;30(1):2445.

    Wolters CH, Kuhn M, Anwander A, Reitzinger S. A parallel algebraic multigrid solverfor nite elementmethod based source localization in the human brain. ComputVisual Sci 2002;5:16577.

    Zhang Z, Jewett D. Insidious errors in dipole localization parameters at a single time-point due to model misspecication of number of shells. Electroenceph ClinNeurophysiol 1993;88:111.

    Zhang Z, Jewett D, Goodwill G. Insidious errors in dipole parameters due toshell model misspecication using multiple time points. Brain Topography1994;6:28398.

    Neuroelectromagnetic Forward Head Modeling ToolboxIntroductionToolbox functionalityBoundary Element MethodSegmentationMesh generationRegistration of electrode locations and scalp surfaceWarping

    NFT componentsHead modeling: segmentationHead modeling: mesh generationSource space generationCo-registration of electrode locationsHead modeling using template warpingForward problem solutions: BEM

    ResultsComputational complexityAccuracy of the BEM implementationSource localization comparisonsEffect of LMR ratio on 3-layer and 4-layer BEM head modelsReal EEG data example

    Known issues

    Conclusion and discussionAcknowledgmentsReferences