This repository includes the code required to reproduce the results in: "Network-level Macroscale Structural Connectivity Predicts Propagation of Transcranial Magnetic Stimulation" Momi D., Ozdemir R., Tadayon E., Boucher P., Shafi M., Pascual-Leone A., Santarnecchi E.. NeuroImage (2020).

The pipeline and methods used in the paper are described below.


TMS-EEG 
All EEG data pre-processing was performed offline using EEGLAB 14.1 (https://github.com/sccn/eeglab) (Delorme and Makeig, 2004) and customized script running in Matlab R2017b (Math-Works Inc., USA). All TMS-evoked EEG source reconstruction and analysis was performed using Brainstorm (https://github.com/brainstorm-tools/brainstorm3)(Tadel et al., 2019) and customized script running in Matlab R2017b (Math-Works Inc., USA). 

For EEG data preprocessing please use  'TMS_EEG_preprocessing.m' 
For EEG data analysis please use 'EEG_metric_extraction ' at the following link https://github.com/Davi1990/EEG-and-DWI-metrics


DWI
All DWI metrics were extracted using a customized script running in Matlab R2017b (Math-Works Inc., USA). 

For DWI data analysis please use 'DWI_metrics_extraction.m'

There is an updated version of the code at the following link: https://github.com/Davi1990/DissNet


EF-modelling
TMS-induced electric field was modelled with SimNIBS (Thielscher et al., 2015) using pynetstim, a python module that aims to create an integrated framework for brain network stimulation, stimulation targeting and engagement (https://github.com/EhsanTadayon/pynetstim). 

To create the EF-map use our code 'EF_modelling.py'



