Procedure
We provide all scripts needed to perform this protocol (gitlab.gwdg.de/tms-localization/papers/tmsloc_proto) and an exemplary data set (SI) from a single subject from a previous study2. See the installation.md document for information on installing the necessary software, i.e., a Python environment, the head modelling and electric field simulation software SimNIBS, and the pyNIBS python package for pre- and post-processing. The provided scripts accompany this protocol and are documented extensively. All scripts may be customized to meet individual requirements. All paths and folders in this protocol refer to the repository root folder.
Preparation
1 Volunteer clearance
Obtain written informed consent from the volunteer for all subsequent procedures. Follow safety guidelines, applicable national laws, and possible insurance requirements (see REAGENT SETUP) while performing the medical screening.
TIMING: 30 min
BOX 1 | POSITION OF VOLUNTEER AND EXPERIMENTERS
Position of volunteer
During TMS mapping, the volunteer sits comfortably with the right arm resting on a pillow on their lap at half abdominal height. The volunteer must wear earplugs and completely relax arm and hand muscles. The wrist is in a neutral position and the fingers are in a resting position with slight flexion. Use the electromyogram (EMG) signal to confirm complete relaxation. Remind the volunteer to avoid arm, hand, and finger muscle contractions throughout the TMS procedure. Small movements and adjustments are only allowed between stimulations.
Position of experimenters
The experimenter holding the TMS coil (a) stands sideways behind the volunteer, such that both the neuronavigation and the EMG signal can be watched. The second experimenter (b) starts, pauses, and stops the experiment and controls data recording.
FIGURE B1: Position of volunteer and experimenters. (a) One experimenter (KW) positions the TMS coil over the motor cortex of the volunteer (ON) and (b) a second experimenter (TRK) controls the stimulator and monitors the motor evoked potentials. (c) The belly tendon montage to measure motor evoked potentials from FDI, ADM, and FDI.
2 MRI acquisition
Precise head models are constructed from high resolution (i.e., at most 1 mm³ voxel size) structural MRI scans. A 3 Tesla MRI scanner with a 32 channel head coil yields sufficient quality. The acquisition of a T1-weighted image is mandatory to proceed with the protocol. We strongly recommend acquiring a T2-weighted image with the same voxel size to improve skull segmentation26,31. To increase accuracy of the electric field calculations, a diffusion-weighted MR image (dMRI) can additionally be used to provide conductivity anisotropy information. The example data set contains a high-resolution T1-weighted image, a high-resolution T2-weighted image, and a diffusion MR image. Detailed sequence information is provided in the example data set.
TIMING: image acquisition: T1: 10 min, T2: 10 min, DWI: 20 min
FIGURE 2: Example MRI data for ‘subject_0’ used for head model construction and field modelling. Left: T1 weighted MRI. Center: T2 weighted image. Right: Fractional anisotropy (FA) map from the DWI scan.
3 Creating the subject object file
Data organization of the individual volunteers is done with the pyNIBS package by using subject objects. The example data set provides an example of a fully configured subject object file. In the following steps we describe the general procedure to create a new subject.
Execute the 01_create_new_subject.py script to create a new subject object template file and the folder structure as shown in Fig 3.
> python scripts/01_create_subject_structure.py -f ./subject_0
TIMING: 1 sec
FIGURE 3: Initial structure of the subject data folder.
Convert MRI scans into the NIfTI .nii format38 with dcm2niix (www.nitrc.org/plugins/mwiki/index.php/dcm2nii) and copy them to the correct subfolders of subject_0/mri/0/original/nifti/. Edit create_subject_0.py and enter the filenames of the nifti files and the image properties into the MRI section as shown in Fig. 4. Enter the ‘dti_readout_time’ as stated in the .yaml file from dcm2niix.
FIGURE 4: MRI section of create_subject_0.py script.
Enter the mesh information in the mesh section as shown in Fig. 5. Mesh resolution can be controlled with the vertex_density option to set the vertex density of the surface meshes in nodes per mm². For 0.5, 1.0, and 2.0 nodes per mm² the resulting head meshes will contain around 4, 9, and 18 million tetrahedra, respectively. For the current study, we recommend a density of 1 node per mm².
FIGURE 5: Mesh information in the create_subject_0.py script.
TIMING: 15 min
4 Defining the region of interest
To speed up the data analyses a region of interest (ROI) is created to an a priori defined brain area. This ROI is typically defined halfway in between the grey and white matter surfaces, the ‘midlayer’, because field estimates (step 13) are more robust in the midlayer compared to tissue boundaries. A ROI can be defined based on the subjects masks from MNI or FreeSurfer39,40 (http://surfer.nmr.mgh.harvard.edu/) fsaverage templates. Here, we use an fsaverage ROI template file covering the left somatosensory cortex (BA 1, BA 3), the left primary motor cortex M1 (BA 4), and the dorsal part of the left premotor cortex (BA 6). This file is provided together with other examples in the example data set (roi/lefthandknob_M1S1PMd.overlay).
Add the ROI information to the create_subject_0.py script (Fig. 6), including the filenames of grey matter (GM), white matter (WM), and midlayer surfaces as well as of the individual ROI mask. Enter the path to the template ROI .overlay file in fn_mask_avg. The template ROI is later (step 5) transformed to the individual subject space and a subject specific .mgh mask file is created in fn_mask. For the example subject this transformation can also be skipped by copying the provided file mask_lefthandknob_M1S1PMd.mgh to the midlayer_m1s1pmd folder in case FreeSurfer is not installed. See the TMSloc_proto repository for information on how to construct your own ROIs, for example based on group fMRI results.
FIGURE 6: ROI section in the create_subject_0.py script.
Finally, execute create_subject_0.py to create the subject_0.hdf5 subject object file. Execute this script again in case of any changes updating the subject object file. The example data set contains a fully configured subject object file for comparison.
TIMING: 10 min
5 Constructing the head model and region of interests
CRITICAL: The quality of the head model strongly affects the accuracy of the electric field calculations and should always be inspected visually for correctness and plausibility.
Construct the head model and the conductivity tensors from the acquired MR images by executing the following script:
> python scripts/02_make_msh_from_mri.py -s subject_0.hdf5 -m mesh0
Parameters:
s : Path to subject object file
m : Mesh ID
TIMING: Constructing mesh: 8.5 h; Creating ROI: 0.27 h ; Creating FA: 0.34 h
This utilizes the headreco pipeline of SimNIBS to segment the MR images into different tissue types and creates a volumetric head mesh. Diffusion tensors are reconstructed in GM and WM if a dMRI scan is provided. The mesh will be saved in the folder subject_0/mesh/mesh0. Locate this folder and visually inspect the quality of the meshing procedure:
> headreco check subject_0
This shows the reconstructed surfaces overlaid on the raw MRI data with the freeview tool. A second instance overlays the subject’s anatomical scan normalized to the MNI template to inspect normalization accuracy. Lastly, the final head mesh is loaded with Gmsh41. Carefully inspect the segmentation boundaries and the registration results for any implausible results.
The (optional) reconstruction of diffusion tensors from the diffusion MRI data is visualized with:
> dwi2cond -c subject_0
The fractional anisotropy (FA) image before and after preprocessing is superimposed on the subject’s anatomical scan with fslview or fsleyes for visual inspection of the coregistration.
The final mesh from the example data set with its six tissue types is visualized in Fig. 7. Here, a vertex density of 1.0/mm yielded 10.832.185 tetrahedra and 1.620.479 nodes.
TROUBLESHOOTING: Unreasonable mesh geometries, e. g., wrong segmentation, cortical matter outside of the head, doubled or shifted brain segments, might occur due to bad MRI quality or incorrect coregistration. Check the quality of the MR images for low signal-to-noise or low intensity as well as a strong signal inhomogeneity. Manually set origins of the MRI coordinate systems for all images to a similar location, e. g., center of anterior commissure. If the segmentation was successful but the mesh construction fails, restart the script with a slightly different vertex density.
FIGURE 7: Head model from the example data set “subject_0” constructed with the headreco25 pipeline.
BOX 2 | VISUALIZATION OF HEAD MODELS AND RESULTS USING PARAVIEW
The generated head models as well as the electric field profiles and the cortical R² goodness-of-fit maps can be visualized with ParaView42,43. We provide file tuples of .hdf5/.xmdf files containing the data and the geometry information, which can be loaded into paraview. We also provide ParaView state files of Figs. 7, 12, 15, and 16 in the corresponding git repository (https://gitlab.gwdg.de/tms-localization/tmsloc_proto) to allow reproducing the visualizations. When loading the state files select “Choose File Names” and select the .xmdf file you want to visualize. An example of how Figure 7 is created is shown in Figure B1.
Figure B2: Paraview window after loading the state file Fig_7_headmodel.pvsm from the git repository (gitlab.gwdg.de/tms-localization/tmsloc_proto)
After constructing the head model, we suggest refining the mesh in relevant regions to increase accuracy of the electric field estimation in these areas. Edit the create_subject_0.py script and add a new refined mesh (Fig. 8) called mesh0_refinedM1 and set the refine_domains argument to increase mesh density in CSF, GM, and WM within a specified sphere. Here, we chose a point on the skin surface in the coordinate system defined by the NIfTI header of the SimNIBS-processes MR-image (subject_0/mesh/mesh0_refinedM1/subject_0_T1_conform.nii.gz) above the primary motor cortex, where the TMS coil touches the skin. Add the ROI to the refined mesh as well (Fig. 9). In addition to refining the mesh in the region of interest, the skin surface is smoothed by setting the argument smooth_domains to skin. A smooth skin surface is required when determining the optimal coil position in step 15 of the protocol because the induced electric field in the cortex is very sensitive to changes in the coil distance.
FIGURE 8: Information of the refined mesh in the create_subject_0.py script.
FIGURE 9: ROI information of the refined mesh in the create_subject_0.py script.
Update the subject object file by executing create_subject_0.py and run the following script to create the refined mesh:
> python scripts/03_refine_mesh.py -s subject_0.hdf5 -m mesh0 -o mesh0_refinedM1
Parameters:
s : Path to subject object file
m : Mesh ID (original)
o : Mesh ID (refined)
TIMING: 2h
The refined mesh will be created in the folder subject_0/mesh/mesh0_refinedM1. Fig. 10 shows both head models side by side. Bone and skin regions are not refined because their influence on the TMS induced electric fields is weak44. All following analyses are performed with the refined mesh.
FIGURE 10: Original (a) and refined head mesh with smoothed skin surface (b).
6 TMS laboratory preparation
The initial motor threshold hunting procedure must be started with a reasonable cortical target, for example or from previous work2 (FDI: -34.19, -14.33, 66.83). Run the 04_get_initial_m1_coords.py script to transform template coordinates into subject space.
> python scripts/04_get_initial_m1_coords.py -s subject_0.hdf5 -m mesh0_refinedM1
Parameters:
s : Path to subject object file
m : Mesh ID
TIMING: .1 secs
Enter these subject specific coordinates (see Table 1 for the initial target coordinates for the example subject subject_0) as the target coordinates in the neuronavigation system to start the initial motor threshold hunting procedure with (step 7).
Table 1: Target coordinates in MNI and subject space of example subject_0.
Target Subject space MNI space
left-M1 [-35.96, -39.47, +45.74] [-37, -21, +58]
A modified T1 image is generated during head model construction with a coordinate system that corresponds to the mesh. Use this image, subject_0/mesh/mesh0_refinedM1/subject_0_T1_conform.nii.gz, for the neuronavigation system to minimize post-processing steps. Initialize the neuronavigation session according to the neuronavigation manual and use the individualized coordinates from 6.1) as the initial target.
Recording valid MEPs relies on correct filtering parameters. These include gain (10,000) and filtering (highpass 30 Hz, lowpass 1 kHz). Different hardware setups might require different values or other parameters and should be checked carefully for artifacts before.
The interstimulus interval must not be shorter than 5 s to avoid facilitation or depression of the MEP amplitude45. Configure your stimulation/EMG setup to stimulate once approximately every 5 seconds with a short jitter of at least 200 ms46 and to record the EMG data in a time window of at least 200 ms starting at the TMS pulse, with at least 2 kHz sampling rate. We provide a configuration file for the Signal software in the example data set.
TIMING: 10 min
TMS experiment
7 Electrode placement and EMG recording parameters
Ask the volunteer to take a comfortable position in the lab seat. Apply EMG surface electrodes in a standard belly-tendon montage for the muscle or muscles for which the rMT is to be determined (Fig. 11). The first dorsal interosseous (FDI) muscle of the right hand for right-handed volunteers is commonly chosen for rMT estimation. Data from multiple muscles might be recorded during a single experiment. Place the active electrode over the muscle-belly, the reference over the proximal tendon and the ground electrode at the back of the wrist of the same hand (see Kleim et al.7 for detailed instructions). Both, pre-gelled self-adhesive electrodes as well as passive EEG electrodes have been used in our laboratories yielding similar results. Skin-preparation, i.e., fat removal and skin peeling, is advised. In addition, fixate all electrodes with strips of tape, as this has proven useful to keep skin-electrode contact stable. Ask the volunteer to place their arm and hand on a table, cushion, or similar to allow relaxation of all muscles. Perform an electrode impedance check and visually inspect the signal for an adequate low noise level (about 10 μV) and for correct muscle activity recognition.
CRITICAL: If recording EMG data from multiple muscles simultaneously, note which channel records data from which muscle.
TROUBLESHOOTING: In case of a high noise level, assure that the volunteer’s hand is in a relaxed position. Assure good skin contact of the electrodes or replace the electrodes with new ones. Check the amplifier settings for correct parameters. Remove any electronic devices with a high radiation power such as mobile phones from the proximity of measurement electronics.
TIMING: 10 min
FIGURE 11: Electrode placement for EMG recordings using a bipolar belly-tendon montage. Modified plates #424 and #425, originally published in 47.
8 Neuronavigation preparation
Preparation of the neuronavigation software might differ between manufacturers, but should include the following steps: 1) co-register the TMS coil, 2) co-register the volunteer to the anatomical scan, 3) record data.
CRITICAL: A precise co-registration of volunteers to their anatomical MR image is indispensable for a valid and precise functional localization. Closely follow the manufacturer’s manual for the co-registration. In addition to landmarks (e.g. nasion, tragi, lateral corners of the volunteer’s eyes), experimenters should sample the volunteer’s head surface evenly if possible, including the forehead, posterior areas (inion), lateral areas, and superior areas. Assure a stable fixation of the tracking device that is attached to the volunteer’s head during the whole experimental process and take into account potential obstructions by the coil and its handle or cable while placing it.
CRITICAL: Co-registration of the TMS coil is of similar importance and should be visually inspected throughout the experiment. Place the coil-tracker in a way that takes into account potential obstructions by the TMS coil and the experimenter. The coil has to be recognized from different angles, from 0° to 90°.
CRITICAL: Record coil position/orientation, stimulation intensity, and MEP amplitudes for each pulse. Make sure that the connection from the neuronavigation computer to the stimulator is working, to record the realized stimulation intensity. Depending on the laboratory equipment, recording might be done in different ways, e.g., with separate systems for neuronavigation and EMG recording, or both on one computer.
TIMING: 10 min
9 Initial motor hotspot estimation
Perform a rough estimation of the resting motor threshold (rMT) and the corresponding hotspot with a standard threshold hunting procedure, starting at the individualized coordinates from step 6.1. The rMT is commonly defined as the minimum stimulator intensity which leads to MEPs with an amplitude of at least 50 μV for at least 5 out of 10 consecutive TMS pulses48,49,50. Save the position of the hotspot by adding an instrument marker.
TIMING: 15 min
10 Determining the stimulation intensity for the localization procedure
The following procedure ensures that the I/O curve of the to-be-localized neural population is sampled with all its features, including lower plateau, turning point, and saturation. Start stimulating over the previously determined hotspot with rMT intensity and increase the intensity until MEP amplitudes reach the upper plateau of the sigmoidal I/O curve. As a guideline, it should be around 150% of the rMT. The realized amplitudes differ between individuals and EMG setup, but should be around 2-4 mV for FDI (lower for smaller muscles like ADM). Move the coil about 3 cm into the inferior, posterior, superior, and anterior directions and rotate the coil about ±30° while observing the resulting MEPs. The MEPs should decrease to low amplitudes or to zero when tilting the coil 30° and moving it far away from the initial hotspot. Increase the stimulator intensity if the MEPs vanish already before reaching the maximum coil deviations. If MEPs at the outer border of the search area are too high, decrease the stimulator intensity until they are in the expected range. If EMG data from multiple muscles are recorded, select an intensity that yields appropriate MEP responses for all muscles. Keep these stimulator intensities for later use.
CAUTION: Stop increasing the intensity if it becomes uncomfortable for the volunteer.
CRITICAL: If the stimulation intensity is set too low, the upper saturation of the MEP amplitude is not sampled. This negatively affects the localization because the I/O curve is not fully sampled. In this case more stimulations are required to determine stable results.
TIMING: 10 min
11 Applying TMS with arbitrary coil positions and orientations
During this procedure, MEPs will be recorded for arbitrary coil positions and orientations to sample data from a wide range of parameter combinations. Coil positions (referring to the center of the coil) are chosen within an area of approximately 3 cm radius around the manually estimated M1 hotspot (Fig. 12). Start recording the coil position/orientation and the EMG signal. Set the stimulator to the intensity determined in step 10 and apply stimulations with an interstimulus interval of 5 s ± 200 ms. Between stimulations, move the coil arbitrarily within the area and vary the coil angle in the interval ±90° around the PA-45 orientation towards the fissura longitudinalis51,52.
CRITICAL: Ensure that the coil gently touches the scalp of the volunteer. In later modeling steps, direct contact between the plastic housing of the coil and the skin surface is assumed (see step 14).
CRITICAL: Choose an interstimulus interval that does not cause carry over effects (i.e. at least 5 s for single pulse motor cortex studies).
Apply at least 300 stimulations to ensure successful localization of the cortical muscle representation. Short breaks during the measurement process are possible. The EMG recording software should then be paused and not stopped to prevent the creation of multiple EMG data files. After completing the stimulation protocol, export EMG data to a .cfs file. Remove EMG cables and head tracker from the volunteer.
TROUBLESHOOTING: If the volunteer reports discomfort during the protocol, decrease the stimulation intensity. More pulses will be needed if the intensity is too low (see above). Intensity changes are recorded by the TMS Navigator and will be considered during the post-processing automatically.
TROUBLESHOOTING: Occasionally, pulses might be dropped from the neuronavigation recording. This is automatically taken care of by the post processing scripts. If multiple EMG .cfs files are saved instead of one, these can entered as a list for the exp[m1][‘fn_data’] parameter (see below)
TIMING: ~25 min for 300 pulses with 5 secs ISI
PAUSE POINT: After completing the TMS session the protocol can be paused.
FIGURE 12: Arbitrary coil positions/orientations over the motor cortex from the experiment. MEPs are recorded for every TMS pulse. Color codes the FDI MEP amplitude.
Post-processing
12 Post-processing of experimental data
Copy the EMG .cfs file to the subject data folder subject_0/exp/m1/mep. Copy the latest trigger marker TriggerMarker%DATETIME%.xml file from the neuronavigation folder Sessions/Session_DATE/TMSTrigger and the neuronavigation T1 image from BinData/NIFTI to the subject data folder subject_0/exp/m1/tms_navigator. Add paths and filenames of the triggermarker file (exp[m1][‘fn_tms_nav’]), the T1 image (exp[m1][‘fn_mri_nii’]), and the EMG data (exp[m1][‘fn_data’]) to the create_subject_0.py script (Fig. 13). Enter the muscle names in the correct EMG channel order in exp[m1][‘channels’]. If changed, adjust the exp[m1][‘tms_pulse_time’] parameter to indicate the TMS pulse onset in seconds. Save and execute the create_subject_0.py script to update the subject object file.
FIGURE 13: Experiment information in the create_subject_0.py script.
Merge and postprocess TMS navigator and EMG data:
> python scripts/05_merge_exp_data.py -s subject_0.hdf5 -m mesh0_refinedM1 -e m1 -d -r -p
Parameters:
s : Path to subject object file
m : Mesh ID
e : Experiment ID
d : Apply coil/skin distance correction
r : Remove outlier
p : Save MEP plots
TIMING: 10 min
This matches the EMG data to the recorded coil positions of the neuronavigation system and saves the results in a file specified in exp[m1][‘fn_exp_hdf5‘]. EMG data is filtered using a 6th order Butterworth lowpass filter with a cutoff frequency of 500 Hz. Subsequently, peak-to-peak amplitudes are extracted by a min-max search in an interval from 18 ms to 35 ms after the TMS pulse (Fig. 14).
FIGURE 14: Postprocessing of recorded EMG data and extraction of peak-to-peak amplitudes of motor evoked potentials.
To compute the electric field distributions of the realized coil positions and orientations, coordinates recorded in the TriggerMarker%DATETIME$.xml file are converted to SimNIBS coordinates. Note that for other neuronavigation systems different coordinate system transformations might be in order. Coil positions are projected onto the skin surface to compensate for slight deviations (0.5-2 mm) that stem from the tracking system and the head surface reconstruction of the neuronavigation software. Coil positions with a distance greater than 2 mm from the head surface are excluded from the analysis.
13 Electric field calculations
Calculate the electric field distributions for the recorded coil positions with the script below. A configuration file (subject_0/results/electric_field/FEM_config.mat) is created including parameters to initialize the SimNIBS FEM solver. The transformed coil positions from subject_0/exp/m1/matsimnibs.hdf5 are read and fields are computed. Fields in the midlayer ROI (step 4) are calculated, scaled with the applied stimulator intensity, and stored (subject_0/results/electric_field/e_scaled.hdf5). The standard FEM solver requires about 10-12 GB of RAM for each parallel computation (8 GB without mesh refinement).. Depending on the available computational resources, the process can be accelerated by using the solver option “PARDISO”, which requires about 40 GB for each core for the given mesh size.
> python scripts/06_calc_e.py -s subject_0.hdf5 -m mesh0_refinedM1 -e m1 -r midlayer_m1s1pmd -n 4 -a vn -p
Parameters:
s : Path to subject object file
m : Mesh ID
e : Experiment ID
r : ROI ID
n : Number of parallel computations
a : Anisotropic conductivity (volume normalized): "vn", isotropic conductivity: "scalar"
p : Flag to use pardiso solver
TIMING: 4-12 h (depending on the computational resources and the number of stimulations)
14 Localizing the cortical muscle representation
After calculating the electric field distributions and the MEP amplitudes for all stimulations, the data is fitted to cortical I/O-curves with linear, sigmoidal, or log-transformed sigmoidal functions for all examined muscles.
CAUTION: Linear regression has the lowest computational cost but reduced resolution and biological plausibility (see2 for a comparison between different curve fitting approaches). We recommend using sigmoidal or log-transformed sigmoidal functions for the fitting.
In every element in the ROI, the goodness-of-fit is calculated using R² scores, with a higher score representing a better fit between data and assumed activation function. Results are saved in subject_0/results/.../r2_roi_data.hdf5 together with a file containing the geometry information of the ROI and an .xdmf markup file. The latter can be used to visualize the results, for example with ParaView42,43 (see Box 2 “VISUALIZATION OF HEAD MODELS AND RESULTS USING PARAVIEW”). The fitting and goodness-of-fit quantification is implemented in the following script.
> python scripts/07_calc_r2.py -s subject_0.hdf5 -m mesh0_refinedM1 -e m1 -r midlayer_m1s1pmd -n 10 -f sigmoid4_log -i 10 -v
Parameters:
s : Path to subject object file
m : Mesh ID
e : Experiment ID
r : ROI ID
n : Number of parallel computations
f : Fit function (“linear”, “sigmoid4”, “sigmoid4_log”)
i : Number of refit iterations
v : verbose, show output messages
TIMING: With 10 parallel processes:
linear function: 6 secs (no refit)
sigmoid/log-sigmoid function: 60 secs (20 refits)
The cortical origin of the MEPs can now be identified based on the goodness-of-fit results in the results .hdf5 file.
FIGURE 15: Goodness-of-fit distribution. The relationship between the induced electric field distributions and the motor evoked potentials from the arbitrary coil positions were fitted to log-sigmoidal functions. At each location, the goodness-of-fit is quantified by the R² score between fit and data.
15 The optimal coil position for motor threshold determination
After identifying the cortical target, a coil position/orientation can be computed to optimally stimulate this area. The script 08_calc_opt_coil_pos.py chooses the cortical location with maximum goodness-of-fit value as the cortical target for the coil optimization from the results file of step 14 (subject_0/results/.../r2_roi_data.hdf5). Electric fields are computed for a number of candidate coil positions and orientations for this cortical target (Fig. 16a). An Localite “instrument marker” to be used in the subsequent motor threshold determination experiment is exported for the coil position/orientation that maximizes the electric field magnitude at the cortical target. A different TMS coil type from the one used in the first TMS experiment can be used here as long as the correct coil model is specified during the optimal position/orientation calculation. In addition, a motor threshold estimation in %MSO can be computed from the available data after identifying the optimum coil position by executing the script 09_estimate_rmt_from_data.py. Instead of assessing the real rMT in a precise manner with a final experimental session (step 17) this computed rMT approximation can be used if ±3 %MSO accuracy suffices.
Electric field results for the optimum coil position/orientation (Fig 16b) are stored in the .hdf5/.xdmf file tuple subject_0/opt/.../opt_coil_pos.hdf5, the instrument marker as subject_0/opt/.../opt_coil_pos.xml.
PAUSE POINT: The protocol can be paused between post-processing and the second TMS session.
> python scripts/08_calc_opt_coil_pos.py -s subject_0.hdf5 -m mesh0_refinedM1 -e m1 -n 4 -a vn -p -t subject0/results/.../r2_roi_data.hdf5 -c example_data/coils/MagVenture_MCF_B65_REF_highres.ccd.nii.gz
Parameters:
s : Path to subject object file
m : Mesh ID
e : Experiment ID
n : Number of parallel computations
a : Anisotropic conductivity: "vn", isotropic conductivity: "scalar"
p : Flag to use pardiso solver
t : Cortical target (x y z coordinate or r2 result file)
q : Electric field quantity to optimize (“E_mag” (default), “E_norm”, “E_tan”)
c : Coil .nii.gz file
TIMING: 6-24h (depending on the computational resources and the number of simulations)
FIGURE 16: Optimal coil position for rMT determination. (a) Set of 4825 candidate coil positions and orientations. Color indicates the electric field magnitude in the cortical target (here: FDI); (b) Electric field magnitude on the GM surface from the optimal coil position. The black spot is the cortical target (R² hotspot from Fig. 15) determined by the previous localization. Areas more superficial than the cortical target receive a stronger field exposure.
Determining the individual field threshold
16 Session preparation
The exact resting motor threshold is determined in a separate TMS session. Create a copy of the first TMS session with the TMS Navigator software. Repeat steps 7-8 to prepare the volunteer.
CAUTION: Use the TMS coil considered during the calculation of the optimal coil position for the rMT determination (step 15).
TIMING: 20 min
17 Determining the exact resting motor threshold
Load the instrument marker file opt/.../opt_coil_pos_m1.xml that contains the optimal coil position and orientation with the IMPorter tool. Determine the rMT for the muscle of interest (e.g. FDI) with this coil position/orientation. The rMT is defined as the minimum stimulator intensity which leads to MEPs with an amplitude of at least 50 μV in at least 5 out of 10 consecutive TMS pulses41,44,50. The rMT should be lowest for the optimized coil position/orientation compared to locations around the optimum.
TIMING: 5 min
18 Determining the individual cortical field threshold
Finally, the individual cortical field threshold can be computed. This step combines the localization of the cortical origins of the MEPs (step 14), the exact rMT that activates these neuronal populations (step 17), and the field distribution of the optimal stimulation position/orientation (step 15). The electric field intensity in the hotspot (in V/m) for a stimulator intensity of 1 A/µs is saved in the file opt/.../opt_coil_pos_m1.hdf5. Multiplication with the vendor and coil specific current/intensity factor and the rMT yields the electric field strength needed to effectively stimulate the neural population. For a MagVenture X100 stimulator and a MagVenture MCF-B65 coil the factor is 1.43 A/µs/%.
TIMING: 5 min