Skip to content

Code for paper: Discovering Prominent Differences in Structural and Functional Connectomes Using a Multinomial Stochastic Block Model

Notifications You must be signed in to change notification settings

Ninaiskov/ConnDiff-MSBM

Repository files navigation

ConnDiff-MultSBM

Code for article: "Discovering Prominent Differences in Structural and Functional Connectomes Using the Multinomial Stochastic Block Model"

This work showcase how MSBM can offer valuable insights to brain connectivity as well as many other potential applications where differences across graph-data are of interest.

Framework illustration

MSBM

Data

Data used is open-access neuroimaging dataset (fMRI and dMRI scans) from Human Connectome Project (HCP) and synthetically generated data

Results

Result files 'model_sampleK.npy' containing MAP partition matrix Z (N nodes partitioned into K clusters) are located in results/hcp_best (only results files for best runs for HCP data are uploaded).

Examples of HCP results for 25 clusters

Brainmap:

brainmap

Connectivity map (Probability of link between clusters, where red = functional conn., blue = structural conn.)

K25

Files

  • main.py: Main script for defining parameters and running model
  • model.py: Multinomial Stochastic Block Model (MSBM) class with Gibbs sampling inference
  • createGraphs.m: Generate adjacency matrices (graphs) from dMRI (structural) and fMRI (functional) images
  • get_Glassergraphs.py: Generate adjacency matrices (graphs) in Glasser atlas resolution
  • helper_functions.py: Helper functions (plotting functions etc.)
  • visualize.ipynb: Visualize data and model outputs
  • requirements.txt: Python package requirements

Setup and run

  1. Clone the repository
git clone https://github.com/Ninaiskov/ConnDiff-MSBM.git
  1. Create a conda environment and install required packages
conda create --name <env_name> --file requirements.txt
  1. Activate the environment
conda activate <env_name>
  1. Run the main.py script to run the model
python main.py

Alternatively, we have created an introductory notebook "getstarted.ipynb", where you can run the model with the default parameters and visualize the results.

About

Code for paper: Discovering Prominent Differences in Structural and Functional Connectomes Using a Multinomial Stochastic Block Model

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages