Comparison with existing toolboxes

Relative to existing toolboxes, netneurotools occupies a distinct niche: it provides small, modular, decoupled functions that are agnostic to upstream preprocessing choices, making it straightforward to integrate into diverse analysis pipelines. Contribution and updating cycles are also faster than in more monolithic packages, and bug reporting is handled transparently through a public issue tracker.

Original data & methods developed in our lab

Data fetching

A set of project fetching functions in netneurotools.datasets download the data and associated code used in a number of publications from our lab.

The package includes carefully curated data fetching functions covering common templates (fetch_fsaverage(), fetch_fsaverage_curated(), fetch_fslr_curated(), fetch_civet(), fetch_civet_curated(), fetch_conte69()), and popular atlases (fetch_schaefer2018(), fetch_cammoun2012(), fetch_mmpall(), fetch_pauli2018(), fetch_tian2020msa(), fetch_voneconomo()).

Network measures

Original network statistics implemented in netneurotools.metrics:

Network community operations

Implemented in netneurotools.modularity:

Agent-based simulation on networks

Network null models and consensus construction

Implemented in netneurotools.networks:

Brain data visualization

Implemented in netneurotools.plotting:

  • pv_plot_surface() and pv_plot_subcortex: Plot surface and subcortical data using PyVista.

  • plot_mod_heatmap(): Plot data as a heatmap with borders drawn around communities.

  • plot_point_brain(): Plot data as a cloud of points in 3D space based on specified coordinates.

Neuroimaging data file format manipulation

Implemented in netneurotools.interface:

Surface–parcel mapping:

CIFTI:

FreeSurfer:

GIFTI:

Original, highly optimized Python implementations

Methods originally in MATLAB

The following graph-theoretic measures are implemented in netneurotools.metrics:

  • navigation_wu(): Compute network navigation using greedy routing toward the target node.

  • communicability_bin(): Compute communicability between pairs of nodes in a binary adjacency matrix.

  • communicability_wei(): Compute communicability between pairs of nodes in a weighted adjacency matrix.

  • path_transitivity(): Calculate the density of local detours (triangles) available along shortest paths between node pairs.

  • resource_efficiency_bin(): Calculate resource efficiency and shortest-path probability for binary networks.

  • flow_graph(): Calculate the flow graph of a network at a given Markov time.

  • matching_ind_und(): Calculate the undirected matching index (similarity between connectivity profiles).

  • rich_feeder_peripheral(): Calculate connectivity statistics for rich, feeder, and peripheral edges.

Network community consensus implemented in netneurotools.modularity:

The following functions were originally distributed in MATLAB and have several underperforming Python implementations (bctpy, brainconn), implemented in netneurotools.metrics and netneurotools.networks:

  • randmio_und(): Generate randomized networks preserving the degree distribution.

  • degrees_und(): Calculate degree for undirected networks.

  • degrees_dir(): Calculate in- and out-degree for directed networks.

  • search_information(): Calculate search information — the bits a random walker needs to follow the shortest path between nodes.

  • mean_first_passage_time(): Calculate mean first passage time between all node pairs for a random walker.

  • diffusion_efficiency(): Calculate diffusion efficiency (inverse of mean first passage time) across node pairs.

Methods originally in R

Implemented in netneurotools.spatial:

  • morans_i(): Calculate global Moran’s I for spatial autocorrelation.

  • local_morans_i(): Calculate local Moran’s I values for each node.

  • gearys_c(): Calculate global Geary’s C for spatial autocorrelation.

  • local_gearys_c(): Calculate local Geary’s C values for each node.

  • lees_l(): Calculate Lee’s L for bivariate spatial autocorrelation.

  • local_lees_l(): Calculate local Lee’s L values for each node pair.

Highly optimized Python implementations

Implemented in netneurotools.stats:

  • get_dominance_stats(): Compute dominance analysis statistics for relative predictor importance in multilinear regression.

These implementations make methods previously inaccessible or poorly ported accessible to the broader Python ecosystem.

Comparison with specific toolboxes

GRETNA

GRETNA is a well-established toolbox for graph-theoretic analysis of brain networks that additionally covers rsfMRI preprocessing – users requiring an end-to-end preprocessing-to-analysis pipeline may find GRETNA a suitable choice for that workflow. netneurotools, in contrast, focuses on modular, preprocessing-agnostic analysis functions with richer brain visualization support, a public contribution pipeline, and continued active development targeting newer methods. We are very happy to add your newly developed method to netneurotools.

Brain connectivity toolbox (BCT) / bctpy / brainconn

BCT is the most widely used reference implementation for graph-theoretic measures for brain networks, and bctpy and brainconn provide Python ports of its functions. netneurotools complements these efforts by offering carefully optimized Python-native implementations of select measures, along with additional methods not covered by BCT, making them readily accessible within the Python scientific ecosystem. Let us know if there are specific BCT functions you would like to see implemented or optimized in netneurotools.

NetworkX

NetworkX is a general-purpose network analysis library not tailored to brain data. netneurotools complements rather than competes with NetworkX, and is in fact compatible with it – the shortest path routine makes use of the high-quality implementation in NetworkX while preserving an API interface convenient and familiar for brain network researchers.

Comet Toolbox

Comet Toolbox aims at combining functional connectivity estimation and graph-theoretical analysis into a unified multiverse workflow. netneurotools, in contrast, provides modular, preprocessing-agnostic functions that are not tied to a particular analysis paradigm. The two toolboxes are largely complementary: Comet Toolbox can be used for comprehensive robustness testing across analysis choices, while netneurotools can be used for more flexible, modular analyses and visualizations with cutting-edge network metrics and brain surface rendering.