This documentation is for development version 0.18.dev0.

mne.simulation.select_source_in_label

mne.simulation.select_source_in_label(src, label, random_state=None, location='random', subject=None, subjects_dir=None, surf='sphere')[source]

Select source positions using a label.

Parameters:
src : list of dict

The source space

label : Label

the label (read with mne.read_label)

random_state : None | int | ~numpy.random.RandomState

To specify the random generator state.

location : str

The label location to choose. Can be ‘random’ (default) or ‘center’ to use mne.Label.center_of_mass() (restricting to vertices both in the label and in the source space). Note that for ‘center’ mode the label values are used as weights.

New in version 0.13.

subject : string | None

The subject the label is defined for. Only used with location='center'.

New in version 0.13.

subjects_dir : str, or None

Path to the SUBJECTS_DIR. If None, the path is obtained by using the environment variable SUBJECTS_DIR. Only used with location='center'.

New in version 0.13.

surf : str

The surface to use for Euclidean distance center of mass finding. The default here is “sphere”, which finds the center of mass on the spherical surface to help avoid potential issues with cortical folding.

New in version 0.13.

Returns:
lh_vertno : list

selected source coefficients on the left hemisphere

rh_vertno : list

selected source coefficients on the right hemisphere