mne_denoise.quantify_overcorrection#

mne_denoise.quantify_overcorrection(operator: ndarray, leadfield: ndarray) dict[str, ndarray][source]#

Compute source-topography distortion metrics for a spatial operator.

Parameters:
operatorndarray, shape (n_channels, n_channels)

Linear spatial filter.

leadfieldndarray, shape (n_channels, n_sources)

Lead field in the same channel order and reference as operator.

Returns:
dict of ndarray

Per-source arrays for:

amplitude_change

(norm(operator @ l) - norm(l)) / norm(l).

correlation

(operator @ l) dot l / (norm(operator @ l) * norm(l)).

relative_error

norm(operator @ l - l) / norm(l).

goodness_of_fit

1 - relative_error**2.

Notes

These are mne-denoise evaluation definitions. Sources with zero input or output topography produce NaN where the corresponding ratio is undefined.