neuroaihub/brainpilot/brain-connectivity-modeler

Claude Code and agent skill by neuroaihub/brainpilot

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Advises on functional/effective connectivity methods: PPI, DCM, Granger causality, graph theory

Install

npx vskill@latest install neuroaihub/brainpilot/brain-connectivity-modeler

SKILL.md

The same SKILL.md was published earlier as neuroaihub/brainpilot/brain-connectivity-modeler.

Brain Connectivity Modeler

Purpose

Brain connectivity analysis goes beyond mapping where activation occurs to ask how brain regions interact. This requires choosing among fundamentally different analytical frameworks: functional connectivity (statistical associations), effective connectivity (directed causal influences), and network topology (graph-theoretic properties). Each framework answers different questions and makes different assumptions.

A competent programmer without neuroscience training would not know the critical distinction between functional and effective connectivity, would likely confuse correlation with causation in brain networks, and would not appreciate why motion artifacts are particularly devastating for connectivity analyses. This skill encodes the domain judgment required to select and correctly implement brain connectivity methods.

When to Use This Skill

  • Choosing a connectivity method for task-based or resting-state fMRI
  • Implementing psychophysiological interaction (PPI) analysis
  • Setting up dynamic causal models (DCM)
  • Applying graph theory to brain network data
  • Evaluating whether Granger causality is appropriate for fMRI
  • Reviewing or troubleshooting existing connectivity analyses

Research Planning Protocol

Before executing the domain-specific steps below, you MUST:

  1. State the research question — What specific question is this analysis/paradigm addressing?
  2. Justify the method choice — Why is this approach appropriate? What alternatives were considered?
  3. Declare expected outcomes — What results would support vs. refute the hypothesis?
  4. Note assumptions and limitations — What does this method assume? Where could it mislead?
  5. Present the plan to the user and WAIT for confirmation before proceeding.

For detailed methodology guidance, see the research-literacy skill.

⚠️ Verification Notice

This skill was generated by AI from academic literature. All parameters, thresholds, and citations require independent verification before use in research. If you find errors, please open an issue.

Functional vs. Effective Connectivity

This is the most fundamental distinction in brain connectivity analysis (Friston, 2011):

PropertyFunctional ConnectivityEffective Connectivity
DefinitionStatistical dependency between time seriesDirected causal influence of one region on another
DirectionalityUndirectedDirected
CausalityCannot infer causalityAttempts to infer causal structure
Model requirementModel-free (correlations)Model-based (requires explicit neural model)
Hypothesis typeExploratory or confirmatoryStrictly confirmatory
Primary methodsCorrelation, partial correlation, ICADCM, PPI, structural equation modeling
SourceFriston, 2011Friston, 2011; Friston et al., 2003

Domain warning: Functional connectivity (correlation) does not imply direct anatomical or causal connection. Two regions can show high functional connectivity because they share a common input, not because they directly influence each other (Friston, 2011).

Method Selection Decision Tree

