Abstract
Background:
Transcranial magnetic stimulation (TMS) is commonly used for assessing or modulating brain excitability. However, the credibility of TMS outcomes depends on accurate and reliable coil placement during stimulation. Navigated TMS systems can address this issue, but these systems are expensive for routine use in clinical and research environments.
Objective:
The purpose of this study was to provide a high-quality open source framework for navigated TMS and test its reliability and accuracy using standard TMS procedures.
Methods:
A navigated TMS system was created using a low-cost 3D camera system (OptiTrack Trio), which communicates with our free and open source software environment programmed using the Unity 3D gaming engine. The environment is user friendly and has functions to allow for a variety of stimulation procedures (e.g., head and coil co-registration, multiple hotspot/grid tracking, intuitive matching, and data logging). The system was then validated using a static mockup of a TMS session. The clinical utility was also evaluated by assessing the repeatability and operator accuracy when collecting motor evoked potential (MEP) data from human subjects.
Results:
The system was highly reliable and improved coil placement accuracy (position error = 1.2 mm and orientation error = 0.3°) as well as the quality and consistency (ICC >0.95) of MEPs recorded during TMS.
Conclusion:
These results indicate that the proposed system is a viable tool for reliable coil placement during TMS procedures, and can improve accuracy in locating the coil over a desired hotspot both within and between sessions.
Keywords
Introduction
Transcranial Magnetic Stimulation (TMS) is commonly used for studying or modulating brain plasticity in a noninvasive manner (Fujiwara et al., 2015; George et al., 2003; Hendy et al., 2015; Khedr et al., 2005; Khedr & Fetoh, 2010; Lepley et al., 2015; Platz et al., 2016; Simis et al., 2015). The need for accurate coil placement during TMS has been increasingly recognized because subtle changes in coil position and orientation during stimulation can alter current flow across neurons and significantly affect TMS results (Neggers et al., 2004; Schmidt et al., 2015; Sparing et al., 2008; Sparing et al., 2010). To address this issue, scientists have recommended the use of neuronavigation systems to precisely track coil position and orientation (Cincotta et al., 2010; Denslow et al., 2005; Julkunen, 2014; Julkunen et al., 2009; Sparing et al., 2010). While these systems are known to reliably improve the accuracy of coil positioning over the target area (Schonfeldt-Lecuona et al., 2005; Sparing et al., 2008), their cost is a major barrier for its use in research or clinic (Vaghefi et al., 2015).
Hence, we recently developed a low-cost TMS coil tracking system in LabVIEW Vision Assistant using commercially available webcams and floodlights and demonstrated that this system was reasonably accurate in tracking coil positions during TMS procedures (Washabaugh & Krishnan, 2016). However, there were some limitations to this system: (1) the cameras have to be calibrated during each use, particularly if the camera set-up was moved, (2) there were no co-registration options based on the participant’s anatomy, (3) the use of visible light cameras necessitated the requirement of a bright floodlight, which could be uncomfortable to the subject at times, (4) the reference markers have to be set to the same position on the scalp during each session, and (5) there was no high-end 3D user interface for providing visual feedback. Therefore, the purpose of this paper was to address the aforementioned limitations by developing a high-quality open source framework for navigated TMS and test its reliability and accuracy using standard TMS procedures.
Materials and methods
Hardware and software components
The hardware components of the system include: an OptiTrack V120 Trio system (pre-calibrated three-camera array with submillimeter precision at 120 FPS), a Manfrotto 058B tripod, calibration tool, stylus, and marker clusters (for tracking the head, and coil) (Fig. 1A). The cost associated with system hardware is about $3600. The software components of the system include: OptiTrack – Motive:Tracker (creates and tracks rigid bodies), an OptiTrack Unity 3D plugin (streams rigid body data from Motive to Unity), and NeuRRoNav (our custom software solution) written for Unity 3D game engine in C# (freely downloadable for non-commercial use at: http://www.neurro-lab.engin.umich.edu/).

