Python Reference API
netneurotools.networks
- Constructing networks
Functions for generating group-level networks from individual measurements.
|
Calculate thresholded group consensus functional connectivity graph. |
|
Calculate distance-dependent group consensus structural connectivity graph. |
|
Keep top retain % of connections in network and binarizes. |
|
Keep top retain % of connections in network and binarizes. |
|
Generate degree- and edge length-preserving surrogate connectomes. |
|
Optimized version of randmio_und. |
|
Strength-preserving network randomization using simulated annealing. |
|
Strength-preserving network randomization using simulated annealing. |
|
Strength-preserving network randomization using simulated annealing. |
netneurotools.modularity
- Calculating network modularity
Functions for working with network modularity.
|
Find community assignments from adjacency through consensus. |
|
Calculate the z-Rand index of two community assignments. |
|
Calculate modularity contribution for each community in comm. |
|
Calculate average z-score of community assignments by permutation. |
|
Calculate significance of community assignments in comm by permutation. |
netneurotools.cluster
- Working with clusters
Functions for clustering and working with cluster solutions.
|
Find consensus clustering labels from cluster solutions in assignments. |
|
Re-label clusters in columns of assignments to best match target. |
|
Relabel and reorders rows / columns of assignments to "look better". |
|
Align cluster labels in source to those in target. |
netneurotools.plotting
- Plotting brain data
Functions for making pretty plots and whatnot.
|
Sort communities in consensus according to strength. |
|
Plot data as heatmap with borders drawn around communities. |
|
Plot surface data on Conte69 Atlas. |
|
Plot surface data on a given fsLR32k atlas. |
|
Plot data to fsaverage brain using annot as parcellation. |
|
Plot vertex-wise data to fsaverage brain. |
|
Plot data as a cloud of points in 3D space based on specified coords. |
netneurotools.stats
- General statistics functions
Functions for performing statistical preprocessing and analyses.
|
Return a resampling array for coords obtained from rotations / spins. |
|
Return residuals of regression equation from Y ~ X. |
|
Determine which samples in data are outliers. |
|
Compute correlation of matching columns in a and b. |
|
Non-parametric equivalent of |
|
Non-parametric equivalent of |
|
Non-parametric equivalent of |
|
Return the dominance analysis statistics for multilinear regression. |
|
Calculate pearson correlation between two annotation vectors. |
|
Numba version of |
|
Calculate pairwise network correlation between rows of annot_mat. |
|
Calculate effective resistance matrix. |
|
Calculate polarisation of a vector on a graph. |
|
Calculate variance of a vector on a graph. |
|
Numba version of |
|
Calculate covariance of a joint probability matrix on a graph. |
|
Numba version of |
netneurotools.metrics
- Calculating graph metrics
Functions for calculating network metrics.
Uses naming conventions adopted from the Brain Connectivity Toolbox (https://sites.google.com/site/bctnet/).
|
Binarize a matrix. |
|
Compute the degree of each node in W. |
|
Compute the in degree and out degree of each node in W. |
Compute the all-pairs shortest path length using Floyd-Warshall algorithm. |
|
|
Return the shortest paths between two nodes. |
|
Compute the communicability of pairs of nodes in adjacency. |
|
Compute the communicability of pairs of nodes in adjacency. |
|
Calculate connectivity values in rich, feeder, and peripheral edges. |
|
Compute network navigation. |
|
Get navigation path length from navigation results. |
|
Calculate search information. |
Calculate path transitivity. |
|
|
Calculate flow graph. |
|
Calculate mean first passage time. |
Calculate diffusion efficiency. |
|
|
Calculate resource efficiency and shortest-path probability. |
Calculate undirected matching index. |
|
Compute the graph Laplacian of a weighted adjacency matrix. |
netneurotools.datasets
- Automatic dataset fetching
Functions for fetching and generating datasets.
Functions to download atlases and templates
|
Download files for Cammoun et al., 2012 multiscale parcellation. |
|
Fetch CIVET surface files. |
|
Download files for Van Essen et al., 2012 Conte69 template. |
|
Download files for fsaverage FreeSurfer template. |
|
Download files for Pauli et al., 2018 subcortical parcellation. |
|
Download FreeSurfer .annot files for Schaefer et al., 2018 parcellation. |
|
Fetch HCP standard mesh atlases for converting between FreeSurfer and HCP. |
|
Fetch von-Economo Koskinas probabilistic FreeSurfer atlas. |
Functions to download real-world datasets
|
Download files from multi-species connectomes. |
|
Download (and creates) dataset for replicating Mirchi et al., 2018, SCAN. |
|
Download files from Vazquez-Rodriguez et al., 2019, PNAS. |
Functions to generate (pseudo-random) datasets
|
Generate random vectors that are correlated to approximately corr. |
netneurotools.freesurfer
- FreeSurfer compatibility functions
Functions for working with FreeSurfer data and parcellations.
|
Create an annotation file for subject_id by applying atlas in gcs. |
|
Return vertex coords corresponding to centroids of parcels in annotations. |
|
Project parcellated data to vertices defined in annotation files. |
|
Reduce vertex-level data to parcels defined in annotation files. |
|
Project parcellated data to surface, rotates, and re-parcellates. |
|
Rotate parcels in {lh,rh}annot and re-assigns based on maximum overlap. |
netneurotools.civet
- CIVET compatibility functions
Functions for working with CIVET data (ugh).
|
Read a CIVET-style .obj geometry file. |
|
Project brainmap in CIVET space to freesurfer fsaverage space. |
netneurotools.utils
- Miscellaneous, grab bag utilities
Miscellaneous functions of various utility.
|
Run cmd via shell subprocess with provided environment env. |
|
Add a constant (i.e., intercept) term to data. |
|
Return vectorized version of upper triangle from data. |
|
Find centroids of labels in img. |
netneurotools.colors
- Useful colormaps
Useful colormaps.
Return list of available colormaps in module. |