Giter Club home page Giter Club logo

brain_graphs's Introduction

brain_graphs

Graph theory analysis of resting-state fMRI data. Just a light class to summarize igraph (python) community detection object and the igraph graph object. Calculates Participation Coefficient(PC) and Within-Module-Degree Z-Score(WMD).

All graphs are weighted unless passed a binarized Matrix.

Requires two non-standard (i.e., not with anaconda distribution) libraries:

python-igraph $pip install python-igraph nibabel $pip install nibabel

Example 1:

~Load EPI and reduce to a time series of nodes

subject_time_series = load_subject_time_series(subject_path='/path/to/where/epi/files/live/*.nii')

~Turn that into a correlation matrix based on parcellation

matrix = time_series_to_matrix(subject_time_series,parcel_path='path/to/brain/atlas/atlas.nii')

~make graph from matrix

graph = matrix_to_igraph(matrix,cost=0.1)

~get community detection results

community_object = graph.community_infomap(edge_weights='weight')

community_array = community.membership

~calculate PC and WMD, return nice brain_graph object with the graph and community object attached

brain_graph = brain_graph(community_object)

Example 2:

~do all over the above, but recursively find communities from all costs (a la Power et al, 2011)

brain_graph = recrusive_network_partition(subject_path='/path/to/where/epi/files/live/*.nii',parcel_path='path/to/brain/atlas/atlas.nii',graph_cost=.1,min_community_size=10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.