This repository provides the code used to analyze the data of migraine patients in the paper: Structural connectome changes in episodic migraine: the role of the cerebellum
The overall pipeline can be seen in the picture below:
You'll need MRtrix, FSL, and MATLAB installed on the computer you'll use to run the code. Then download this repository into a folder of your choosing by going to that folder and then cloning it:
git clone https://github.com/anamatoso/connectivity-analysis-diffusion.git
The data directory structure should be the following:
.
├── tractography.sh # DWI Script
├── bvals.bval # b-values file
├── data # Data folder
├── sub-controlXXX_ses-[SESSION] # Folder with the dMRI files
│ ├── sub-controlXXX_ses-[SESSION]_clean.nii.gz # dMRI image (already preprocessed)
│ ├── sub-controlXXX_ses-[SESSION]_clean_mask.nii.gz # dMRI image mask
│ └── sub-controlXXX_ses-[SESSION]_rotated_bvecs.bvec # b-vectors
├── sub-controlXXX # Anatomic imge folder
└── sub-controlXXX_restored-MPRAGE_brain.nii.gz # T1-weighted image
└── ...
├── matrix_data # Output data folder (created automatically)
├── main.m # Main MATLAB Script
└── ... # Other MATLAB files and folders
Run the file tractography.sh
for every patient folder you have with dMRI data (sub-controlXXX_ses-[SESSION]).
Should your directory structure be different, just change Step 1 accordingly so that the variables point to the correct files.
You'll need MATLAB installed (I used the 2023a version, but older versions should also work) as well as the NBS toolbox. Then open MATLAB, go into the repository and run main.m in the command window of MATLAB:
run main.m
Note: don't forget to add the NBS folder to PATH in MATLAB before running the file.