|Home | About | Journals | Submit | Contact Us | Français|
Accurate coil placement over a target area is critical during transcranial magnetic stimulation (TMS), as small deviations can alter testing outcomes. Accordingly, frameless stereotaxic systems (FSS) are recommended for reliable coil placement during TMS applications. However, FSS is not practical due to the cost associated with procuring such systems. Therefore, the purpose of this study was to develop a low-cost TMS coil tracking approach using simple webcams and an image processing algorithm in LabVIEW Vision Assistant.
A system was created using two webcams, retroreflective markers, and computer stereovision, for tracking the TMS coil over a target area. Accuracy of the system was validated in both the global and local reference frames, while repeatability was measured within- and between-days for placement of the TMS coil over the target area relative to the head. The feasibility of our system was also verified by collecting motor evoked potentials (MEPs) of first dorsal interosseous muscle from human subjects.
The results of this study indicated that the system was highly accurate and repeatable, and could track the coil position with < 5mm error and orientation < 1.1° error from the target. We also observed larger and more consistent MEPs when stimulating the brain using feedback from the coil tracking system than when the examiner attempted to stimulate without any feedback.
The findings suggest that webcam-based coil tracking is a feasible low-cost solution to track coil positions during TMS procedures.
Transcranial magnetic stimulation (TMS) is a noninvasive brain stimulation technique that is capable of monitoring and-or modulating brain excitability with high spatial and temporal resolution. It has been recognized as an effective tool for quantifying corticospinal excitability in cognitive and clinical neuroscience using single or dual pulse techniques (Bestmann and Krakauer, 2015; Chen et al., 2008; Edwards et al., 2013), and for neurorehabilitation of many neuromuscular and psychiatric disorders by means of repetitive TMS (Hallett, 2007; Hoogendam et al., 2010; Levkovitz et al., 2015; Saba et al., 2015; Sun et al., 2012; Wang et al., 2014). However, outcomes of TMS experiments can be confounded by the accuracy of coil positioning over the target area (Bestmann and Krakauer, 2015; Burke et al., 1995; Kiers et al., 1993; Schmidt et al., 2009), as slight changes in stimulator coil location/orientation could alter current flow across neurons (Di Lazzaro et al., 2001; Schmidt et al., 2015; Werhahn et al., 1994).
Frameless stereotaxic systems (FSS) exist to track coil position/orientation and locate the target area to deliver stimulations during TMS with high accuracy (Cincotta et al., 2010; Fleming et al., 2012; Freundlieb et al., 2015; Julkunen et al., 2009; Schmidt et al., 2015). FSS can also sync patient-specific or generic magnetic resonance imaging (MRI) data for stereotaxic placement of the TMS coil (Andoh et al., 2009; Cancelli et al., 2015; Schmidt et al., 2010). These systems find the target area relative to brain cortex geography or scalp, and remember the exact location for repeatability (Forster et al., 2014; Peterchev et al., 2012). Some systems are also capable of providing estimates of electric field gradients on the cortex (Schmidt et al., 2015). However, they are expensive and not feasible for all TMS users. More commonly, non-navigated methods are used, which are relatively accurate but do not allow for easy repeatability (Sparing et al., 2008; Weiduschat et al., 2009). These methods localize coil placement over the target area in relation to landmarks on the scalp (i.e. vertex). After approximating, the exact target area (i.e., the hot spot) is verified through motor evoked potentials (MEPs) elicited using TMS (Pascual-Leone et al., 1994; Pascual-Leone et al., 1995). A physical mark is then typically placed onto a cap that corresponds to the hotspot location. However, with this approach, it is difficult to track the orientation of the coil, which could significantly affect the amplitude of MEPs. Further, if the cap shifts during the procedure, the hot spot must be relocated. This could be problematic as relocation of the hotspot may not be accurate, which could confound the results (Kiers et al., 1993). In this paper, we describe a novel low-cost TMS coil tracking approach using simple webcams, passive markers, and an image acquisition and processing algorithm in LabVIEW Vision Assistant.
The hardware required for acquiring three-dimensional marker data were procured from Noraxon USA, Inc. (Scottsdale, AZ). These included two Logitech HD Pro Webcam C920 (1080p, 30 FPS), a SunPAK 6600DX heavy-duty tripod, a Rigid Industries floodlight, and 19 mm diameter spherical retroreflective markers (B&L Engineering, Santa Ana, CA, USA). A similar configuration using a single camera has previously been developed for 2D motion capture (Krishnan et al., 2015). The cameras were connected to a Windows computer via an USB 2.0 cable. All data were collected and processed using custom-written programs in LabVIEW and Vision Assistant, version 2011 (National Instruments Corp., Austin, TX, USA) (~ total cost for all hardware and software = $1640). The source code and executable files are freely downloadable from our laboratory website (http://neurro-lab.engin.umich.edu/downloads). The steps involved in acquiring, calibrating, and processing the data are as follows:
LabVIEW’s stereo vision calibration program was used to determine distortions between cameras and create a reprojection matrix (Q) that maps 2D pixel coordinates into 3D space (Equation 1). The program stores the matrix in a stereo calibration file for later use by the acquisition program. The camera distortions and matrix parameters are obtained by taking photographs of a calibration grid containing uniformly spaced dots at varying orientation (Fig. 1C). The parameters of the reprojection matrix (Q) include: the projection of a real-world points into an image seen by the left camera (cx, cy), the projection of real-world points onto the x-axis of the right camera ( ), the focal length of both cameras (f), and the baseline distance between the cameras (Tx) (Fig. 1A).
After obtaining the reprojection matrix through calibration, a stereovision acquisition program was used to collect 3D depth data. Using the Vision Acquisition Express VI in the National Instruments Vision Development Module, the cameras were set to capture video recordings either at high (1600×896) or low resolution mode (800×600) at 30FPS with the following parameters: Video Mode 47 (high resolution MJPG) or 32 (low resolution MJPG), Gain = 0 (minimum), White Balance = 2000 (minimum), Brightness = 173 (medium), and Exposure = .5 (maximum). The program then filtered the image data for the brightest (whitest) parts of the image using the IMAQ ColorThreshold VI. If a pixel is past a whiteness threshold, the pixel value is set to 1, otherwise the value is set to 0. Thus, all the retroreflective marker pixels are set to 1. Next, the IMAQ Get Image VI was used to rectify images by transforming them to a common plane. The IMAQ Count Objects 2 VI then counted all objects inside a selected region of interest and outputted the real-time pixel coordinates of all recognized markers (Fig. 1D). After subtracting the disparity between both rectified images, pixel coordinates of the markers were transformed to 3D depth data in equation 2 using the reprojection matrix (Q).
In this matrix multiplication, x and y were the coordinates of the marker in the left image frame and d was the disparity of x coordinates of the objects between rectified images. Depth data in the global (camera based) frame were obtained once X, Y and Z above are divided by W. Pixel coordinates were also converted to the units of Tx [cm] during this step.
The following section describes the method for processing depth data in real time for tracking of the TMS coil with respect to the head. First, clusters containing three retroreflective markers were fastened onto the TMS coil and on a bony landmark of the subject’s head (most prominent part of the forehead; Fig. 1B). Depth data obtained for these markers were known in the global reference frame as seen by the camera. Orthonormal local axes systems were created for each cluster of markers (Coil, ŶCoil, Coil and Head, ŶHead, Head) in order to allow for tracking of the coil relative to the head. These axes systems were created in accordance with the left hand coordinate system convention [i.e., left (x), superior (y), anterior (z)]. We measured translation of the coil by creating a vector in 3 between the centroids of each cluster and mapping it to the local head axes, creating a set of x, y, and z coordinates. The endpoint of the vector was then relocated to the center of the coil by offsetting the distance from the centroid of the coil marker cluster to the coil center. Further, roll, pitch, and yaw angles denoting orientation of the coil axes with respect to a fixed head axes were determined using equations 3 and 4, from the rotation matrix ( ). The system’s output, composed of the vector components and angles, provided the six degrees of freedom necessary to determine coil location and orientation over the scalp.
Experiments were designed to: 1) validate the system in the global reference frame, 2) measure with-in and between-day repeatability of the system’s output parameters, 3) validate the system while relocating a target area over the scalp and for accuracy against a commercial 3D camera system, and 4) demonstrate the systems utility in collecting MEPs from human subjects. In order to validate the system in the global frame, we created a high-precision custom grid that allowed placement of a single retroreflective marker in 2cm increments. The system was used to measure the change in position between grid locations in the three principle directions (x, y, and z) in the global reference frame. Validity of the calculated position data was then determined by establishing calibration curves, and analyzing differences in the system’s calculated x, y, and z against known marker locations.
In order to test with-in and between-day repeatability of our system’s output parameters in the local reference frame of the head (i.e., local coordinate system), a target area was marked on the scalp of a dummy head and a coil (110mm double-cone) was fixed in place at that position. The six output parameters (x, y, z, roll, pitch, and yaw) were measured with the camera setup at 4 feet (1.22m) from the target, using both high and low definition camera settings at this stimulation location. We chose to place the camera at 4ft from the target because our pilot experiments demonstrated that at this distance we were able to filter out extraneous reflective objects and maintain sufficient capture volume for the head and coil. Data were collected twice within day and the setup was left overnight. The following day, the output measures were re-measured, first without recalibration, then after moving the camera setup (6ft/1.83m), and finally after recalibrating. This procedure was repeated using a 70mm figure-of-eight coil.
For testing accuracy in the local reference frame of the head while placing a coil over a desired target area, an examiner attempted to position the coil over the scalp of a dummy head using a virtual interface provided by the low-cost system. The interface displayed deviation of the coil location and orientation from the desired location as feedback to the user. The outputs from our system were validated against a commercial 3D camera system (OptiTrack V120:Trio, NaturalPoint, Inc., Corvalis, OR, USA) and software (OptiTrack Motive:Tracker). First, using a coil holder, a figure-of-eight coil was fixed in place over the scalp and each system was zeroed at this location. Next, the examiner removed the coil and repositioned it by matching the low-cost system’s feedback. Once the examiner felt that the coil had the correct position and orientation, they then saved the measured location and orientation using the low-cost and commercial systems. This process was iterated five times, not only while using the system interface as feedback (Navigated), but also while placing the coil without feedback (Non-navigated). The error in matching the location and orientation was compared between matching conditions (navigated vs. non-navigated). The error in coil repositioning was also computed using a probabilistic model that evaluated the chances of locating the target area within a certain distance.
Finally, the utility of the low-cost system was evaluated by collecting MEPs on human subjects. Four young healthy adults (all males) without any contraindications to TMS provided informed consent in order to participate in this experiment. All procedures were performed in accordance with the University of Michigan Institutional Review Board. MEPs were collected using surface electromyography (EMG) of the first dorsal interosseous (FDI) muscle. After preparing the skin, an electrode (Trigno, Delsys, Natick, MA) was placed over the belly of the muscle. A cap was placed on the subject’s head and a marker cluster was fixed to the forehead using an elastic headband. Single-pulse TMS was delivered over the left motor cortex via a standard 70 mm figure-of-eight coil attached to a Magstim 200 magnetic stimulator (Magstim, Whitland, UK). TMS pulses were delivered while the subject sat resting their forearm over the armrest of the chair. The stimulation site (and the orientation) that produced the largest and most consistent MEPs was marked on the cap worn by the subject and the system was zeroed at this location; the examiner then removed the coil. Stimulation intensity was held constant throughout the experiment. The examiner then attempted to replicate the original position using the marks on the cap (i.e., without feedback from the system) in the non-navigated condition, and using the system’s feedback in the navigated condition. For the navigated condition, a second examiner who was blinded to the target location collected MEP data on two subjects using the feedback from the low-cost system. This was performed to remove examiner bias and to further verify the ease of using the low-cost system during TMS procedures. During each condition the examiner recorded a total of ten MEPs. The recorded MEPs, as well as the coil location and orientation during stimulation, were then ensemble averaged to obtain the peak-to-peak MEP amplitude for each subject. The peak-to-peak MEP amplitudes for each condition were then averaged across subjects.
In validating the camera’s ability to track a single marker in the global frame, we found that the readings from the camera to be both accurate and repeatable (Table 1). Independent linearity was ~ 1.0% or less for all three directions, indicating a direct correlation between actual and measured distances. The measured accuracy was also very high (~1.0 to 2.0%; Table 1) for all three directions.
Within- and between-day repeatability testing yielded minor differences when measuring distances between cluster centroids (x, y, and z) and orientation (roll, pitch, and yaw angles) using the low-cost system (Table 2). These results were consistent irrespective of coil type (Table 2). Moving the cameras farther away from the target increased measurement error; however, error was reduced after recalibration of the cameras. We found that measurements recorded with high definition camera settings were more stable than those taken in low definition, but occurred at a slower processing speed. Additionally, calibration of the high resolution system is more difficult; therefore, the low-resolution system may allow for better utility during TMS.
When validating the accuracy of the system against the commercial system, the error in locating the target area was low (x = 0.02mm, y = 0.8mm, z = 4.8mm; roll = 0.3°, pitch = 1.1°, and yaw = 0.6°) with our low-cost system. However, the error in locating the target area was much higher for the non-navigated condition (x=4.2mm, y= 4.1mm, z=0.5mm; roll=1.2°, pitch=5.3°, yaw=6.6°). The probabilistic model indicated that the examiner was able to locate the coil within 3mm of the target area with ≈90% accuracy (Fig. 2).
The MEPs were much larger and consistent during the navigated condition than during the non-navigated condition (Fig. 3A). This was also the case when the examiner was blinded to the target area during the navigated condition (Fig. 3B). The average MEP amplitude was almost two times larger in the navigated condition in comparison to the non-navigated condition (Fig. 3C). As expected, the examiner was nearer to the desired location and orientation during navigated TMS (Fig. 3D), which was reflected in the quality of the MEPs.
Transcranial magnetic stimulation is a commonly used noninvasive technique to monitor or alter cortical excitability. However, non-navigated methods do not easily allow for repeatability and this potentially confounds study outcomes. This study showcases a low-cost system for accurately placing TMS coils over a target area on the scalp with proper orientation and to aid in repeatability.
The camera system is very reliable when measuring marker coordinates in the global reference frame. This is shown by low errors in repeatability and accuracy over measured grid locations. The high independent linearity of the system indicates that the system could be utilized not only as a tool for TMS, but also as an instrument for more general object tracking and biomechanical applications (e.g., 3D gait kinematics, reaching trajectory, etc.). The system could also aid in electrode positioning during transcranial direct current stimulation (tDCS) applications, as it would remove the need for a cap placed on the subject’s head and allow for repeatability if studying tDCS-induced changes in cortical plasticity.
During repeatability testing in the reference frame of the head, the system showed that it was able to measure the coil’s location and orientation over the target area with negligible changes from baseline measurements. Accuracy was influenced after moving the camera setup further from the target area, but this was expected from equation 2, because the disparity of the images increased while the baseline distance between cameras remained the same. Repeatability was maintained after recalibration; however, recalibration may not be necessary between days as long as the camera setup is not altered and kept at a similar distance to the target. Overall, the system demonstrated high repeatability in measuring coil location/orientation over the predefined target area (Table 2).
The system proved to be accurate in matching a target location. During a TMS session where the user placed the coil over the scalp using a virtual interface that displayed the system’s output (x, y, z, roll, pitch, and yaw) as feedback, we were able to locate the coil over the target area with high accuracy, which was verified using a commercial 3D camera system. The amount of error seen while using our system was similar to that seen in the literature for other frameless stereotaxic systems, which are estimated to be up to 5mm (Forster et al., 2014; Julkunen et al., 2009; Schmidt et al., 2015; Sparing et al., 2008). Additionally, we found that when using our low-cost system during TMS on human subjects, the measured MEPs were larger than those collected by placing the coil without any feedback (non-navigated). This appeared to be primarily due to changes in coil location and orientation during non-navigated stimulation.
There are some limitations to the system. If this system (or any neuronavigation system) was to be applied in the research or clinical setting, it would increase the time needed to setup and run the experiment compared to non-navigated TMS (Julkunen et al., 2009); this is especially true for our system, as the cameras must be calibrated. Further, unlike commercial systems, this system can only provide feedback and save relative coil position and orientation, and cannot be used as a full integrated data collection system (e.g., to collect MEP data). This system provides tracking of the coil for target area relocation relative to the scalp. However, TMS coil placement should be optimized relative to the brain surface and the scalp is not an ideal estimate of the underlying brain geography (Julkunen et al., 2009; Sparing et al., 2008). Additionally, as with any motion tracking system, the environment and camera settings must be controlled to provide proper repeatability, as changes in ambient light, camera brightness, and contrast settings can potentially affect reliability. Finally, there is potential for increased error between days depending on placement of the marker cluster on the subject’s head; however, this can be easily addressed by fixing the markers to a non-reflective optical frame, which is done routinely in other commercial FSS systems.
The findings of this study indicate that the described system is a suitable low-cost option to guide coil placement during TMS procedures. Systems such as this could make non-FSS based TMS procedures more repeatable and findings less confounded by coil placement errors. However, if cost is not an issue, errors can further be reduced using FSS that measure coil placement relative to the underlying geography of the brain by means of magnetic resonance images.
Research reported in this publication was supported by (1) National Institute of Biomedical Imaging and Bioengineering (NIBIB) of the National Institutes of Health (Grant# R01EB019834)