Skip to content

AdityaIyer01/FC_geodesic

 
 

Repository files navigation

Comparing Functional Connectivity Matrices:
A Geometry-Aware Approach applied to Participant Identification

Data

Toy data for easy use of code is included in the data/condition1 folder. The data includes two FC matrices (with keys LR1 and RL1) of size 300 x 300 for N=20 subjects.

Code

The code has been tested using Python 3. Install all requirements using

pip3 install -r requirements.txt

The main code to compute the geodesic distance measure is here. To compute the geodesic distance between two FC matrices FC1 and FC2,

import sys
# add distance folder to path
UTILS_DIR = 'utils/distance_FC'
sys.path.insert(0, UTILS_DIR)
from distance_FC import distance_FC
dist = distance_FC(FC1, FC2)
# geodesic distance
d_geodesic = dist.geodesic()
# pearson dissimilarity
d_pearson = dist.pearson()

To run analysis on the toy data, run the following commands:

  • Compute distance matrices based on Pearson dissimilarity and Geodesic distance,
python3 get_dist_mtx.py -d $PWD -c1 condition1 -c2 condition1 -t demo
  • Compute accuracy based on each distance matrix,
python3 get_accuracy.py -d $PWD -c1 condition1 -c2 condition1 -t demo
  • Plot the results using plot_results.ipynb. (Make sure to change HOME_DIR to your current working directory.) You can also view the notebook here.

Figures

Interactive html figures are provided for all the figures in the paper. These are particulary useful for 3D visualizations as they allow for rotation.

About

code for NIMG paper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 100.0%