Method Article

Using a TMS Navigation System for High-Precision Digitization of Sensor Locations to Improve Source Localization

DOI:

10.3791/69508

January 23rd, 2026

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

We present a reproducible method for digitizing high-density electroencephalography (EEG) sensor locations using instruments of a Navigated Brain Stimulation (NBS) system. This approach does not require any additional software extensions, only standard NBS tools. Integrated with MNE-Python pipelines, this approach improves source localization accuracy without additional hardware.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Source localization is a technique used to estimate the sources of brain activity based on signals recorded from the scalp. Accurate source localization critically depends on the precise spatial digitization of sensor locations. In this protocol, we present a practical and reliable method for digitizing sensor locations using the Navigated Brain Stimulation (NBS) system. NBS is a component of Transcranial Magnetic Stimulation (TMS) equipment commonly available in TMS laboratories, but rarely utilized for sensor digitization of electroencephalography (EEG) or functional near-infrared spectroscopy (fNIRS) systems. This approach allows researchers to leverage existing infrastructure to significantly improve the spatial accuracy of source modeling, without investing in dedicated digitization equipment.

We guide viewers through the full workflow: (1) digitizing EEG electrode locations using default tools of the Nexstim NBS system; (2) exporting coordinate data in compatible formats; (3) integrating this data into EEG preprocessing and source localization pipelines using the MNE-Python package. The protocol also includes tips for aligning digitized data with MRI images and optimizing coregistration accuracy. To illustrate the method's practical utility, we apply it to analyze data from a tactile stimulation experiment.

Custom Python scripts for coordinate processing and coregistration are provided to ensure reproducibility and ease of adoption. The results show that incorporating digitized electrode positions remarkably improves the anatomical accuracy and interpretability of cortical source estimates compared to default electrode montages.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Electroencephalography (EEG) measures the brain's electrical activity at the scalp, but the raw recordings mix signals from many brain and non-brain sources. Source localization refers to computationally estimating where in the brain the measured EEG signals originate, effectively "mapping" scalp voltages back to cortical regions1. These methods let researchers link EEG oscillatory activity or event-related responses to specific brain areas, greatly enhancing EEG's interpretability. Achieving accurate source localization critically depends on knowing exactly where each electrode sits on the head relative to the anatomy. We must digitize the electrode positions to record their exact 3D locations on the head. These coordinates are then coregistered, or aligned, with the subject's MRI-derived head model for solving the EEG forward (predicting scalp voltages) and inverse (estimating brain sources) problems. Precise electrode placement is essential: even small digitization errors can shift the estimated source by up to a few centimeters or more in the brain.

Modern EEG source imaging is a multi-step process that integrates anatomical and functional information. It begins with electrode digitization, where the precise 3D coordinates of each EEG sensor are recorded on the scalp. Next, anatomical imaging is performed, typically through acquisition of the subject's structural MRI; if unavailable, a standard head model may be used2. The digitized electrode positions are then coregistered with the MRI head geometry, aligning them to the individual's anatomy. From this step, a transformation matrix is derived that maps electrode locations from head space to MRI space. The structural MRI is then segmented into tissues (scalp, skull, brain) with an MRI segmentation tool such as Freesurfer3 to build a realistic volume conductor model. With this model, the forward model is computed, combining electrode positions, head geometry, and tissue conductivities to predict scalp potentials for any hypothetical cortical source4. Finally, the inverse solution is estimated using methods such as distributed source imaging or dipole fitting to estimate the cortical current distribution that best explains the measured EEG data5. Each step is critical: the head model ensures anatomically plausible conductivities, the forward solution links sources to scalp potentials, and the inverse solution maps the recorded signals back onto the cortex. Conversely, errors in electrode digitization, coregistration, or MRI segmentation can propagate through the pipeline, leading to inaccurate source estimates.

Several digitizing methods are currently available, including ultrasound, electromagnetic system6, structured-light or infrared 3D scanning7, photogrammetry8, and motion capture with or without a probe9. While the technologies differ in hardware and procedure, their accuracy in locating electrodes is broadly comparable. Recent studies comparing these methods show that all of the approaches achieve electrode localization precision sufficient for reliable source estimation. For example, all methods tested achieved average Brodmann area identification accuracy above 80%, whereas relying solely on template electrode positions reduced accuracy to approximately 50%10. This demonstrates that, despite differences in implementation, modern digitizing techniques provide comparable reliability, significantly reducing the uncertainty of source localization relative to using generic templates, and enabling confident mapping of cortical activity.