What is your connectivity question?
|
+-- "Do regions A and B covary in activity?"
| --> Functional connectivity (correlation, partial correlation)
|
+-- "Does the coupling between A and B change with task context?"
| --> PPI (Friston et al., 1997; O'Reilly et al., 2012)
|
+-- "Does region A causally influence region B, and does this
| change with experimental manipulation?"
| --> DCM (Friston et al., 2003)
| Requires: strong prior hypotheses, limited model space
|
+-- "What is the network topology (hubs, modules, efficiency)?"
| --> Graph theory (Bullmore & Sporns, 2009)
|
+-- "Does activity in A temporally precede and predict B?"
--> Granger causality (with STRONG caveats for fMRI;
see Granger causality section below)

Functional Connectivity Methods

Seed-Based Correlation
  1. Extract mean time series from a seed ROI
  2. Compute Pearson correlation with all other voxels (or ROIs)
  3. Apply Fisher z-transformation: z = 0.5 * ln((1+r)/(1-r)) before group statistics (Fisher, 1921)
  4. Enter z-maps into second-level group analysis

Critical preprocessing:

  • Apply stringent motion correction: FD threshold < 0.2 mm for scrubbing or censoring (Power et al., 2014)
  • Band-pass filter to 0.01-0.1 Hz for resting-state (Biswal et al., 1995; but see Niazy et al., 2011 for caveats)
  • Regress out motion parameters (24-parameter model), WM/CSF signals (aCompCor; Behzadi et al., 2007)
Partial Correlation

Partial correlation between regions A and B controls for shared variance with all other regions in the model. This reduces the influence of common inputs but requires careful regularization when the number of regions is large relative to the number of time points (Smith et al., 2011).

  • Use regularized partial correlation (e.g., L1-penalized precision matrix) when the number of ROIs exceeds ~20% of the number of time points (Varoquaux et al., 2010)
Independent Component Analysis (ICA)

ICA decomposes the whole-brain fMRI signal into spatially independent components, each representing a network (Beckmann & Smith, 2004).

  • Model order (number of components): 20-25 for major networks; 70-100 for fine-grained parcellation (Smith et al., 2009)
  • Group ICA: Use temporal concatenation or dual regression (Beckmann et al., 2009; Nickerson et al., 2017)
  • Artifact identification: Classify components as signal or noise based on spatial pattern, power spectrum, and temporal properties (Griffanti et al., 2017)

Psychophysiological Interactions (PPI)

PPI tests whether the functional coupling between a seed region and other brain areas changes as a function of psychological context (e.g., task condition; Friston et al., 1997).

PPI Model Specification

The PPI GLM includes three regressors:

  1. Physiological regressor: Deconvolved time series from the seed region (the neural signal estimate)
  2. Psychological regressor: The task regressor (e.g., condition A vs. condition B)
  3. Interaction term: Element-wise product of the physiological and psychological regressors, reconvolved with the HRF

The interaction term is the regressor of interest. A significant PPI effect means that functional coupling with the seed region differs between task conditions (O'Reilly et al., 2012).

Generalized PPI (gPPI)

Standard PPI tests one psychological contrast at a time. Generalized PPI (gPPI) includes all task conditions simultaneously (McLaren et al., 2012):

  • Create separate PPI terms for each condition
  • Include all main-effect task regressors and the seed time series
  • More sensitive than standard PPI because it properly accounts for all conditions
  • Recommended over standard PPI for designs with more than two conditions (McLaren et al., 2012)
PPI Practical Considerations
ParameterRecommendationSource
Seed ROI definitionFunctional (from activation map) or anatomical atlas; 6-10 mm sphere typicalO'Reilly et al., 2012
DeconvolutionRequired for interaction term (SPM default); extract neural signal before computing interactionGitelman et al., 2003
Minimum events per condition20+ per condition for stable PPI estimatesO'Reilly et al., 2012
Multiple seed regionsRun separate PPI analyses per seed, then correct for multiple comparisonsO'Reilly et al., 2012

Dynamic Causal Modeling (DCM)

DCM models the causal architecture of brain regions using a biophysical generative model of neural dynamics and hemodynamic coupling (Friston et al., 2003).

DCM Model Specification

A DCM is defined by three matrices:

MatrixFunctionInterpretation
A (intrinsic)Fixed connections between regions (always on)Baseline coupling strength
B (modulatory)Condition-dependent modulation of connectionsHow task context changes coupling (the key experimental question)
C (driving input)Which regions receive direct task inputWhere external stimuli enter the network
DCM Requirements and Constraints
RequirementGuidelineSource
Number of regions3-8 regions maximumStephan et al., 2010
Prior hypothesesStrong prior hypotheses about network architecture requiredStephan et al., 2010
Model space sizeKeep total models < 20-30 for reliable BMSStephan et al., 2009
Task designEvent-related or block designs with clear experimental manipulationFriston et al., 2003
Time series extractionFrom first eigenvariate of activated voxels within ROIStephan et al., 2010
Data qualityStrong task activation in all modeled regionsStephan et al., 2010
Bayesian Model Selection (BMS)

After estimating all candidate models, use BMS to identify the winning model (Stephan et al., 2009):

  • Fixed-effects BMS (FFX): Assumes all subjects have the same model. Use when sample is homogeneous
  • Random-effects BMS (RFX): Allows different subjects to have different optimal models. Use for heterogeneous populations (Stephan et al., 2009)
  • Family-level inference: Group models into families sharing a feature (e.g., all models with a particular connection), then compare families. More robust than individual model comparison (Penny et al., 2010)
  • Report exceedance probability (probability that a model/family is more likely than all others) and protected exceedance probability (corrected for chance; Rigoux et al., 2014)
DCM Pitfalls
  • Too many models: Exhaustive model comparison with > 30 models leads to unreliable BMS (Stephan et al., 2010)
  • No activation in modeled regions: DCM requires that included regions show significant task-related activation. Including silent regions produces unreliable estimates
  • Confusing DCM with Granger causality: DCM models neural dynamics, not temporal precedence in BOLD signals

Granger Causality

Granger causality tests whether past values of time series X improve prediction of time series Y beyond Y's own past (Granger, 1969).

Severe Limitations for fMRI
LimitationExplanationSource
Hemodynamic confoundThe HRF varies across brain regions by 1-2 seconds. A region with a faster HRF will appear to "Granger-cause" a region with a slower HRF, regardless of true neural timingDavid et al., 2008; Seth et al., 2013
Low temporal resolutionfMRI TR (0.5-3 seconds) is far slower than neural dynamics (milliseconds), aliasing true causal structureSeth et al., 2013
Downsampling artifactsSubsampling a continuous process can reverse the apparent causal directionSeth et al., 2013

Domain warning: Granger causality applied to fMRI BOLD signals is widely considered unreliable for inferring neural causal direction due to hemodynamic variability (David et al., 2008; Seth et al., 2013). If causal inference is needed, use DCM (which explicitly models the hemodynamic delay) or consider EEG/MEG (which has millisecond temporal resolution).

Graph Theory for Brain Networks

Graph theory characterizes the topological organization of brain networks (Bullmore & Sporns, 2009).

Node Definition
MethodDescriptionExample AtlasesSource
Anatomical parcellationPredefined atlas regionsAAL (116 regions), Harvard-OxfordTzourio-Mazoyer et al., 2002
Functional parcellationData-driven boundariesSchaefer (100-1000 parcels), Gordon (333 parcels)Schaefer et al., 2018; Gordon et al., 2016
Voxel-levelEach voxel is a node~100,000 nodesComputationally expensive; rarely used for full graph metrics

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
884
Repository forks
61
7-day trend score
34

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/neuroaihub/brainpilot/brain-connectivity-modeler/badge)](https://verified-skill.com/skills/neuroaihub/brainpilot/brain-connectivity-modeler)

Something wrong with this skill or its page? Tell us.