Can targeted neurofeedback reorganize the spatial distribution of the depressed brain's distance from criticality?
This repository contains the full analysis pipeline for a double-blind, sham-controlled real-time fMRI neurofeedback trial in unmedicated Major Depressive Disorder. The central scientific question is whether MDD resting-state brain dynamics occupy a subcritical regime, and whether amygdala-targeted neurofeedback measurably reorganizes that regime.
A Stuart-Landau oscillator, the canonical normal form of a supercritical Hopf bifurcation, is fitted to each region's BOLD time series via an Unscented Kalman Filter, yielding a per-region per-session bifurcation parameter
The framework draws conceptually on the cortical hierarchy literature (intrinsic neural timescales, regional E/I balance) and the broader Hopf-bifurcation modeling tradition for whole-brain dynamics. The empirical contribution is to demonstrate that the spatial distribution of the bifurcation parameter is sensitive to within-cohort therapeutic intervention at a sample size where the cohort-level mean alone is not.
|
Participants
Neurofeedback Protocol
|
Acquisition
Parcellation
|
┌──────────────────────────────────────────────────────────────────────────┐
│ parcellate_219roi_v3.ipynb │
│ AFNI BRIK/HEAD ──▸ Atlas construction (216 + 110) ──▸ ROI CSVs │
└───────────────────────────────────┬──────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ mdd_analysis_v3.ipynb │
│ │
│ ┌──────────────────────┐ ┌──────────────────────────────────────┐ │
│ │ Stage 1 — SL-UKF │ │ Stage 1b — L-BFGS-B (deterministic) │ │
│ │ per-region a, ω │ │ estimator-comparison robustness │ │
│ └──────────┬───────────┘ └──────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Per-region per-session bifurcation parameters │ │
│ └────────────────────────────┬────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────┼─────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌──────────┐ ┌─────────────┐ ┌──────────────────┐ │
│ │ H1 │ │ H2 │ │ H3 │ │
│ │ cohort │ │ Δa group │ │ Δσ_a group │ │
│ │ subcrit │ │ contrast │ │ contrast │ │
│ └──────────┘ └─────────────┘ └──────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Sensitivity battery: power · half-width stratification · │ │
│ │ cross-atlas · estimator · session-order · ICC · baseline │ │
│ │ characterization · demographic adjustment · circuit-size │ │
│ └─────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────┘
The Stuart-Landau equation in complex form:
Expanded to real coordinates for the UKF state space:
where
When
| Parameter | Meaning | Status |
|---|---|---|
| Distance from critical point | Estimated by UKF (Stage 1) | |
| Natural oscillation frequency | Pre-fitted via Hilbert phase derivative | |
| Across-region SD of a per subject | Statistical Analysis (H3) | |
| Inter-regional coupling | Tested → not identifiable at TR = 2 s |
The decision to fix
| Hypothesis | Test | |
|---|---|---|
| H1 | The MDD cohort sits in the subcritical regime: cohort-mean |
One-sample |
| H2 | Active rtfMRI-NF produces a directional shift in mean |
Welch's |
| H3 | Active rtfMRI-NF produces a reorganization of the spatial distribution of regional bifurcation states relative to sham | Welch's |
Inferential controls applied to all three families: Cohen's
Cohort-level subcriticality (H1) is robust and replicates on the cross-validation atlas:
H1: cohort subcriticality (216-ROI) t(37) = -56.13 p < 0.001 CONFIRMED
H1: cohort subcriticality (HOA-110) t(37) = -56.29 p < 0.001 REPLICATED
Directional H2 contrast is consistent across the whole-brain and circuit-restricted analyses, with both contrasts pointing toward deeper subcriticality in the active arm relative to sham. Both fall below the design's minimum detectable effect at conventional 80% power and are interpreted as power-limited rather than evidentially decisive:
H2: whole-brain Δa d = -0.84 p = 0.080 directional, power-limited
H2: circuit-restricted Δa d = -0.66 p = 0.157 directional, not significant
Spatial reorganization (H3) reaches conventional significance and is the centerpiece finding of the analysis:
H3: Δσ_a d = +0.96 p = 0.050 SIGNIFICANT
Active-group regions diverge in their dynamical operating points across cortex while sham-group regions converge — a pattern that the cohort-level mean is unable to register because it averages over the spatial structure that
Spatial heterogeneity statistic. The across-region standard deviation
Stuart-Landau UKF. RK4-integrated sigma-point Kalman filter for joint state-parameter estimation from the BOLD analytic signal, with
Dual-atlas validation. Every subject-level result is independently replicated on a second atlas (216-ROI Schaefer-Melbourne primary; 110-ROI Harvard-Oxford sphere-based validation) with no shared ROIs and independent processing pipelines. Cross-atlas correlation
Dual-estimator robustness. A complementary deterministic-objective estimator using multi-start L-BFGS-B optimization of the chi-square surface with a per-fit observability metric is applied to the same data. Cohort-level mean direction and magnitude agree closely; per-fit estimates diverge substantially, with Pearson correlation near zero between per-region per-session estimates from the two pipelines. The substantive findings of the present analysis rest on cohort-level and second-moment statistics that are preserved across the two estimation frameworks.
Power calibration upfront. A sensitivity power analysis was conducted before the H2 analysis was performed. Under the empirical group variances and sample sizes, the minimum detectable effect at 80% power is
A priori depression-circuit mask. The 69-ROI depression circuit used in the circuit-restricted H2 analysis is constructed in this work as a literature-based mask on the Schaefer-Melbourne atlas — a fixed list of subcortical parcels and a fixed set of substring patterns matched against Schaefer parcel names, applied identically to all subjects before any group-level analysis is conducted. The mask is intended to be carried forward as a reusable definition in subsequent analyses on related cohorts.
Linearization coherence. In the deeply subcritical regime confirmed by H1, the Stuart-Landau cubic term vanishes and the model reduces to multivariate Ornstein-Uhlenbeck. The mOU framework is therefore not an independent model choice but the linearization of the SL dynamics under the empirical regime characterized by Stage 1.
A battery of robustness checks supports the principal findings against the major threats to inference at the present sample size.
| Check | Substrate | Verdict |
|---|---|---|
| Power calibration | Welch noncentrality under empirical variances | Minimum detectable |
| Half-width stratification | UKF posterior half-width filter | H1, H2, H3 directions stable or strengthen as threshold tightens |
| Cross-atlas reproduction | Harvard-Oxford 110-ROI | All three hypotheses preserve direction and approximate magnitude |
| Estimator comparison | UKF vs deterministic L-BFGS-B | Cohort-level and second-moment findings agree |
| Session-order check | Sham-arm one-sample tests vs zero | No detectable rest1→rest2 drift in either |
| Test-retest reliability | ICC(2,1) on sham arm | Subject-level statistics moderately reliable; per-region values lower (per-fit identifiability) |
| Baseline characterization | Group × baseline interaction | Baseline predicts Δ (regression to the mean); interaction non-significant |
| Demographic adjustment | Age + sex covariates | H2 and H3 contrasts preserved in direction and magnitude |
| Circuit-size sensitivity | Eight circuit variants (8 → 77 ROIs) | Direction preserved; |
|
R packages |
Python packages |
System: R ≥ 4.2 · Python ≥ 3.9 · AFNI (preprocessing only) Hardware target: Apple Silicon (M-series) with 64 GB RAM; 8 logical cores recommended for PSOCK parallelization Total runtime: ≈ 5 hours end-to-end on the recommended hardware
# 1. Clone and set up
git clone <repository-url>
cd <repository-root>
# 2. Place source data
# data/source/processed rest scans/ (rest1 BRIK/HEAD)
# data/source/processed rest2 scans/ (rest2 BRIK/HEAD)
# data/source/participants.tsv (group assignments + clinical scales)
# atlases/Tian_Subcortex_S1_3T_2009cAsym.nii.gz
# 3. Run parcellation (~20 min)
jupyter execute parcellate_219roi_v3.ipynb
# 4. Run main analysis (~5 hours; 3 h per atlas + ~2 h hypothesis tests)
jupyter execute mdd_analysis_v3.ipynb
# 5. Generate revisions outputs (figR1–R6, supplementary tables)
jupyter execute ch4_revisions_outputs.ipynb
# Results → results/v3/Resting-state fMRI data were collected at the Laureate Institute for Brain Research (LIBR, Tulsa, Oklahoma) under the rtfMRI-NF clinical trial NCT02079610. Acquisition and preprocessing protocols follow the Zotev/Young series of publications on amygdala-targeted neurofeedback in MDD (Zotev et al. 2016; Young et al. 2014, 2017, 2018). All procedures were approved by the Western Institutional Review Board, with informed consent obtained from all participants. Group assignments used in the present analyses are read from the authoritative participants.tsv study record.
The present work is an independent secondary analysis of the resting-state component of the trial, applying a Stuart-Landau bifurcation-parameter framework that is not present in the original publications. All raw imaging data, preprocessing, and group assignments derive from the LIBR cohort; all dynamical-systems modeling,
If you use this pipeline or build on this work, please cite the accompanying manuscript (citation block to be filled upon publication) and acknowledge the upstream data-source publications:
- Zotev, V. et al. (2016). Correlation between amygdala BOLD activity and frontal EEG asymmetry during real-time fMRI neurofeedback training in patients with depression. NeuroImage: Clinical, 11, 224–238.
- Young, K. D. et al. (2014). Real-time fMRI neurofeedback training of amygdala activity in patients with major depressive disorder. PLOS ONE, 9(2), e88785.
- Young, K. D. et al. (2017). Randomized clinical trial of real-time fMRI amygdala neurofeedback for major depressive disorder. American Journal of Psychiatry, 174(8), 748–755.
Built on the Stuart-Landau normal form · Unscented Kalman Filter · Schaefer 2018 + Melbourne Subcortex parcellations