meegsim.location.select_random#

meegsim.location.select_random(src, *, n=1, vertices=None, sort_output=False, random_state=None)[source]#

Randomly selects a specified number of vertices from a given source space.

Parameters:
srcSourceSpaces

An instance of source spaces to select the vertices from.

nint, optional

The number of random vertices to select. By default, one vertex is selected.

verticesNone (default) or list

A subset of vertices to choose from. If None (default), the function uses all vertices from the provided src.

sort_outputbool, optional

Indicates if sorting is needed for the output. By default, the output is not sorted.

random_stateNone (default) or int

Seed for the random number generator. If None (default), results will vary between function calls. Use a fixed value for reproducibility.

Returns:
selectedlist

A list of tuples (index of the source space, vertno of the selected vertex).

Examples using meegsim.location.select_random#

Using functions from other packages

Using functions from other packages

Minimal example

Minimal example

Random state and reproducibility

Random state and reproducibility

Plotting the configuration

Plotting the configuration

Adjustment of global SNR

Adjustment of global SNR

Adjustment of local SNR

Adjustment of local SNR

Controlling the standard deviation of activity

Controlling the standard deviation of activity

Adding sensor space noise

Adding sensor space noise