本文整理汇总了Python中mne.realtime.MockRtClient.get_event_data方法的典型用法代码示例。如果您正苦于以下问题:Python MockRtClient.get_event_data方法的具体用法?Python MockRtClient.get_event_data怎么用?Python MockRtClient.get_event_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.realtime.MockRtClient
的用法示例。
在下文中一共展示了MockRtClient.get_event_data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_event_data
# 需要导入模块: from mne.realtime import MockRtClient [as 别名]
# 或者: from mne.realtime.MockRtClient import get_event_data [as 别名]
def test_get_event_data():
"""Test emulation of realtime data stream."""
event_id, tmin, tmax = 2, -0.1, 0.3
epochs = Epochs(
raw, events, event_id=event_id, tmin=tmin, tmax=tmax, picks=picks, baseline=None, preload=True, proj=False
)
data = epochs.get_data()[0, :, :]
rt_client = MockRtClient(raw)
rt_data = rt_client.get_event_data(event_id=event_id, tmin=tmin, tmax=tmax, picks=picks, stim_channel="STI 014")
assert_array_equal(rt_data, data)
示例2: test_get_event_data
# 需要导入模块: from mne.realtime import MockRtClient [as 别名]
# 或者: from mne.realtime.MockRtClient import get_event_data [as 别名]
def test_get_event_data():
"""Test emulation of realtime data stream."""
raw = mne.io.Raw(raw_fname, preload=True, verbose=False)
picks = mne.pick_types(raw.info, meg="grad", eeg=False, eog=True, stim=True, exclude=raw.info["bads"])
event_id, tmin, tmax = 2, -0.1, 0.3
epochs = Epochs(
raw, events, event_id=event_id, tmin=tmin, tmax=tmax, picks=picks, baseline=None, preload=True, proj=False
)
data = epochs.get_data()[0, :, :]
rt_client = MockRtClient(raw)
rt_data = rt_client.get_event_data(event_id=event_id, tmin=tmin, tmax=tmax, picks=picks, stim_channel="STI 014")
assert_array_equal(rt_data, data)
示例3: range
# 需要导入模块: from mne.realtime import MockRtClient [as 别名]
# 或者: from mne.realtime.MockRtClient import get_event_data [as 别名]
# Just some initially decided events to be simulated
# Rest will decided on the fly
ev_list = [4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4]
score_c1, score_c2, score_x = [], [], []
for ii in range(50):
# Tell the stim_client about the next stimuli
stim_server.add_trigger(ev_list[ii])
# Collecting data
if ii == 0:
X = rt_client.get_event_data(
event_id=ev_list[ii], tmin=-0.2, tmax=0.5, picks=picks, stim_channel="STI 014"
)[None, ...]
y = ev_list[ii]
else:
X_temp = rt_client.get_event_data(
event_id=ev_list[ii], tmin=-0.2, tmax=0.5, picks=picks, stim_channel="STI 014"
)
X_temp = X_temp[np.newaxis, ...]
X = np.concatenate((X, X_temp), axis=0)
time.sleep(1) # simulating the isi
y = np.append(y, ev_list[ii])
# Start decoding after collecting sufficient data
if ii >= 10: