sesameeg.mne.prepare_sesame

sesameeg.mne.prepare_sesame(forward, data, n_parts=100, top_min=None, top_max=None, subsample=None, noise_std=None, dip_mom_std=None, prior_locs=None, hyper_q=True, lam=0.25, max_n_dips=10, noise_cov=None, epochs_avg=False, radius=None, neigh_std=None, n_simil=0.5, fourier=False, subject=None, subjects_dir=None, trans_matrix=None, verbose=False)[source]

Prepare a SESAME instance for actually computing the inverse.

Parameters:
forwardForward object

The forward solution.

Note

SESAME automatically detects whether the dipole orientations are free or locally normal to the cortical surface.

datainstance of Evoked | EvokedArray | Epochs | EpochsArray

The MEEG data.

n_partsint

The number of particles forming the empirical pdf.

top_minfloat | None

First topography to be included in the segment of data to be analyzed. It is meant to be expressed either in seconds in the time domain or in Hertz in the frequency domain. If None, it is set to the first topography of the input data.

top_maxfloat | None

Last topography to be included in the segment of data to be analyzed. It is meant to be expressed either in seconds in the time domain or in Hertz in the frequency domain. If None, it is set to the last topography of the input data.

subsampleint | None

The step used to subsample the data. If None no subsampling is applied.

noise_stdfloat | None

The standard deviation of the noise distribution. If None, it is estimated from the data.

dip_mom_stdfloat | None

The standard deviation of the prior pdf on the dipole moment. If None, it is estimated from the forward model and the data.

prior_locsndarray of float, shape (number of points in the source space) | None

The prior probability of source location. If None, a uniform prior probability is used.

hyper_qbool

If True, a hyperprior pdf on the dipole moment std is used.

lamfloat

The parameter of the Poisson prior pdf on the number of dipoles.

max_n_dipsint

The maximum allowed number of dipoles in a particle.

noise_covinstance of Covariance | None

The noise covariance matrix used to prewhiten the data. If None, no prewhitening is applied.

epochs_avgbool

If True, average data epochs.

radiusfloat | None

The maximum distance in centimeters between two neighbouring vertices of the brain discretization. If None, it is set to 1 cm.

neigh_stdfloat | None

The standard deviation of the probability distribution of neighbours. If None, it is set to radius/2.

n_similfloat

Determines which distance is used in computing the set of neighbours of each point in the source space:

  • if n_simil = 0 the correlation distance is used;

  • if n_simil = 1 the Euclidean distance is used;

  • if 0 < n_simil < 1 a combination of the two distances is used. In this case, n_simil is the weight of the Euclidean distance

fourierbool

If True, data are converted to the frequency domain.

subjectstr | None

The subject name.

subjects_dirstr | None

If not None, this directory will be used as the subjects directory instead of the value set using the SUBJECTS_DIR environment variable.

trans_matrixinstance of Transform | None

MRI<->Head coordinate transformation.

verbosebool

If True, increase verbose level.

Returns:
sesameinstance of Sesame

Inverse operator

Examples using sesameeg.mne.prepare_sesame

Compute SESAME inverse solution on evoked data

Compute SESAME inverse solution on evoked data

Compute SESAME inverse solution on evoked data in volume source space

Compute SESAME inverse solution on evoked data in volume source space

Compute SESAME inverse solution on evoked data with source constraints

Compute SESAME inverse solution on evoked data with source constraints

Compute SESAME inverse solution on evoked data with given source location prior

Compute SESAME inverse solution on evoked data with given source location prior

Explore SESAME alternative inverse solutions on evoked data

Explore SESAME alternative inverse solutions on evoked data

Compute SESAME inverse solution on simulated data in the frequency domain

Compute SESAME inverse solution on simulated data in the frequency domain