An attractive alternative for labs equipped with transcranial magnetic stimulation (TMS) systems is to repurpose navigated brain stimulation (NBS)11 hardware for electrode digitization. NBS, also known as neuronavigation, typically combines an optical tracker and TMS coil to register the subject's head with their MRI and to stimulate a specific cortical target. Optical trackers (e.g., Polaris Vicra) consist of an infrared tracking camera and infrared reflective markers placed on the head tracker, navigation pointer, and TMS coil. For the digitization, the experimenter first places a head tracker on the participant's head, next touches each EEG electrode with the navigation pointer, and the system logs its 3D position, which may be later exported and used for source localization, e.g., with MNE-Python12. This workflow is analogous to other digitizers but leverages existing equipment: if a lab already owns a navigated TMS system (e.g., Nexstim eXimia NBS, or similar), no separate digitizer purchase is needed.

The advantages of this approach include integration and precision. The same coordinate space can be used for both TMS targeting and EEG source modeling. For labs performing simultaneous or sequential TMS-EEG, this method streamlines the setup: electrode digitization is just part of the TMS neuronavigation process. For labs that do not primarily use EEG source localization methods but already have access to TMS neuronavigation, this method offers a straightforward way to enhance the precision of source estimates.

Finally, note that this navigated digitization concept applies to other scalp sensor arrays as well. For instance, a similar procedure could localize fNIRS optodes13 or other sensors by touching each optode with the tracked pointer. In all cases, the benefit is a unified coordinate frame between the scalp sensors and the subject's MRI, improving the anatomical accuracy of any subsequent source modeling (whether EEG or fNIRS).

Several publications explicitly report the use of the NBS system for electrode digitization14,15,16,17,18. In contrast, a number of studies that employed both TMS (NBS) and EEG or fNIRS did not describe any digitization procedure19,20,21,22,23. This omission suggests that the available functionality of the NBS for electrode or optode digitization may have been underutilized, potentially affecting the accuracy of sensor localization and, consequently, the reliability of the reported findings. We assume that many researchers may be unaware that the NBS system can also serve as a coregistration tool, as this feature is not consistently emphasized by the manufacturer. Finally, we note that NBS can be applied for sensor digitization in any study involving head-mounted electrodes or optodes, regardless of whether TMS is used.

Access restricted. Please log in or start a trial to view this content.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

All procedures involving human participants were conducted in accordance with institutional guidelines and approved by the relevant ethics committee. Participants provided informed consent prior to the start of the experiment.

1. Preparing the participant and equipment

NOTE: This protocol used the Nexstim NBS system.

  1. Power on and calibrate the NBS system
    1. Turn on the NBS main unit and optical tracking camera. Verify that the system completes self-calibration successfully, and repeat the calibration if any errors are indicated by the software.
  2. Load the participant's MRI into the NBS system.
    1. In the NBS software interface, select the subject profile and load the structural MRI file in DICOM or Nexstim-compatible format.
    2. If the participant's MRI is not available at the time of recording, use an average head MRI provided by the NBS system.
  3. Prepare the EEG cap.
    1. Ensure the high-density EEG cap is correctly positioned on the participant's head according to the manufacturer's instructions. Verify electrode alignment using standard anatomical landmarks (nasion and preauricular points).
      NOTE: Maintain consistent electrode placement to minimize spatial error across sessions.
  4. Attach the optical head tracker to the participant's head.
    1. Secure the head tracker to the EEG cap or directly to the participant's head without obstructing the electrodes.
    2. Ensure that the camera detects the tracker and maintains a stable view during head movements. Use double-sided tape to attach the tracker firmly to the forehead.
      ​NOTE: Maintain the head tracker's position throughout the entire digitization process to avoid tracking errors.

2. Registration of the participant's head in NBS

  1. Perform registration in the NBS software.
    1. Begin the registration procedure and define the MRI landmarks in the software: nasion, left preauricular point, and right preauricular point.
    2. Use the navigation pointer to indicate and digitize these landmarks on the participant's head.
      NOTE: The NBS system does not allow digitization before registration is completed. Registration ensures correct visualization of the digitized points within the software but does not alter the absolute values of the recorded coordinates.

