This documentation is for development version 0.18.dev0.


mne.fit_dipole(evoked, cov, bem, trans=None, min_dist=5.0, n_jobs=1, pos=None, ori=None, verbose=None)[source]

Fit a dipole.

evoked : instance of Evoked

The dataset to fit.

cov : str | instance of Covariance

The noise covariance.

bem : str | instance of ConductorModel

The BEM filename (str) or conductor model.

trans : str | None

The head<->MRI transform filename. Must be provided unless BEM is a sphere model.

min_dist : float

Minimum distance (in millimeters) from the dipole to the inner skull. Must be positive. Note that because this is a constraint passed to a solver it is not strict but close, i.e. for a min_dist=5. the fits could be 4.9 mm from the inner skull.

n_jobs : int

Number of jobs to run in parallel (used in field computation and fitting).

pos : ndarray, shape (3,) | None

Position of the dipole to use. If None (default), sequential fitting (different position and orientation for each time instance) is performed. If a position (in head coords) is given as an array, the position is fixed during fitting.

New in version 0.12.

ori : ndarray, shape (3,) | None

Orientation of the dipole to use. If None (default), the orientation is free to change as a function of time. If an orientation (in head coordinates) is given as an array, pos must also be provided, and the routine computes the amplitude and goodness of fit of the dipole at the given position and orientation for each time instant.

New in version 0.12.

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more).

dip : instance of Dipole or DipoleFixed

The dipole fits. A mne.DipoleFixed is returned if pos and ori are both not None, otherwise a mne.Dipole is returned.

residual : instance of Evoked

The M-EEG data channels with the fitted dipolar activity removed.


New in version 0.9.0.