Matlab 2018b was used to run these scripts.
ROASTv3.0 (https://www.parralab.org/roast/) was used to generate current flow models.
spm12 (https://www.fil.ion.ucl.ac.uk/spm/software/spm12/) was used for data pre-processing and analysis of E-field data extracted from current flow models produced by ROAST.
MRI and surface files (pial & white matter) were taken from the Human Connectome Project (HCP) database (http://ida.loni.usc.edu/login/jsp).
The specified protocol defined in these scripts are those used in the following article: "Evans, C., Zich, C., Lee, J. S., Ward, N., & Bestmann, S. (2022). Inter-individual variability in current direction for common tDCS montages. NeuroImage. https://doi.org/10.1016/j.neuroimage.2022.119501"
@gifti: required to convert files to geometry format (c) Wellcome Trust Centre for Neuroimaging
geodesic: required to remove ROI overlap (c) Danil Kirsanov
create gm surface: scripts to create grey matter surface
create rois: scripts to define ROIs
locate electrodes motor strip: scripts to define electrode locations & motor strip
calculate_angle_snorm_efield.m - calculate angle between e-field direction & grey matter surface/ROI
calculate_angle_electrodes_motorstrip_roi.m - calculate angle between electrode locations & motor strip/ROI
create_gm_surface.m - creates grey matter surface from pial and white matter surfaces generated by FreeSurfer
combine_surfaces.m - called by 'create_gm_surface.m'. Combines L & R hemisphere surfaces
write_surf_gifti.m - called by 'create_gm_surface.m'. Converts surface to gifti format
roi_centre_coords.m - define central coordinates for ROI
build_roi_patches.m - build ROI patch and remove overlap of adjacent ROIs (e.g. M1 bank & crown)
build_single_roi_patch.m - builds single ROI patch. Alternative to build_roi_patches.m
motor_strip_coords.m - define coordinates for motor strip
get_elec_coords.m - extract electrode location coordinates from ROAST
roast2.m - called by 'get_elec_coords.m'. Runs roast model until electrode placement
electrodePlacement2.m - called by 'get_elec_coords.m'. Outputs electrode location coordinates defined by ROAST