Chao-Jiang / nigraph

Graph analyses on NeuroImaging data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Coverage Status

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 and dynamic graphs from imaging data
  • extensive set of metrics to quantify brain networks and communities
  • statistical comparison of graphs including complex network decoding (Ekman et al., 2012)

Quick-start

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

Installation

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

Citation

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.

License

Copyright (C) 2011-2018 Nigraph Developers

Distributed with a BSD license (3 clause); see LICENSE.

About

Graph analyses on NeuroImaging data

License:MIT License


Languages

Language:Python 99.8%Language:Makefile 0.2%