Netneurotools Guide logo

Netneurotools Guide

OrganizationPopular
NeuroAIHub
netneurotools-guide

Domain-validated guidance for network neuroscience analysis using netneurotools: datasets, brain network metrics, connectivity consensus, modularity, spatial statistics, null models, and cortical surface visualization. Use this skill whenever the user works with brain connectivity matrices, connectomes, graph theory on brain networks, parcellated brain data (Schaefer, Cammoun, Desikan-Killiany), cortical surface templates (fsaverage, fsLR, CIVET, Conte69), network communication metrics, null model generation, spatial autocorrelation on brain maps, community detection in connectomes, or surface-based visualization with PyVista/PySurfer. Also trigger when the user mentions netneurotools, netneurolab, structure-function coupling, network neuroscience, brain graph analysis, or needs to fetch neuroimaging atlases and templates.

Overview

PublisherNeuroAIHub
RepositoryBrainPilot
Skill namenetneurotools-guide
Stars
1.1K
Forks
74
Bundled files
6
LicenseAGPL-3.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by NeuroAIHub on GitHub. Read the source before you install it.

Installation

Install the Netneurotools Guide AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/06_fMRI_Neuroimaging/netneurotools-guide
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/NeuroAIHub/BrainPilot.git /tmp/BrainPilot
mkdir -p .claude/skills
cp -r /tmp/BrainPilot/packages/skills/skills/06_fMRI_Neuroimaging/netneurotools-guide .claude/skills/netneurotools-guide
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Netneurotools Guide in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Netneurotools Guide on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Netneurotools Guide is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

NetNeuroTools Guide

Purpose

This skill encodes the complete API and recommended workflows for netneurotools, a Python toolbox for network neuroscience developed by the Network Neuroscience Lab (netneurolab). It covers dataset fetching, brain connectivity metrics, network randomization and null models, community detection, spatial autocorrelation statistics, parcellation interface utilities, and cortical/subcortical surface visualization.

When to Use This Skill

