Parallelized MATLAB code to generate connectomes from fMRI data.
Requires: Unix-based system (Mac/Linux), MATLAB Parallel Computing Toolbox, and NIFTI_tools (free on MATLAB File Exchange)
The connectome
class contains static methods to find functional images (niftis, supports both *.nii and *.nii.gz), create connectomes (correlation matrices), correlations between those connectomes, and store them as .mat
file(s). Takes an atlas file input for cluster definition in the same space as input images.
connectome.run()
performs the above locally with the number of cores available. See help(connectome.run)
for detailed information about inputs, options, etc.
connectome.batch()
takes the same inputs as run()
(and a few extra job resource ones), splits the data, and creates a SLURM job file and helper .mat
file to be submitted to the job scheduler to run multiple connectome.run()
iterations across nodes
connectome.combine()
takes the outputs generated by the batch()
function and, yup, combines them
The output .mat
files contain the following variables:
edges
(clusters x cluster x image) correlation matrix, where each value is the correlation (default=Fisher's z-transformed r) between average (default=mean) timecourses of pairs of clusters
coverage
(cluster x image) matrix of proportion (0-1) of cluster voxels that have valid (non-0 variance) timecourses
corr_scans
(image x image) correlation matrix of similarity (r value) between all images' connectomes
info
structure containing filenames and additional information about input images. indices map onto those in edges
and corr_scans
(i.e. same order)
input
structure containing all inputs to the run()
method call