(A) Schematic showing the hardware components (OptiTrack Trio camera and different marker clusters) of the developed low-cost system, (B) Screenshot of the user interface panel showing the various inbuilt features of the NeuRRoNav software, and (C) Screenshot of the camera viewports that provide feedback on coil position and orientation to the TMS operator.
The details of the operating procedures for the system can be found in the online video tutorial (https://www.youtube.com/watch?v=NtjApbOK1T8&feature=youtu.be). Briefly, the process first involves setting-up of ground plane and creation of rigid bodies (head, stylus, coil, and calibration tool) in Motive:Tracker using marker clusters affixed to the respective rigid bodies. The rigid body data are then streamed to the Unity-based NeuRRoNav software in real time via the OptiTrack Unity 3D plugin. As with any infrared cameras, care should be taken to minimize ambient lights (especially sunlight and other infrared light sources) and any reflection of ambient lights that is within the region of interest (i.e., near the rigid body segments) during the TMS session. The NeuRRoNav software provides a high-end 3D graphical user interface (GUI) to facilitate the TMS session. On startup, the operator must perform a series of set-up and co-registration processes (1) to establish the position and orientation of the head, coil, and stylus relative to their tracking clusters, and (2) to ensure that the coil can be tracked with respect to the subject’s anatomy in the local coordinate system. The user can use any commercial stylus (or create their own – 3D files are also available in our laboratory website) and easily establish the relationship between the tip of the stylus and its tracking cluster by simply touching the tip of the stylus to the physical centroid of the calibration tool and hitting the ‘calibrate stylus’ button. The stylus is then used to establish the local coordinate system for the coil and scalp by indicating certain physical points. Like other systems, the nasion and tragi (left and right) are used for creating a local coordinate system of the subject’s head. The approximate vertex, nasion, inion, and tragi are then used to scale a generic 3D head model to a similar size as a subject’s head for visual feedback.
3D user interface for visual feedback
After all rigid bodies are co-registered, the system allows for the creation of virtual hotspots (or grids) that can be matched using visual feedback within the GUI (Fig. 1C). During matching, a virtual coil that is in the hotspot location is projected onto the scalp. To facilitate matching, the user can select from multiple virtual coil geometries; available geometries include standard figure-of-eight (Fig. 1C) and double cone (Fig. 2) coil models (Magstim, Whitland, UK), as well as a generic model which can be used with any coil type (Fig. 3). When matching a hotspot, the user is provided with both spatial and numeric feedback delivered via three configurable viewports (Fig. 1C). The viewports provide different perspectives of visualization that can be orbited, zoomed, and repositioned. Feedback for matching accuracy is provided both as numeric (centimeters and degrees) and color (red to green to red) cues (Figs. 2 and 3). When the coil is placed with positional and rotational errors within a configurable tolerance (preferably set to ≤ 1 mm of positional error and ≤ 1° of rotational error), “Fire” is displayed on the screen as a cue for the operator to trigger the TMS device. The software will provide an audio cue if any of the rigid bodies are occluded during the calibration or matching process. The menus of the GUI also provide the option to save hotspots, grids, and coils so that they can be loaded later on for repeating a TMS session (Fig. 1B). Additionally, the user has an option to log the error data (position and orientation) during the TMS experiment (Fig. 1B).

Screenshot of the camera viewports that provide feedback on coil position and orientation to the TMS operator using a Magstim double cone coil. Note the operator receives both numeric feedback as well as color cues during TMS. The coil’s color changes from red (when the coil is away from the target) to green (when the coil configuration is close to the target) to red (when the coil configuration is within the ‘matching thresholds’ set at the start of the experiment). The screen will also display the term “Fire” as a cue for the operator to trigger the TMS device when the coil configuration matches the predetermined matching thresholds.

Screenshot of the camera viewports that provide feedback on coil position and orientation to the TMS operator using a generic coil (i.e., anything other than figure-of-eight and double cone coil). Note the operator receives both numeric feedback as well as color cues during TMS. The coil’s color changes from red (when the coil is away from the target) to green (when the coil configuration is close to the target) to red (when the coil configuration is within the ‘matching thresholds’ set at the start of the experiment). The screen will also display the term “Fire” as a cue for the operator to trigger the TMS device when the coil configuration matches the predetermined matching thresholds.
Validation experiments were performed to (1) evaluate the repeatability (i.e., stability) of the set-up and co-registration process, (2) test the system’s utility in collecting MEPs from human subjects, and (3) measure the effect the NeuRRoNav system had on operator accuracy.
The repeatability of the system was tested by creating a static mockup of a TMS session. A dummy head was placed on a platform 5 feet from the OptiTrack camera array and fitted with a cluster of tracking markers. The anatomical landmarks were then digitized using a stylus to establish a local coordinate system and to co-register the dummy head to the 3D head model in the NeuRRoNav software. A standard 70 mm figure-of-eight coil with a tracking cluster affixed to its handle was then rigidly fixed over the scalp surface of the dummy head using a Magventure coil holder. An arbitrary hotspot was established on the left side of the dummy head, and the location and orientation of the coil was logged for future use. The system was then shut off and restarted. The co-registration process was repeated and the hotspot information was reloaded. The error in the coil position and orientation (with respect to the hotspot) was logged and the same processes were repeated 5 times. To replicate experimental procedures in real world settings, the marker cluster on the dummy head was repositioned and the camera was moved in between testing trials. We also had 3 different experimenters perform the co-registration process to evaluate the between-operator reliability of the NeuRRoNavsystem.
The system’s utility in collecting MEPs was tested in four healthy adults (3 males and 1 female; Age: 28.3±16.6 years). Informed consent was obtained prior to the experiment and all procedures were performed in accordance with the University of Michigan Institutional Review Board. A linen cap was secured tightly on the subject’s head and a tracking cluster was affixed on the forehead via a headband. MEPs were collected via a surface electromyographic (EMG) sensor (Trigno EMG system; Delsys Inc., Natick, MA) placed on the belly of the first dorsal interosseous (FDI) muscle according to the recommendations of Cram (Cram et al., 2011). MEP data were normalized to the EMG value obtained from a maximum voluntary contraction (MVC) that lasted about 5 seconds. A custom program written in LabVIEW (v2011; National Instruments) was used to collect and process MEP data. The EMG signals were low pass filtered at 500 Hz using an 8th order analog Butterworth filter (SCXI 1143, National Instruments) and sampled at 1000 Hz using a 16-bit high accuracy M-series multifunction external data acquisition module (USB-6255; National Instruments) connected to a desktop personal computer via USB cable. A standard 70 mm figure-of-eight coil with a tracking cluster affixed to its handle and a Magstim 200 magnetic stimulator were used to deliver single-pulse TMS to the left motor cortex. The position and orientation that produced the largest and most consistent MEP was determined and was set as the target spot in the system’s software and subsequently marked on the cap using a permanent marker. Two MEP-recruitment curves were then obtained (90% to 130% of resting motor threshold; 5 trials at each intensity): the first using standard, manual cranial landmarks-based TMS procedure (pre-manual) and the second using the navigation system (pre-navigated). The entire process was repeated again after a 10 minute rest period (post-manual and post-navigated). The resulting MEPs were recorded alongside the coil location and orientation during stimulation.
Data analysis
The stability of the set-up and co-registration process was evaluated by examining the mean absolute error in coil position (euclidean distance) and orientation (yaw, pitch, and roll) in reference to the desired hotspot during the static mockup trials. The clinical utility of the device was evaluated for navigated and non-navigated TMS trials by examining the average peak-to-peak amplitude at each intensity (i.e., recruitment curve) and reliability (Intraclass Correlation Coefficients) of MEP data from the live TMS sessions. The coil placement accuracy during these sessions was also evaluated by examining the error in reproducing the coil position and orientation from the desired hotspot.
Results
The error in coil position and orientation during the static mockup of a TMS experiment was found to be 1.1±0.3 mm and 0.5°±0.2° (Yaw = 0.5°±0.2°; Pitch = 0.4°±0.1°; Roll = 0.6°±0.2°), respectively. These errors increased marginally when different experimenters performed the co-registration process (position error = 3.2±0.7 mm; orientation error = 0.9°±0.3°), indicating that the system was robust to small errors in the digitization process of anatomical landmarks. The error in coil position and orientation during the actual TMS experiment was found to be 1.2±0.1 mm and 0.3°±0.1°, respectively for the navigated TMS trials (Fig. 4A). However, the position (5.5±1.3 mm) and orientation (3.3°±1.3°) errors increased substantially when performing TMS manually without any feedback of coil position/orientation (i.e., non-navigated trials) (Fig. 4A). The coil positioning errors during the non-navigated TMS trials were paralleled by lower amplitudes of MEPs in comparison with the navigated TMS trials (Fig. 4B). Interestingly, the reliability in MEPs were not affected to the same extent as the amplitudes of MEPs; although, the intraclass correlation coefficients (ICC) were lower in the non-navigated trials (ICC = 0.93, Cronbach’s alpha = 0.96) in comparison with the navigated trials (ICC = 0.97, Cronbach’s alpha = 0.98).

(A) Bar graphs showing the errors in coil position (top left) and orientation (top right and middle panels) during the live TMS session. (B) Plots showing the MEP amplitudes (pk-pk) across various TMS intensities (90% to 130% of resting motor threshold) when TMS was performed manually (bottom left panel) without any feedback from the system (i.e., non-navigated) and using the feedback (bottom right panel) from the system (i.e., navigated). Note that the MEP amplitudes were substantially larger and errors in reproducing coil position/orientation were minimal when using the navigated system. Pre indicates 1st testing session and post indicates 2nd testing session. MEPs were normalized to the EMG values obtained during maximum voluntary contractions (MVCs).
There is a growing interest in the use of TMS for assessing cortical physiology and descending motor pathways; however, most TMS users typically use non-navigated approaches, as commercially available stereotaxic systems are expensive (∼$50,000) to acquire (Vaghefi et al., 2015). While the traditional, manual method (using cranial landmarks) of performing TMS can provide meaningful information about brain physiology (Lepley et al., 2014; Luc-Harkey et al., 2017; Palmer et al., 2017), reliable coil positioning over the targeted brain region (particularly 3D orientation) is often difficult to achieve. Such inaccurate and inconsistent positioning of the stimulating coil has been regarded as one of the largest sources of error in TMS outcomes (Conforto et al., 2004; Julkunen et al., 2009; Mills et al., 1992). We sought to address this issue by designing a low-cost, high fidelity noninvasive stereotaxic system using an OptiTrack Trio infrared camera and Unity 3D engine. We note that the cost of our set-up is much lower than many commercial systems in the market (< $5000 vs $50,000). Our results also showed that the tracking performance of the system was on a par with other high-end commercial systems (Julkunen et al., 2009; Schmidt et al., 2015; Sparing et al., 2008). Thus, the proposed system can serve as a suitable low-cost alternative for reliable coil positioning during motor cortical evaluation using TMS. Further, the proposed system can be used with any TMS coil or digitization stylus, thus allowing the user to integrate it easily with their existing hardware.
It is to be noted that the system cannot currently utilize magnetic resonance imaging (MRI) data to stimulate specific brain regions based on a participant’s anatomy, as there is no provision for co-registering the subject’s head to their brain images (Andoh et al., 2009; Luber et al., 2017; Schmidt et al., 2010). However, the open source nature of the software allows this function to be incorporated by a programmer with sufficient knowledge on Unity,signal processing, and neuroimaging. Additionally, we note that the reliability of MEPs were tested only on a hand muscle in a small cohort of pilot subjects; thus, it is unclear whether similar results would be observed in lower-extremity muscles. However, while we have not formally tested the reliability of the system using MEPs of the lower-extremity, the stability of coil positioning over a hotspot is typically better during lower-extremity TMS, as the coil geometry of the double-cone coil (typically used for stimulating the leg motor cortex) makes it to fit nicely on the subject’s head (unlike figure-of-8 coils). Thus, we anticipate that similar results would be observed when performing TMS over the lower-extremity motor cortex.
In summary, this study provides a novel low-cost open source framework for navigated TMS of motor cortex. The results from validation experiments indicate that the proposed system is highly reliable and improves coil placement accuracy as well as the quality and consistency of MEPs recorded during TMS. Thus, we believe that the proposed system may be a suitable alternative for accurately locating the coil over a desired hotspot during TMS sessions.
Footnotes
Acknowledgments
The authors would like to thank Magstim Ltd. for providing computer aided drawings of their D70 mm Alpha coil and 110 mm Double Cone coils, which were incorporated into the NeuRRoNav software. This work was supported in part by National Institutes of Health Grant No. R01 EB019834, and National Science Foundation Graduate Research Fellowship Program Grant No. DGE #1256260. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the funders.
