Skip to content

Inverse solution

loose module-attribute

Python
loose = 0.2

Value that weights the source variances of the dipole components that are parallel (tangential) to the cortical surface. If 0, then the inverse solution is computed with fixed orientation. If 1, it corresponds to free orientation. The default value, 'auto', is set to 0.2 for surface-oriented source spaces, and to 1.0 for volumetric, discrete, or mixed source spaces, unless fixed is True in which case the value 0. is used.

Pipeline steps using this setting

The following steps are directly affected by changes to loose:

  • source/_05_make_inverse

depth module-attribute

Python
depth = 0.8

If float (default 0.8), it acts as the depth weighting exponent (exp) to use (must be between 0 and 1). None is equivalent to 0, meaning no depth weighting is performed. Can also be a dict containing additional keyword arguments to pass to :func:mne.forward.compute_depth_prior (see docstring for details and defaults).

Pipeline steps using this setting

The following steps are directly affected by changes to depth:

  • source/_05_make_inverse

inverse_method module-attribute

Python
inverse_method = 'dSPM'

Use minimum norm, dSPM (default), sLORETA, or eLORETA to calculate the inverse solution.

Pipeline steps using this setting

The following steps are directly affected by changes to inverse_method:

  • source/_05_make_inverse
  • source/_99_group_average

noise_cov module-attribute

Python
noise_cov = (None, 0)

Specify how to estimate the noise covariance matrix, which is used in inverse modeling.

If a tuple, it takes the form (tmin, tmax) with the time specified in seconds. If the first value of the tuple is None, the considered period starts at the beginning of the epoch. If the second value of the tuple is None, the considered period ends at the end of the epoch. The default, (None, 0), includes the entire period before the event, which is typically the pre-stimulus period.

If 'emptyroom', the noise covariance matrix will be estimated from an empty-room MEG recording. The empty-room recording will be automatically selected based on recording date and time. This cannot be used with EEG data.

If 'rest', the noise covariance will be estimated from a resting-state recording (i.e., a recording with task-rest and without a run in the filename).

If 'ad-hoc', a diagonal ad-hoc noise covariance matrix will be used.

You can also pass a function that accepts a BIDSPath and returns an mne.Covariance instance. The BIDSPath will point to the file containing the generated evoked data.

Example

Use the period from start of the epoch until 100 ms before the experimental event:

Python
noise_cov = (None, -0.1)

Use the time period from the experimental event until the end of the epoch:

Python
noise_cov = (0, None)

Use an empty-room recording:

Python
noise_cov = 'emptyroom'

Use a resting-state recording:

Python
noise_cov = 'rest'

Use an ad-hoc covariance:

Python
noise_cov = 'ad-hoc'

Use a custom covariance derived from raw data:

Python
def noise_cov(bids_path):
    bp = bids_path.copy().update(task='rest', run=None, suffix='meg')
    raw_rest = mne_bids.read_raw_bids(bp)
    raw.crop(tmin=5, tmax=60)
    cov = mne.compute_raw_covariance(raw, rank='info')
    return cov

Pipeline steps using this setting

The following steps are directly affected by changes to noise_cov:

  • preprocessing/_07_make_epochs
  • sensor/_01_make_evoked
  • sensor/_06_make_cov
  • source/_05_make_inverse

noise_cov_method module-attribute

Python
noise_cov_method = 'shrunk'

The noise covariance estimation method to use. See the MNE-Python documentation of mne.compute_covariance for details.

Pipeline steps using this setting

The following steps are directly affected by changes to noise_cov_method:

  • sensor/_06_make_cov

source_info_path_update module-attribute

Python
source_info_path_update = dict(suffix='ave')

When computing the forward and inverse solutions, by default the pipeline retrieves the mne.Info object from the cleaned evoked data. However, in certain situations you may wish to use a different Info.

This parameter allows you to explicitly specify from which file to retrieve the mne.Info object. Use this parameter to supply a dictionary to BIDSPath.update() during the forward and inverse processing steps.

Example

Use the Info object stored in the cleaned epochs:

Python
source_info_path_update = {'processing': 'clean',
                           'suffix': 'epo'}

Pipeline steps using this setting

The following steps are directly affected by changes to source_info_path_update:

  • source/_04_make_forward
  • source/_05_make_inverse

inverse_targets module-attribute

Python
inverse_targets = ['evoked']

On which data to apply the inverse operator. Currently, the only supported target is 'evoked'. If no inverse computation should be done, pass an empty list, [].

Example

Compute the inverse solution on evoked data:

Python
inverse_targets = ['evoked']

Don't compute an inverse solution:

Python
inverse_targets = []

Pipeline steps using this setting

The following steps are directly affected by changes to inverse_targets:

  • source/_05_make_inverse