3. Digitization

  1. Digitize fiducials.
    1. Start digitization. Using the navigation pointer, record the three fiducial points: nasion, left preauricular point, and right preauricular point. Confirm that the software accurately captures each point before proceeding.
    2. Once complete, stop digitization and right-click on Digitization Exam to export the coordinates in text format. Save the file as {subject}_fid.nbe.
  2. Digitize head shape points (HSP).
    1. Start digitization. Collect at least 50-100 surface points evenly distributed across the scalp, avoiding areas with dense hair when possible. Include points on the nose bridge and brow ridge as additional anatomical landmarks.
    2. After collecting all points, stop the digitization and right-click on Digitization Exam to export the coordinates in text format. Save the file as {subject}_hsp.nbe.
  3. Digitize electrode positions.
    1. Start digitization. Touch the navigation pointer to the center of each electrode, ensuring stable contact for accurate coordinate recording.
    2. Follow a consistent sequence for each session, digitizing electrodes systematically by contours, from front to back and left to right, to avoid missing any electrodes.
    3. Once all electrodes have been digitized, stop the digitization and right-click on Digitization Exam to export the coordinates in text format. Save the file as {subject}_ele.nbe.

4. MRI preprocessing in FreeSurfer

  1. Run recon-all for surface reconstruction.
    1. Execute the FreeSurfer processing pipeline to generate cortical surfaces, scalp surfaces, and brain segmentations.
  2. Verify reconstruction quality.
    1. Inspect the pial, white matter, and inflated surfaces. Correct any major segmentation errors before proceeding further, e.g., with Blender 3D computer graphics software.

5. Integration with MNE-python pipeline

  1. Create a custom montage with the digitized coordinates.
    1. To integrate the digitized electrode positions, fiducials, and head shape points into the MNE-Python analysis pipeline, first, create a custom montage using the recorded coordinates (Supplementary File 1). Examples of .nbe files and code snippets are available at the GitHub repository (github.com/MarkaMorozova/NexstimNBS-SensorDigitization).
  2. Perform coregistration in MNE.
    1. Use the MNE coregistration GUI mne.gui.coregistration to align the digitized head shape points saved in {subject}-info.fif with the participant's MRI-derived head surface. Fit fiducials, adjust translation, rotation, and scaling parameters until the fiducials and head shape points match closely with the MRI model.
  3. Save the created custom montage and transformation file.
    1. Save the custom montage to a {subject}-info.fif file for future reuse. Also, save the transformation matrix {subject}-trans.fif obtained during coregistration, which is required for forward modeling.

6. Performing source localization

  1. Using the previously created info and trans files, perform source localization of EEG data. Import the participant's preprocessed EEG into MNE-Python, apply the custom montage from {subject}-info.fif, and load the coregistration transformation {subject}-trans.fif.
  2. Construct a forward model using the participant's MRI surfaces and volume conductor model (e.g., BEM). Then, compute the inverse solution with algorithms such as sLORETA, dSPM, or MNE to estimate cortical sources underlying the recorded EEG signals. Save the source estimates for further analysis and visualization.

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Accurate source localization critically depends on correct electrode placement and reliable coregistration with anatomical head models. In practice, however, EEG caps are often positioned imprecisely due to individual head shape variation or manual placement errors. To illustrate how these factors affect analysis outcomes, we compared results from digitized electrode positions using the NBS device with results obtained from standard template-based electrode layouts. The software and libraries primarily used for the analy...

Access restricted. Please log in or start a trial to view this content.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Accurate source localization requires both precise electrode digitization and reliable coregistration with anatomical head models. Our results (Figure 1, Figure 2, and Figure 3) demonstrate how deviations in electrode positioning or reliance on template-based montages can propagate into substantial errors in spatial alignment and source reconstruction. In particular, we showed that digitized electrodes obtained with the Nexstim NBS ...

Access restricted. Please log in or start a trial to view this content.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors have no competing financial interests or other conflicts of interest pursuant to this work.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
Navigated Brain Stimulation (NBS) SystemNexstim https://www.nexstim.com/healthcare-professionals/nbs-systemNBS is transcranial magnetic stimulation combined with a neuronavigation system

