mne_realtime.MockRtClient#
- class mne_realtime.MockRtClient(raw, verbose=None)[source]#
Mock Realtime Client.
- Parameters:
- rawinstance of
Rawobject The raw object which simulates the RtClient
- verbosebool |
str|int|None Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.
- rawinstance of
- get_event_data(event_id, tmin, tmax, picks=None, stim_channel=None, min_duration=0)[source]#
Simulate the data for a particular event-id.
The epochs corresponding to a particular event-id are returned. The method remembers the epoch that was returned in the previous call and returns the next epoch in sequence. Once all epochs corresponding to an event-id have been exhausted, the method returns None.
- Parameters:
- event_id
int The id of the event to consider.
- tmin
float Start time before event.
- tmax
float End time after event.
- picks
str| array_like |slice|None Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g.,
['meg', 'eeg']) will pick channels of those types, channel name strings (e.g.,['MEG0111', 'MEG2623']will pick the given channels. Can also be the string values'all'to pick all channels, or'data'to pick data channels. None (default) will pick all channels. Bad channels are included by default. Note that channels ininfo['bads']will be included if their names or indices are explicitly provided.- stim_channel
None|str|listofstr Name of the stim channel or all the stim channels affected by the trigger. If None, the config variables ‘MNE_STIM_CHANNEL’, ‘MNE_STIM_CHANNEL_1’, ‘MNE_STIM_CHANNEL_2’, etc. are read. If these are not found, it will default to ‘STI 014’.
- min_duration
float The minimum duration of a change in the events channel required to consider it as an event (in seconds).
- event_id
- Returns:
- data2D
arraywith shape [n_channels, n_times] The epochs that are being simulated
- data2D
- get_measurement_info()[source]#
Return the measurement info.
- Returns:
- self.info
dict The measurement info.
- self.info
- send_data(epochs, picks, tmin, tmax, buffer_size)[source]#
Read from raw object and send them to RtEpochs for processing.
- Parameters:
- epochsinstance of
RtEpochs The epochs object.
- picks
str| array_like |slice|None Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g.,
['meg', 'eeg']) will pick channels of those types, channel name strings (e.g.,['MEG0111', 'MEG2623']will pick the given channels. Can also be the string values'all'to pick all channels, or'data'to pick data channels. None (default) will pick all channels. Bad channels are included by default. Note that channels ininfo['bads']will be included if their names or indices are explicitly provided.- tmin
float Time instant to start receiving buffers.
- tmax
float Time instant to stop receiving buffers.
- buffer_size
int Size of each buffer in terms of number of samples.
- epochsinstance of
Examples using mne_realtime.MockRtClient#
Compute real-time evoked responses using moving averages