mne.forward.compute_depth_prior

mne.forward.compute_depth_prior(forward, info, exp=0.8, limit=10.0, limit_depth_chs=False, combine_xyz='spectral', noise_cov=None, rank=None, verbose=None)[source]

Compute depth prior for depth weighting.

Parameters
forwardinstance of Forward

The forward solution.

infoinstance of Info

The measurement info.

expfloat

Exponent for the depth weighting, must be between 0 and 1.

limitfloat | None

The upper bound on depth weighting. Can be None to be bounded by the largest finite prior.

limit_depth_chsbool | ‘whiten’

How to deal with multiple channel types in depth weighting. The default is True, which whitens based on the source sensitivity of the highest-SNR channel type. See Notes for details.

Changed in version 0.18: Added the “whiten” option.

combine_xyz‘spectral’ | ‘fro’

When a loose (or free) orientation is used, how the depth weighting for each triplet should be calculated. If ‘spectral’, use the squared spectral norm of Gk. If ‘fro’, use the squared Frobenius norm of Gk.

New in version 0.18.

noise_covinstance of Covariance | None

The noise covariance to use to whiten the gain matrix when limit_depth_chs='whiten'.

New in version 0.18.

rankNone | dict | ‘info’ | ‘full’

This controls the rank computation that can be read from the measurement info or estimated from the data. See Notes of mne.compute_rank() for details.The default is None.

New in version 0.18.

verbosebool, str, int, or None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more). If used, it should be passed as a keyword-argument only.

Returns
depth_priorndarray, shape (n_vertices,)

The depth prior.

Notes

The defaults used by the minimum norm code and sparse solvers differ. In particular, the values for MNE are:

compute_depth_prior(..., limit=10., limit_depth_chs=True,
                    combine_xyz='spectral')

In sparse solvers and LCMV, the values are:

compute_depth_prior(..., limit=None, limit_depth_chs='whiten',
                    combine_xyz='fro')

The limit_depth_chs argument can take the following values:

  • True (default)

    Use only grad channels in depth weighting (equivalent to MNE C minimum-norm code). If grad channels aren’t present, only mag channels will be used (if no mag, then eeg). This makes the depth prior dependent only on the sensor geometry (and relationship to the sources).

  • 'whiten'

    Compute a whitener and apply it to the gain matirx before computing the depth prior. In this case noise_cov must not be None. Whitening the gain matrix makes the depth prior depend on both sensor geometry and the data of interest captured by the noise covariance (e.g., projections, SNR).

    New in version 0.18.

  • False

    Use all channels. Not recommended since the depth weighting will be biased toward whichever channel type has the largest values in SI units (such as EEG being orders of magnitude larger than MEG).

Examples using mne.forward.compute_depth_prior