Python Reference API
netneurotools.datasets
- Automatic dataset fetching
Functions for handling datasets.
To download templates
|
Download files for fsaverage FreeSurfer template. |
|
Download files for fsaverage FreeSurfer template. |
|
Fetch HCP standard mesh atlases for converting between FreeSurfer and HCP. |
|
Download files for HCP fsLR template. |
|
Fetch CIVET surface files. |
|
Download files for CIVET template. |
|
Download files for Van Essen et al., 2012 Conte69 template. |
|
Download files for Donahue et al., 2016 Yerkes19 template. |
To download atlases
|
Download files for Cammoun et al., 2012 multiscale parcellation. |
|
Download FreeSurfer .annot files for Schaefer et al., 2018 parcellation. |
|
Download .label.gii files for Glasser et al., 2016 MMPAll atlas. |
|
Download files for Pauli et al., 2018 subcortical parcellation. |
Fetch Ye et al., 2020 subcortical parcellation. |
|
|
Fetch von-Economo Koskinas probabilistic FreeSurfer atlas. |
To download project-related data
|
Download files from Vazquez-Rodriguez et al., 2019, PNAS. |
|
Download (and creates) dataset for replicating Mirchi et al., 2018, SCAN. |
|
Download files from Hansen et al., 2023, PLOS Biology. |
|
Download files from Hansen et al., 2022, Nature Neuroscience. |
|
Download files from Hansen et al., 2021, Nature Human Behaviour. |
|
Download files from Hansen et al., 2024. |
|
Download files from Shafiei et al., 2022. |
|
Download files from Shafiei et al., 2023. |
|
Download files from Suarez et al., 2022, eLife. |
|
Download files from multi-species connectomes. |
Download Neurosynth data. |
netneurotools.networks
- Constructing networks
Functions for constucting networks.
To construct consensus networks
|
Calculate thresholded group consensus functional connectivity graph. |
|
Calculate distance-dependent group consensus structural connectivity graph. |
To randomize networks
|
Optimized version of randmio_und. |
|
Generate degree- and edge length-preserving surrogate connectomes. |
|
Strength-preserving network randomization using simulated annealing. |
|
Strength-preserving network randomization using simulated annealing. |
|
Strength-preserving network randomization using simulated annealing. |
Convenient functions
|
Keep top retain % of connections in network and binarizes. |
|
Keep top retain % of connections in network and binarizes. |
netneurotools.plotting
- Plotting brain data
Functions for making pretty plots and whatnot.
Pyvista
|
Plot surface data using PyVista. |
PySurfer (deprecated)
|
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. |
matplotlib
|
Plot data as a cloud of points in 3D space based on specified coords. |
|
Plot data as heatmap with borders drawn around communities. |
Fun color & colormap stuff
Return list of available colormaps in module. |
netneurotools.metrics
- Calculating graph metrics
Magics on networks.
Brain network metrics
|
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 network navigation. |
|
Get navigation path length from navigation results. |
|
Compute the communicability of pairs of nodes in adjacency. |
|
Compute the communicability of pairs of nodes in adjacency. |
Calculate path transitivity. |
|
|
Calculate search information. |
|
Calculate mean first passage time. |
Calculate diffusion efficiency. |
|
|
Calculate resource efficiency and shortest-path probability. |
|
Calculate flow graph. |
|
Calculate assortativity. |
Calculate undirected matching index. |
|
|
Calculate connectivity values in rich, feeder, and peripheral edges. |
Network spreading
Simulate atrophy in a network. |
Statistical network metrics
|
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.modularity
- Calculating network modularity
Functions for working with network modularity.
|
Align cluster labels in source to those in target. |
|
Re-label clusters in columns of assignments to best match target. |
|
Relabel and reorders rows / columns of assignments to "look better". |
|
Find consensus clustering labels from cluster solutions in assignments. |
|
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.stats
- General statistics functions
Functions for performing statistical operations.
Correlations
|
Compute correlation of matching columns in a and b. |
Calculate weighted Pearson correlation coefficient. |
|
|
Generate random vectors that are correlated to approximately corr. |
Permutation tests
|
Non-parametric equivalent of |
|
Non-parametric equivalent of |
|
Non-parametric equivalent of |
Regressions
|
Return residuals of regression equation from Y ~ X. |
|
Return the dominance analysis statistics for multilinear regression. |
netneurotools.spatial
- Spatial statistics
Functions for handling spatial brain data.
Calculating spatial statistics
|
Calculate Moran's I for spatial autocorrelation. |
Calculate local Moran's I for spatial autocorrelation. |
netneurotools.interface
- Interface for external tools
Functions for interfacing with common tools.
netneurotools.experimental
- Functions in alpha stage
Functions in alpha stage.