mne.SourceSpaces

class mne.SourceSpaces(source_spaces, info=None)

Represent a list of source space

Currently implemented as a list of dictionaries containing the source space information

Parameters:

source_spaces : list

A list of dictionaries containing the source space information.

info : dict

Dictionary with information about the creation of the source space file. Has keys ‘working_dir’ and ‘command_line’.

Attributes:

info : dict

Dictionary with information about the creation of the source space file. Has keys ‘working_dir’ and ‘command_line’.

Methods

append L.append(object) – append object to end
copy() Make a copy of the source spaces
count(...)
export_volume(fname[, include_surfaces, ...]) Exports source spaces to nifti or mgz file
extend L.extend(iterable) – extend list by appending elements from the iterable
index((value, [start, ...) Raises ValueError if the value is not present.
insert L.insert(index, object) – insert object before index
pop(...) Raises IndexError if list is empty or index is out of range.
remove L.remove(value) – remove first occurrence of value.
reverse L.reverse() – reverse IN PLACE
save(fname) Save the source spaces to a fif file
sort L.sort(cmp=None, key=None, reverse=False) – stable sort IN PLACE;
__init__(source_spaces, info=None)
append()

L.append(object) – append object to end

copy()

Make a copy of the source spaces

Returns:

src : instance of SourceSpaces

The copied source spaces.

count(value) → integer -- return number of occurrences of value
export_volume(fname, include_surfaces=True, include_discrete=True, dest='mri', trans=None, mri_resolution=False, use_lut=True, verbose=None)

Exports source spaces to nifti or mgz file

Parameters:

fname : str

Name of nifti or mgz file to write.

include_surfaces : bool

If True, include surface source spaces.

include_discrete : bool

If True, include discrete source spaces.

dest : ‘mri’ | ‘surf’

If ‘mri’ the volume is defined in the coordinate system of the original T1 image. If ‘surf’ the coordinate system of the FreeSurfer surface is used (Surface RAS).

trans : dict, str, or 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. Must be provided if source spaces are in head coordinates and include_surfaces and mri_resolution are True.

mri_resolution : bool

If True, the image is saved in MRI resolution (e.g. 256 x 256 x 256).

use_lut : bool

If True, assigns a numeric value to each source space that corresponds to a color on the freesurfer lookup table.

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose).

Notes

This method requires nibabel.

extend()

L.extend(iterable) – extend list by appending elements from the iterable

index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

insert()

L.insert(index, object) – insert object before index

pop([index]) → item -- remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

remove()

L.remove(value) – remove first occurrence of value. Raises ValueError if the value is not present.

reverse()

L.reverse() – reverse IN PLACE

save(fname)

Save the source spaces to a fif file

Parameters:

fname : str

File to write.

sort()

L.sort(cmp=None, key=None, reverse=False) – stable sort IN PLACE; cmp(x, y) -> -1, 0, 1