mne.setup_volume_source_space

mne.setup_volume_source_space(subject=None, fname=None, pos=5.0, mri=None, sphere=(0.0, 0.0, 0.0, 90.0), bem=None, surface=None, mindist=5.0, exclude=0.0, overwrite=None, subjects_dir=None, volume_label=None, add_interpolator=True, verbose=None)[source]

Set up a volume source space with grid spacing or discrete source space.

Parameters:

subject : str | None

Subject to process. If None, the path to the mri volume must be absolute. Defaults to None.

fname : str | None

Deprecated and will be removed in 0.15. Use mne.write_source_spaces() instead.

pos : float | dict

Positions to use for sources. If float, a grid will be constructed with the spacing given by pos in mm, generating a volume source space. If dict, pos[‘rr’] and pos[‘nn’] will be used as the source space locations (in meters) and normals, respectively, creating a discrete source space. NOTE: For a discrete source space (pos is a dict), mri must be None.

mri : str | None

The filename of an MRI volume (mgh or mgz) to create the interpolation matrix over. Source estimates obtained in the volume source space can then be morphed onto the MRI volume using this interpolator. If pos is a dict, this can be None.

sphere : array_like (length 4)

Define spherical source space bounds using origin and radius given by (ox, oy, oz, rad) in mm. Only used if bem and surface are both None.

bem : str | None

Define source space bounds using a BEM file (specifically the inner skull surface).

surface : str | dict | None

Define source space bounds using a FreeSurfer surface file. Can also be a dictionary with entries ‘rr’ and ‘tris’, such as those returned by mne.read_surface().

mindist : float

Exclude points closer than this distance (mm) to the bounding surface.

exclude : float

Exclude points closer than this distance (mm) from the center of mass of the bounding surface.

overwrite: bool

Deprecated and will be removed in 0.15. Use mne.write_source_spaces() instead.

subjects_dir : string, or None

Path to SUBJECTS_DIR if it is not set in the environment.

volume_label : str | list | None

Region of interest corresponding with freesurfer lookup table.

add_interpolator : bool

If True and mri is not None, then an interpolation matrix will be produced.

verbose : bool, str, int, or None

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

Returns:

src : list

The source space. Note that this list will have length 1 for compatibility reasons, as most functions expect source spaces to be provided as lists).

Notes

To create a discrete source space, pos must be a dict, ‘mri’ must be None, and ‘volume_label’ must be None. To create a whole brain volume source space, pos must be a float and ‘mri’ must be provided. To create a volume source space from label, ‘pos’ must be a float, ‘volume_label’ must be provided, and ‘mri’ must refer to a .mgh or .mgz file with values corresponding to the freesurfer lookup-table (typically aseg.mgz).