MCPcopy
hub / github.com/mne-tools/mne-python / simulate_raw

Function simulate_raw

mne/simulation/raw.py:154–387  ·  view source on GitHub ↗

Simulate raw data. Head movements can optionally be simulated using the ``head_pos`` parameter. Parameters ---------- %(info_not_none)s Used for simulation. .. versionchanged:: 0.18 Support for :class:`mne.Info`. stc : iterable | SourceEstimate | SourceS

(
    info,
    stc=None,
    trans=None,
    src=None,
    bem=None,
    head_pos=None,
    mindist=1.0,
    interp="cos2",
    n_jobs=None,
    use_cps=True,
    forward=None,
    first_samp=0,
    max_iter=10000,
    verbose=None,
)

Source from the content-addressed store, hash-verified

152
153@verbose
154def simulate_raw(
155 info,
156 stc=None,
157 trans=None,
158 src=None,
159 bem=None,
160 head_pos=None,
161 mindist=1.0,
162 interp="cos2",
163 n_jobs=None,
164 use_cps=True,
165 forward=None,
166 first_samp=0,
167 max_iter=10000,
168 verbose=None,
169):
170 """Simulate raw data.
171
172 Head movements can optionally be simulated using the ``head_pos``
173 parameter.
174
175 Parameters
176 ----------
177 %(info_not_none)s Used for simulation.
178
179 .. versionchanged:: 0.18
180 Support for :class:`mne.Info`.
181 stc : iterable | SourceEstimate | SourceSimulator
182 The source estimates to use to simulate data. Each must have the same
183 sample rate as the raw data, and the vertices of all stcs in the
184 iterable must match. Each entry in the iterable can also be a tuple of
185 ``(SourceEstimate, ndarray)`` to allow specifying the stim channel
186 (e.g., STI001) data accompany the source estimate.
187 See Notes for details.
188
189 .. versionchanged:: 0.18
190 Support for tuple, iterable of tuple or `~mne.SourceEstimate`,
191 or `~mne.simulation.SourceSimulator`.
192 trans : dict | str | None
193 Either a transformation filename (usually made using mne_analyze)
194 or an info dict (usually opened using read_trans()).
195 If string, an ending of ``.fif`` or ``.fif.gz`` will be assumed to
196 be in FIF format, any other ending will be assumed to be a text
197 file with a 4x4 transformation matrix (like the ``--trans`` MNE-C
198 option). If trans is None, an identity transform will be used.
199 src : path-like | instance of SourceSpaces | None
200 Source space corresponding to the stc. If string, should be a source
201 space filename. Can also be an instance of loaded or generated
202 SourceSpaces. Can be None if ``forward`` is provided.
203 bem : path-like | dict | None
204 BEM solution corresponding to the stc. If string, should be a BEM
205 solution filename (e.g., "sample-5120-5120-5120-bem-sol.fif").
206 Can be None if ``forward`` is provided.
207 %(head_pos)s
208 See for example :footcite:`LarsonTaulu2017`.
209 mindist : float
210 Minimum distance between sources and the inner skull boundary
211 to use during forward calculation.

Callers 9

test_iterableFunction · 0.90
test_simulate_raw_sphereFunction · 0.90
test_degenerateFunction · 0.90
test_simulate_raw_bemFunction · 0.90
test_simulate_round_tripFunction · 0.90
test_simulate_eeg_onlyFunction · 0.90
test_simulate_raw_chpiFunction · 0.90
80_dics.pyFile · 0.90

Calls 15

_validate_typeFunction · 0.85
pick_typesFunction · 0.85
pick_channelsFunction · 0.85
_get_stim_channelFunction · 0.85
_check_head_posFunction · 0.85
_ensure_srcFunction · 0.85
read_bem_solutionFunction · 0.85
_plFunction · 0.85
_check_stc_iterableFunction · 0.85
restrict_forward_to_stcFunction · 0.85
_stc_src_selFunction · 0.85

Tested by 7

test_iterableFunction · 0.72
test_simulate_raw_sphereFunction · 0.72
test_degenerateFunction · 0.72
test_simulate_raw_bemFunction · 0.72
test_simulate_round_tripFunction · 0.72
test_simulate_eeg_onlyFunction · 0.72
test_simulate_raw_chpiFunction · 0.72