mne.make_forward_solution#

mne.make_forward_solution(info, trans, src, bem, meg=True, eeg=True, *, mindist=0.0, ignore_ref=False, n_jobs=None, verbose=None)[source]#

Calculate a forward solution for a subject.

Parameters:
infomne.Info | path-like

The mne.Info object with information about the sensors and methods of measurement. If path-like, it should be a str or pathlib.Path to a file with measurement information (e.g. mne.io.Raw).

transpath-like | dict | instance of Transform | "fsaverage" | None

If str, the path to the head<->MRI transform *-trans.fif file produced during coregistration. Can also be 'fsaverage' to use the built-in fsaverage transformation. If trans is None, an identity matrix is assumed.

Changed in version 0.19: Support for 'fsaverage' argument.

srcpath-like | instance of SourceSpaces

Either a path to a source space file or a loaded or generated SourceSpaces.

bempath-like | ConductorModel

Filename of the BEM (e.g., "sample-5120-5120-5120-bem-sol.fif") to use, or a loaded ConductorModel. See make_bem_model() and make_bem_solution() to create a mne.bem.ConductorModel.

megbool

If True (default), include MEG computations.

eegbool

If True (default), include EEG computations.

mindistfloat

Minimum distance of sources from inner skull surface (in mm).

ignore_refbool

If True, do not include reference channels in compensation. This option should be True for KIT files, since forward computation with reference channels is not currently supported.

n_jobsint | None

The number of jobs to run in parallel. If -1, it is set to the number of CPU cores. Requires the joblib package. None (default) is a marker for ‘unset’ that will be interpreted as n_jobs=1 (sequential execution) unless the call is performed under a joblib.parallel_config context manager that sets another value for n_jobs.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns:
fwdinstance of Forward

The forward solution.

Notes

The --grad option from MNE-C (to compute gradients) is not implemented here.

To create a fixed-orientation forward solution, use this function followed by mne.convert_forward_solution().

Note

If the BEM solution was computed with OpenMEEG in mne.make_bem_solution(), then OpenMEEG will automatically be used to compute the forward solution.

Changed in version 1.2: Added support for OpenMEEG-based forward solution calculations.

Examples using mne.make_forward_solution#

Working with CTF data: the Brainstorm auditory dataset

Working with CTF data: the Brainstorm auditory dataset

Setting the EEG reference

Setting the EEG reference

Preprocessing optically pumped magnetometer (OPM) MEG data

Preprocessing optically pumped magnetometer (OPM) MEG data

Head model and forward computation

Head model and forward computation

EEG forward operator with a template MRI

EEG forward operator with a template MRI

EEG source localization given electrode locations on an MRI

EEG source localization given electrode locations on an MRI

Compute source power spectral density (PSD) of VectorView and OPM data

Compute source power spectral density (PSD) of VectorView and OPM data

Use source space morphing

Use source space morphing

Compute MNE inverse solution on evoked data with a mixed source space

Compute MNE inverse solution on evoked data with a mixed source space

Plot point-spread functions (PSFs) for a volume

Plot point-spread functions (PSFs) for a volume

From raw data to dSPM on SPM Faces dataset

From raw data to dSPM on SPM Faces dataset