-
Notifications
You must be signed in to change notification settings - Fork 2
29. TMS E field modeling
We use the Matlab toolbox provided by Drs. Sergey N Makarov and Aapo Nummenmaa to calculate the induced electric field in TMS.
[This script file] prepares the geometries needed for BEM models. The surfaces include:
- outer skin (outer_skin.surf)
- outer skull (outer_skull.surf)
- inner skull (inner_skull.surf)
- left hemisphere pial surface (surf/lh.orig)
- right hemisphere pial surface (surf/rh.orig)
The first three files were created at the bem
folder of the subject's FreeSurfer recon. See EEG/SEEG modeling pages for details creating these files.
The last two files were created at the surf
folder of the subjects' FreeSurfer recon. automatically.
[This script file] shows the head/brain geometries.
The file about tissue conductivity must be provided with matched definition. For example, the tissue_index.txt file was for subject 's002', who had a few mat files defining the head/brain geometries. These mat files were created from the procedure above. Associated with these boundaries, conductivity must be specified. We define a few boundaries 'Freespace', 'Skin', 'Skull', 'GM_LH', and 'GM_RH' here.
>Skin : s002_skin.mat : 0.4650 : FreeSpace
>Skull : s002_skull.mat : 0.010 : Skin
>GM_LH : s002_gm_lh.mat : 0.2750 : Skull
>GM_RH : s002_gm_rh.mat : 0.2750 : Skull
This script loads the model.
This script sets up the TMS coil.
Remember to check the following line to define the tissue to be rendered. This string is defined in the tissue_index.txt file (see above).
tissue_to_plot = 'GM_RH';
This script charges the computation engine.
NOTE Sometimes the maximum value of the electric field can be extremely high and spatially sparse. To improve the visualization, some thresholding, as shown belown, is helpful.
bemf2_graphics_surf_field(P, t, etc_threshold(temp,0.999), Indicator, objectnumber);
The total electric field is shown here.
This script defines the planes to be drawn.
- This script draws field over XY planes.
- This script draws field over YZ planes.
- This script draws field over XZ planes.
1 Van Hoornweder, S. et al. Neuroimage 281, 120379 (2023)
2 Lynch, C. J. et al. Neuron 110, 3263–3277.e4 (2022)