mne_realtime.MockRtClient#

class mne_realtime.MockRtClient(raw, verbose=None)[source]#

Mock Realtime Client.

Parameters:
rawinstance of Raw object

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 and mne.verbose() for details. Should only be passed as a keyword argument.

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_idint

The id of the event to consider.

tminfloat

Start time before event.

tmaxfloat

End time after event.

picksstr | 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. Note that channels in info['bads'] will be included if their names or indices are explicitly provided.

stim_channelNone | str | list of str

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_durationfloat

The minimum duration of a change in the events channel required to consider it as an event (in seconds).

Returns:
data2D array with shape [n_channels, n_times]

The epochs that are being simulated

get_measurement_info()[source]#

Return the measurement info.

Returns:
self.infodict

The measurement info.

register_receive_callback(x)[source]#

Fake API boilerplate.

Parameters:
xNone

Not used.

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.

picksstr | 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. Note that channels in info['bads'] will be included if their names or indices are explicitly provided.

tminfloat

Time instant to start receiving buffers.

tmaxfloat

Time instant to stop receiving buffers.

buffer_sizeint

Size of each buffer in terms of number of samples.

start_receive_thread(x)[source]#

Fake API boilerplate.

Parameters:
xNone

Not used.

unregister_receive_callback(x)[source]#

Fake API boilerplate.

Parameters:
xNone

Not used.

Examples using mne_realtime.MockRtClient#

Compute real-time evoked responses using moving averages

Compute real-time evoked responses using moving averages

Decoding real-time data

Decoding real-time data

Real-time feedback for decoding :: Server Side

Real-time feedback for decoding :: Server Side

Real-time feedback for decoding :: Server Side

Real-time feedback for decoding :: Server Side