Functional connectivity and brain network (graph theory) analysis for motor imagery data of stroke patiens.
- Create a conda environment
conda create -n env_name python=3.10
- Install pip package
pip install -r requirements.txt
- Install seaborn package
pip install seaborn==0.12.0
The EEG dataset of stroke patients is provided by Liu et.al in https://doi.org/10.6084/m9.figshare.21679035.v5
You just need to download "sourcedata.zip" through this link and unzip it to the "dataset/sourcedata" directory.
- Python file: figshare_stroke_fc2.py
- Plot functional connectivity matrix and corresponding topology in 3 frequency bands for 50 stroke patients.
- Save the functional connectivity data (imcoh_left.npy and imcoh_right.npy) to data_load/ImCoh_data.
python figshare_stroke_fc2.py
- Python file: figshare_fc_mst2.py
- Calculate and visualize the maximum spanning tree (MST) transformed from the function connectivity matrix.
- Correlation analysis: regplot between the NIHSS score and various MST metrics (diameter, eccentricity, leaf number, tree hierarchy).
- Comparision analysis: violinplot of the MST metrics under the low NIHSS group and high NIHSS group.
- Correct the correlation coefficient by Spearman correlation and permutation test.
python figshare_fc_mst2.py
│ figshare_fc_mst2.py
│ figshare_stroke_fc2.py
│
├─dataset
│ │ subject.csv
│ │
│ └─sourcedata
│ ├─sub-01
│ │ sub-01_task-motor-imagery_eeg.mat
│ │
│ ├─sub-02
│ │ sub-02_task-motor-imagery_eeg.mat
│ │
│ │ ...
│ │
│ └─sub-50
│ sub-50_task-motor-imagery_eeg.mat
│
└─data_load
└─ImCoh_data
└─alpha_beta12
imcoh_left.npy
imcoh_right.npy