Activate when the user:

  • Works with brain connectivity matrices (structural or functional)
  • Needs network communication metrics (shortest path, navigation, communicability, search information, diffusion efficiency)
  • Wants to generate null/surrogate networks preserving degree, strength, or distance distributions
  • Performs community detection or consensus clustering on brain networks
  • Computes spatial autocorrelation (Moran's I, Geary's C, Lee's L) on parcellated brain data
  • Fetches standard neuroimaging templates (fsaverage, fsLR, CIVET, Conte69) or atlases (Schaefer, Cammoun, Pauli)
  • Needs to convert between vertex-level and parcel-level brain data
  • Visualizes data on cortical surfaces using PyVista or PySurfer
  • Mentions netneurotools, netneurolab, or any function from this toolbox
  • Performs structure-function coupling, assortativity analysis, or dominance analysis
  • Simulates atrophy spreading on brain networks (SIR model)

Reference Files (Progressive Disclosure)

TopicFileWhen to Read
Datasetsreferences/datasets.mdUser fetches templates, atlases, or project datasets
Network Metricsreferences/metrics.mdUser computes communication, assortativity, spreading, or statistical network metrics
Networksreferences/networks.mdUser builds consensus connectivity, randomizes networks, or thresholds graphs
Statisticsreferences/stats.mdUser runs permutation tests, correlations, residualization, or dominance analysis
Spatial & Modularityreferences/spatial-modularity.mdUser computes spatial autocorrelation or performs community detection
Interface & Plottingreferences/interface-plotting.mdUser converts parcels/vertices, handles CIFTI/GIFTI files, or plots on cortical surfaces

Installation

bash
pip install netneurotools

# For PyVista surface plotting (recommended)
pip install netneurotools[pyvista]

# For PySurfer surface plotting (legacy)
pip install netneurotools[pysurfer]

# For numba acceleration
pip install netneurotools[numba]

Core dependencies: numpy>=1.16, scipy>=1.4.0, scikit-learn, matplotlib, nibabel>=3.0.0, nilearn, bctpy, tqdm, neuromaps

Overview Pipeline

1. Fetch data       --> netneurotools.datasets (templates, atlases, connectomes)
2. Build networks   --> netneurotools.networks (consensus, thresholding)
3. Analyze metrics  --> netneurotools.metrics (communication, assortativity)
4. Null models      --> netneurotools.networks (randomization, surrogates)
5. Statistics       --> netneurotools.stats (permutation tests, dominance)
6. Spatial stats    --> netneurotools.spatial (Moran's I, Geary's C, Lee's L)
7. Modularity       --> netneurotools.modularity (consensus clustering)
8. Visualize        --> netneurotools.plotting (cortical surfaces, heatmaps)

Quick Start

Fetch Atlas and Template

python
from netneurotools.datasets import fetch_schaefer2018, fetch_fsaverage_curated

# Fetch Schaefer 400-parcel atlas in fsaverage space
parc = fetch_schaefer2018('fsaverage')['400Parcels7Networks']
# parc is a SURFACE namedtuple with fields .L and .R

# Fetch curated fsaverage surfaces
surfaces = fetch_fsaverage_curated('fsaverage5')
# surfaces has keys: 'white', 'pial', 'inflated', 'sphere', 'medial', 'sulc', 'vaavg'
# Each value is a SURFACE namedtuple with fields .L and .R

Consensus Functional Connectivity

python
from netneurotools.networks import func_consensus
import numpy as np

# data: (N_nodes, T_timepoints, S_subjects) array
consensus = func_consensus(data, n_boot=1000, ci=95, seed=42)

Community Detection

python
from netneurotools.modularity import consensus_modularity
import numpy as np

# adjacency: (N, N) non-negative connectivity matrix
consensus, Q_all, zrand_all = consensus_modularity(
    adjacency, gamma=1.5, repeats=100, seed=1234
)

Generate Distance-Preserving Surrogates

python
from netneurotools.networks import match_length_degree_distribution

newB, newW, nr = match_length_degree_distribution(
    W, D, nbins=10, nswap=1000, seed=42
)

Permutation Test for Correlation

python
from netneurotools.stats import permtest_pearsonr, make_correlated_xy

x, y = make_correlated_xy(corr=0.3, size=100, seed=42)
r, p = permtest_pearsonr(x, y, n_perm=5000, seed=42)

Spatial Autocorrelation

python
from netneurotools.spatial import morans_i

I = morans_i(annotation_vector, spatial_weight_matrix)

Plot on Cortical Surface (PyVista)

python
from netneurotools.plotting import pv_plot_surface
import numpy as np

data_L = np.random.random((10242,))
data_R = np.random.random((10242,))
pl = pv_plot_surface(
    (data_L, data_R),
    template="fsaverage5",
    surf="inflated",
    cmap="viridis",
    lighting_style="plastic",
    jupyter_backend="static",
)

Plot Parcellated Data (Shortcut)

python
from netneurotools.plotting import pv_plot_parcellated_data
import numpy as np

data = np.random.rand(400)
pl = pv_plot_parcellated_data(data, 'schaefer400x7', template='fsaverage')

Key Data Structures

StructureDescriptionFields
SURFACEnamedtuple for hemisphere file pairs.L, .R (left/right hemisphere paths)
sklearn.utils.BunchDict-like object returned by fetch functionsVaries per function
FREESURFER_IGNORELabels to ignore in FreeSurfer parcellations["unknown", "corpuscallosum", "Background+FreeSurfer_Defined_Medial_Wall"]
PARCIGNORELabels to ignore in parcellation operations["unknown", "corpuscallosum", "Background+FreeSurfer_Defined_Medial_Wall", "???", "Unknown", "Medial_wall", "Medial wall", "medial_wall"]

Core Modules Quick Reference

ModuleKey FunctionsPurpose
datasetsfetch_fsaverage, fetch_schaefer2018, fetch_cammoun2012, fetch_conte69, fetch_famous_gmatFetch templates, atlases, connectomes
metricsdistance_wei_floyd, navigation_wu, communicability_wei, search_information, mean_first_passage_time, assortativity_und, simulate_atrophyNetwork communication and properties
networksfunc_consensus, struct_consensus, match_length_degree_distribution, strength_preserving_rand_saBuild consensus, generate null models
statspermtest_pearsonr, efficient_pearsonr, residualize, get_dominance_statsStatistical testing and regression
spatialmorans_i, gearys_c, lees_l, local_morans_i, local_gearys_c, local_lees_lSpatial autocorrelation
modularityconsensus_modularity, find_consensus, zrand, get_modularityCommunity detection and evaluation
interfacevertices_to_parcels, parcels_to_vertices, load_surf_parc_file, deconstruct_ciftiFormat conversion
plottingpv_plot_surface, pv_plot_parcellated_data, pv_plot_subcortex, plot_mod_heatmapVisualization

Common Pitfalls

  1. SURFACE fields are .L and .R, not .lh and .rh. Use surface.L and surface.R to access hemisphere paths.

  2. Weight-to-distance conversion must be done before calling distance_wei_floyd or search_information. Common transform: D = -np.log(W / (np.max(W) + 1)).

  3. Minimum permutation p-value is 1 / (n_perm + 1). With n_perm=1000, the smallest p-value is ~0.001.

  4. consensus_modularity requires non-negative input. Louvain cannot handle negative weights. Set negatives to zero: A[A < 0] = 0.

  5. struct_consensus hemiid encoding: 0 = right hemisphere, 1 = left hemisphere.

  6. pv_plot_surface data format: When hemi='both', vertex_data can be a tuple (left, right) or a single concatenated array. Data length must match template vertex count.

  7. Data directory: All fetch functions default to ~/nnt-data. Override with data_dir= parameter or set NNT_DATA environment variable.

  8. match_length_degree_distribution recommended nswap: Use nswap = nnodes * 20 for adequate randomization.

  9. strength_preserving_rand_sa frac parameter must be between 0 and 1. It controls temperature decrease per annealing stage.

  10. parcels_to_vertices and vertices_to_parcels support .annot, .gii, and .dlabel.nii parcellation files. For .dlabel.nii, pass a single file path; for .annot or .gii, pass a tuple of (left, right) paths.

  11. Numba acceleration is available for spatial stats, weighted correlation, and some metrics. Install numba for significant speedups on large datasets.

  12. Headless rendering with PyVista: set os.environ["VTK_DEFAULT_OPENGL_WINDOW"] = "vtkOSOpenGLRenderWindow" before importing pyvista.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Netneurotools Guide AI skill do?

Domain-validated guidance for network neuroscience analysis using netneurotools: datasets, brain network metrics, connectivity consensus, modularity, spatial statistics, null models, and cortical surface visualization. Use this skill whenever the user works with brain connectivity matrices, connectomes, graph theory on brain networks, parcellated brain data (Schaefer, Cammoun, Desikan-Killiany), cortical surface templates (fsaverage, fsLR, CIVET, Conte69), network communication metrics, null model generation, spatial autocorrelation on brain maps, community detection in connectomes, or surf...

Why use Netneurotools Guide on TypingMind?

Because you install it once and use it with any model. Netneurotools Guide is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Netneurotools Guide in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/NeuroAIHub/BrainPilot/tree/main/packages/skills/skills/06_fMRI_Neuroimaging/netneurotools-guide. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Netneurotools Guide?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Netneurotools Guide?

As many as you like. As long as a model supports skills, you can use Netneurotools Guide with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Netneurotools Guide AI skill free?

Yes. It is published on GitHub by NeuroAIHub under the AGPL-3.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