✦ Day 20 · Advanced Statistics

Threshold-Free Cluster
Enhancement (TFCE)

Eliminate arbitrary cluster thresholds by integrating local signal height and spatial-temporal extent across all threshold levels simultaneously.

📈 Threshold-Free Integration 🧠 Spatio-Temporal Extent 🎯 Peak Localization 🐍 spatio_temporal_cluster_1samp_test 📖 Smith & Nichols 2009

Day 19 introduced Cluster-Based Permutation Tests, which solve the multiple comparison problem by grouping adjacent significant points. However, standard cluster testing requires choosing an arbitrary cluster-forming threshold (e.g. p < 0.05). Threshold-Free Cluster Enhancement (TFCE) removes this arbitrary parameter entirely by integrating local signal height and spatial-temporal extent across all possible thresholds simultaneously.


1

The TFCE Intuition
Height vs. Extent Integration

TFCE transforms every raw t-statistic at point (p) into a score that reflects both its peak intensity and its supporting neighborhood:

TFCE(p) = ∫ [e(h)]E · hH dh

h: height (t-statistic threshold level).
e(h): extent (size of the connected cluster at threshold h).
E & H: standard exponents (typically E=0.5, H=2.0 for 2D/3D data).

High sharp peaks and broad low plateaus both get enhanced, delivering high spatial-temporal precision without any arbitrary cutoff!

Smith & Nichols (2009) / Cohen (ANTS Ch. 33): TFCE gives you the best of both worlds: the sensitivity of cluster-based statistics and the exact point-by-point localization of unclustered testing.


2

Running TFCE in MNE
Spatio-Temporal Cluster Testing

Python
import mne
from mne.stats import spatio_temporal_cluster_1samp_test

# Define TFCE threshold parameter dictionary
threshold_tfce = dict(start=0, step=0.2)

# Calculate adjacency matrix for channels
adjacency, _ = mne.channels.find_ch_adjacency(epochs.info, ch_type='eeg')

# Run spatio-temporal TFCE permutation test
t_obs, clusters, p_values, H0 = spatio_temporal_cluster_1samp_test(
    X,   # shape: (n_subjects, n_times, n_channels)
    threshold=threshold_tfce,
    adjacency=adjacency,
    n_permutations=2000,
    n_jobs=-1
)

print(f"TFCE completed across {X.shape[1]} timepoints and {X.shape[2]} channels.")