Comparing Functional Connectivity Matrices:
A Geometry-Aware Approach applied to Participant Identification
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.
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 changeHOME_DIR
to your current working directory.) You can also view the notebook here.
Interactive html figures are provided for all the figures in the paper. These are particulary useful for 3D visualizations as they allow for rotation.
- Fig 2A, Fig 2B, Fig 2C, Fig 2D
- Fig 3
- Fig 4A_1, Fig 4A_2, Fig 4B_1, Fig 4B_2
- Fig 5
- Fig 6A, Fig 6B
- Fig 7A, Fig 7B
- Fig 8
- Fig 9
- Fig 10A, Fig 10B
- Fig 11_1, Fig 11_2
- Fig 12A_1, Fig 12A_2, Fig 12B_1, Fig 12B_2
- Fig 13_1, Fig 13_2
- Fig 14A_1, Fig 14A_2, Fig 14A_3, Fig 14B, Fig 14C
- Fig S1, Fig S2, Fig S3A, Fig S3B, Fig S3C, Fig S5, Fig S6, Fig S7, Fig S8, Fig S9, Fig S10, Fig S11, Fig S12, Fig S13, Fig S14, Fig S15