References

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,
  1. Michel, C. M., He, B. EEG source localization. Handb Clin Neurol. 160, 85-101 (2019).
  2. Holmes, C. J., Hoge, R., Collins, L., Woods, R., Toga, A. W., Evans, A. C. Enhancement of MR images using registration for signal averaging. J Comput Assist Tomogr. 22 (2), 324-333 (1998).
  3. Fischl, B. FreeSurfer. Neuroimage. 62 (2), 774-781 (2012).
  4. Hallez, H., et al. Review on solving the forward problem in EEG source analysis. J Neuroeng Rehabil. 4 (1), (2007).
  5. Grech, R., et al. Review on solving the inverse problem in EEG source analysis. J Neuroeng Rehabil. 5 (1), 25(2008).
  6. Jaiswal, A., Nenonen, J., Parkkonen, L. On electromagnetic head digitization in MEG and EEG. Sci Rep. 13 (1), 3801(2023).
  7. Taberna, G. A., Marino, M., Ganzetti, M., Mantini, D. Spatial localization of EEG electrodes using 3D scanning. J Neural Eng. 16 (2), 026020(2019).
  8. Qian, S., Sheng, Y. A single camera photogrammetry system for multi-angle fast localization of EEG electrodes. Ann Biomed Eng. 39 (11), 2844-2856 (2011).
  9. Reis, P. M. R., Lochmann, M. Using a motion capture system for spatial localization of EEG electrodes. Front Neurosci. 9, 130(2015).
  10. Shirazi, S. Y., Huang, H. J. More reliable EEG electrode digitizing methods can reduce source estimation uncertainty, but current methods already accurately identify Brodmann areas. Front Neurosci. 13, 1159(2019).
  11. Comeau, R. Neuronavigation for Transcranial Magnetic Stimulation. Transcranial Magnetic Stimulation. , Humana Press. New York, NY. (2014).
  12. Gramfort, A., et al. MEG and EEG data analysis with MNE-Python. Front Neurosci. 7, 267(2013).
  13. Tremblay, J., et al. Comparison of source localization techniques in diffuse optical tomography for fNIRS application using a realistic head model. Biomed Opt Express. 9 (7), 2994-3016 (2018).
  14. Huber, R., et al. Measures of cortical plasticity after transcranial paired associative stimulation predict changes in electroencephalogram slow-wave activity during subsequent sleep. J Neurosci. 28 (31), 7911-7918 (2008).
  15. Huber, R., Esser, S. K., Ferrarelli, F., Massimini, M., Peterson, M. J., Tononi, G. TMS-induced cortical potentiation during wakefulness locally increases slow wave activity during sleep. PLoS One. 2 (3), e276(2007).
  16. Huber, R., Felice Ghilardi, M., Massimini, M., Tononi, G. Local sleep and learning. Nature. 430 (6995), 78-81 (2004).
  17. Casali, A. G., Casarotto, S., Rosanova, M., Mariotti, M., Massimini, M. General indices to characterize the electrical response of the cerebral cortex to TMS. Neuroimage. 49 (2), 1459-1468 (2010).
  18. Salo, K. S. -T., Mutanen, T. P., Vaalto, S. M. I., Ilmoniemi, R. J. EEG artifact removal in TMS studies of cortical speech areas. Brain Topogr. 33 (1), 1-9 (2020).
  19. Amico, E., et al. Tracking dynamic interactions between structural and functional connectivity: a TMS/EEG-dMRI study. Brain Connect. 7 (2), 84-97 (2017).
  20. Cona, F., Zavaglia, M., Massimini, M., Rosanova, M., Ursino, M. A neural mass model of interconnected regions simulates rhythm propagation observed via TMS-EEG. Neuroimage. 57 (3), 1045-1058 (2011).
  21. Stamm, M., Aru, J., Bachmann, T. Right-frontal slow negative potentials evoked by occipital TMS are reduced in NREM sleep. Neurosci Lett. 493 (3), 116-121 (2011).
  22. Romero Lauro, L. J., et al. TDCS increases cortical excitability: direct evidence from TMS-EEG. Cortex. 58, 99-111 (2014).
  23. Lioumis, P., Kičić, D., Savolainen, P., Mäkelä, J. P., Kähkönen, S. Reproducibility of TMS-evoked EEG responses. Hum Brain Mapp. 30 (4), 1387-1396 (2009).
  24. Morozova, M., et al. Cortical responses to tactile imagery: a high-density EEG study of the μ-rhythm event-related desynchronization and somatosensory evoked potentials. NeuroImage. 319, 121440(2025).
  25. Pascual-Marqui, R. D. Standardized low-resolution brain electromagnetic tomography (sLORETA): technical details. Methods Find Exp Clin Pharmacol. 24 (Suppl D), 5-12 (2002).
  26. Pfurtscheller, G., Neuper, C. Motor imagery activates primary sensorimotor area in humans. Neurosci Lett. 239 (2-3), 65-68 (1997).
  27. Inamoto, T., et al. Motor-related mu/beta rhythm in older adults: a comprehensive review. Brain Sci. 13 (5), 751(2023).

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

Source LocalizationSensor DigitizationTMS NavigationEEG Electrode LocationsNavigated Brain StimulationSpatial AccuracyCoregistration AccuracyMNE PythonMRI AlignmentCortical Source Estimates

Related Articles