Simulate raw data.
Head movements can optionally be simulated using the head_pos
parameter.
mne.Info
The mne.Info
object with information about the sensors and methods of measurement. Used for simulation.
Changed in version 0.18: Support for mne.Info
.
SourceEstimate
| SourceSimulator
The source estimates to use to simulate data. Each must have the same
sample rate as the raw data, and the vertices of all stcs in the
iterable must match. Each entry in the iterable can also be a tuple of
(SourceEstimate, ndarray)
to allow specifying the stim channel
(e.g., STI001) data accompany the source estimate.
See Notes for details.
Changed in version 0.18: Support for tuple, iterable of tuple or SourceEstimate
,
or SourceSimulator
.
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). If trans is None, an identity transform will be used.
str
| instance of SourceSpaces
| None
Source space corresponding to the stc. If string, should be a source
space filename. Can also be an instance of loaded or generated
SourceSpaces. Can be None if forward
is provided.
str
| dict
| None
BEM solution corresponding to the stc. If string, should be a BEM
solution filename (e.g., “sample-5120-5120-5120-bem-sol.fif”).
Can be None if forward
is provided.
None
| str
| dict
| tuple
| array
Name of the position estimates file. Should be in the format of
the files produced by MaxFilter. If dict, keys should
be the time points and entries should be 4x4 dev_head_t
matrices. If None, the original head position (from
info['dev_head_t']
) will be used. If tuple, should have the
same format as data returned by head_pos_to_trans_rot_t
.
If array, should be of the form returned by
mne.chpi.read_head_pos()
.
See for example [1].
float
Minimum distance between sources and the inner skull boundary to use during forward calculation.
str
Either ‘hann’, ‘cos2’ (default), ‘linear’, or ‘zero’, the type of forward-solution interpolation to use between forward solutions at different head positions.
int
| None
The number of jobs to run in parallel. If -1
, it is set
to the number of CPU cores. Requires the joblib
package.
None
(default) is a marker for ‘unset’ that will be interpreted
as n_jobs=1
(sequential execution) unless the call is performed under
a joblib.parallel_backend()
context manager that sets another
value for n_jobs
.
Whether to use cortical patch statistics to define normal orientations for surfaces (default True).
Forward
| None
The forward operator to use. If None (default) it will be computed
using bem
, trans
, and src
. If not None,
bem
, trans
, and src
are ignored.
New in version 0.17.
int
The first_samp property in the output Raw instance.
New in version 0.18.
int
The maximum number of STC iterations to allow. This is a sanity parameter to prevent accidental blowups.
New in version 0.18.
str
| int
| None
Control verbosity of the logging output. If None
, use the default
verbosity level. See the logging documentation and
mne.verbose()
for details. Should only be passed as a keyword
argument.
Raw
The simulated raw file.
See also
Notes
Stim channel encoding
By default, the stimulus channel will have the head position number
(starting at 1) stored in the trigger channel (if available) at the
t=0 point in each repetition of the stc
. If stc
is a tuple of
(SourceEstimate, ndarray)
the array values will be placed in the
stim channel aligned with the mne.SourceEstimate
.
Data simulation
In the most advanced case where stc
is an iterable of tuples the output
will be concatenated in time as:
Channel |
Data |
||
---|---|---|---|
M/EEG |
|
|
|
STIM |
|
|
|
time → |
New in version 0.10.0.
References
mne.simulation.simulate_raw
#Simulate raw data using subject anatomy
Generate simulated source data