Nigraph is a Python module for graph analyses on NeuroImaging data.
It is especially tailored towards the analysis of functional (fMRI/MEG/EEG) and structural (DTI/DWI) brain imaging data.
Features include:
- construction of
static
anddynamic
graphs from imaging data - extensive set of
metrics
to quantify brain networks and communities statistical comparison
of graphs includingcomplex network decoding
(Ekman et al., 2012)
This code snippet shows how to construct a network graph from a resting-state fMRI time-series and calculate the weighted, local betweenness_centrality:
$ python
>>> import nigraph as nig
>>> timeseries = nig.load_mri('func.nii.gz', 'brain_mask.nii.gz')
>>> A = nig.adj_static(timeseries) # adjacency matrix
>>> A_thr = nig.thresholding_abs(adjacency, thr=0.3) # threshold matrix
>>> bc = nig.betweenness_centrality(adjacency_thr) # calculate metric
>>> nig.save_mri(bc, 'brain_mask.nii.gz', 'bc.nii.gz') # save results
Currently this is only available through GitHub. Nigraph will run under Linux and Mac OS X, but not under Windows1.
pip install git+https://github.com/mekman/nigraph.git --upgrade
1 it might work if you have the MSVC compiler installed
If you use the Nigraph for connectivity-based decoding please cite:
@article{Ekman09102012,
author = {Ekman, Matthias and Derrfuss, Jan and Tittgemeyer, Marc and Fiebach, Christian J.},
title = {Predicting errors from reconfiguration patterns in human brain networks},
volume = {109},
number = {41},
pages = {16714-16719},
year = {2012},
doi = {10.1073/pnas.1207523109},
URL = {http://www.pnas.org/content/109/41/16714.abstract},
eprint = {http://www.pnas.org/content/109/41/16714.full.pdf+html},
journal = {Proceedings of the National Academy of Sciences}
}
This repository is based on shablona.
Copyright (C) 2011-2018 Nigraph Developers
- Matthias Ekman [email protected]
- Charl Linssen [email protected]
Distributed with a BSD license (3 clause); see LICENSE.