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

Calculate a forward solution for a subject.


info : instance of mne.Info | str

If str, then it should be a filename to a Raw, Epochs, or Evoked file with measurement information. If dict, should be an info dict (such as one from Raw, Epochs, or Evoked).

trans : dict | str | None

Either a transformation filename (usually made using mne_analyze) or an info dict (usually opened using read_trans()). If string, an ending of .fif or .fif.gz will be assumed to be in FIF format, any other ending will be assumed to be a text file with a 4x4 transformation matrix (like the –trans MNE-C option). Can be None to use the identity transform.

src : str | instance of SourceSpaces

If string, should be a source space filename. Can also be an instance of loaded or generated SourceSpaces.

bem : dict | str

Filename of the BEM (e.g., “sample-5120-5120-5120-bem-sol.fif”) to use, or a loaded sphere model (dict).

fname : str | None

Destination forward solution filename. If None, the solution will not be saved. Deprecated and removed in 0.15, Use mne.write_forward_solution() instead.

meg : bool

If True (Default), include MEG computations.

eeg : bool

If True (Default), include EEG computations.

mindist : float

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

ignore_ref : bool

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.

overwrite : bool

If True, the destination file (if it exists) will be overwritten. If False (default), an error will be raised if the file exists. Deprecated and removed in 0.15. Use mne.write_forward_solution() instead.

n_jobs : int

Number of jobs to run in parallel.

verbose : bool, str, int, or None

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


fwd : instance of Forward

The forward solution.


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().