Does targeted neurofeedback reorganize the spatial distribution of the depressed brain's distance from criticality?
This repository contains the full analysis pipeline for a single-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 reorganizes the spatial distribution of that regime across cortex.
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 work instantiates the evaluation side of a structure-resolution perspective: the cohort mean
|
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 │ │
│ └────────────────────────────┬────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────┼─────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────────┐ ┌─────────────┐ │
│ │ Baseline │ │ H1 (principal) │ │ H2 │ │
│ │ cohort │ │ Δσ_a group │ │ Δa group │ │
│ │ subcrit │ │ reorganization │ │ contrast │ │
│ └──────────────┘ └──────────────────┘ └─────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Sensitivity battery: power · half-width stratification · │ │
│ │ cross-atlas · estimator · session-order · ICC · baseline │ │
│ │ characterization · demographic adjustment · circuit-size · │ │
│ │ permutation · bootstrap · leave-one-subject-out · spec-curve │ │
│ └─────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────┘
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 | Principal statistic (H1) | |
| Inter-regional coupling | Tested → not identifiable at TR = 2 s |
The decision to fix
The principal hypothesis concerns the spatial reorganization of regional dynamics; the mean-shift hypothesis is secondary; cohort subcriticality is a baseline characterization that validates the framework rather than a test of the intervention.
| Hypothesis | Test | |
|---|---|---|
| Baseline | The MDD cohort sits in the subcritical regime: cohort-mean |
One-sample |
| H1 (principal) | Active rtfMRI-NF reorganizes the spatial distribution of regional bifurcation states relative to sham (change in |
Welch's |
| H2 | Active rtfMRI-NF produces a directional shift in mean |
Welch's |
Inferential controls applied to the intervention contrasts: Cohen's
Baseline subcriticality (framework validation) is robust and replicates on the cross-validation atlas. The cohort sits deep in the subcritical regime, with only one of approximately 8,200 per-fit estimates falling supercritical:
Baseline: cohort mean a = -0.288 (216-ROI) t(37) = -56.13 p < 0.001 CONFIRMED
Baseline: cohort mean a = -0.292 (HOA-110) t(37) = -56.29 p < 0.001 REPLICATED
Spatial reorganization (H1, principal) shows a large-effect, directionally stable expansion of
H1: Δσ_a d = +0.96 95% CI [-0.02, +1.89] parametric p = 0.050 DIRECTIONAL / POWER-LIMITED
permutation p = 0.054 · BCa CI includes zero · Bayes factor ≈ 1.6
deterministic-objective estimator: d ≈ +0.05 (baseline retention)
Directional mean shift (H2) is consistent across the whole-brain and circuit-restricted analyses, both pointing toward deeper subcriticality in the active arm. 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
Active-group regions diverge in their dynamical operating points across cortex while sham-group regions converge. This bidirectional pattern (active expansion, sham contraction) is not consistent with nonspecific session effects shared between the two arms, and it is a pattern the cohort-level mean cannot register because it averages over the spatial structure that
The single robust positive statement the sample supports is the stability of the direction of effect across estimators, atlases, and analytic specifications. This is what motivates
$\sigma_a$ as a candidate quantity for adequately powered replication, not as a finished result.
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 (and its limits). A complementary deterministic-objective estimator (multi-start L-BFGS-B on the chi-square surface, with a per-fit observability metric) is applied to the same data. The two estimators agree on cohort-level direction but not on per-region point estimates, with the per-fit correlation near zero. Consequently the
Power calibration upfront. A sensitivity power analysis was conducted before the intervention contrasts were 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. 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 at baseline, 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 direction of the principal findings against the major threats to inference at the present sample size, and documents where magnitude is not supported.
| Check | Substrate | Verdict |
|---|---|---|
| Power calibration | Welch noncentrality under empirical variances | Minimum detectable |
| Half-width stratification | UKF posterior half-width filter | H1, H2 directions stable or strengthen as threshold tightens |
| Cross-atlas reproduction | Harvard-Oxford 110-ROI | Directions and approximate magnitudes preserved (cortex-driven) |
| Estimator comparison | UKF vs deterministic L-BFGS-B | Direction agrees; |
| Exact inference (H1) | Permutation · BCa bootstrap · LOSO · Bayes · spec-curve |
|
| 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 |
| Baseline characterization | Group × baseline interaction | Baseline predicts Δ (regression to the mean); interaction non-significant |
| Demographic adjustment | Age + sex covariates | H1 and H2 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.
- M. Misaki, K. D. Young, A. Tsuchiyagaito, J. Savitz, S. M. Guinjoan, Clinical response to neurofeedback in major depression relates to subtypes of whole-brain activation patterns during training, Molecular Psychiatry, 2025, Volume 30, Issue 6, pp. 2707-2717. DOI: 10.1038/s41380-024-02880-3.
Built on the Stuart-Landau normal form · Unscented Kalman Filter · Schaefer 2018 + Melbourne Subcortex parcellations