|
@@ -40,6 +40,8 @@ def raw_loader(data_root, session_paths:dict,
|
|
trial_duration = ori_epoch_length
|
|
trial_duration = ori_epoch_length
|
|
elif ori_epoch_length == 'varied':
|
|
elif ori_epoch_length == 'varied':
|
|
trial_duration = None
|
|
trial_duration = None
|
|
|
|
+ elif isinstance(ori_epoch_length, dict):
|
|
|
|
+ trial_duration = ori_epoch_length
|
|
else:
|
|
else:
|
|
raise ValueError(f'Unsupported epoch_length {ori_epoch_length}')
|
|
raise ValueError(f'Unsupported epoch_length {ori_epoch_length}')
|
|
events = reconstruct_events(events, fs,
|
|
events = reconstruct_events(events, fs,
|
|
@@ -88,7 +90,7 @@ def reconstruct_events(events, fs, trial_duration=5):
|
|
events_new[-1, 1] = events[-1, 0] - events_new[-1, 0]
|
|
events_new[-1, 1] = events[-1, 0] - events_new[-1, 0]
|
|
elif isinstance(trial_duration, dict):
|
|
elif isinstance(trial_duration, dict):
|
|
for e in trial_duration.keys():
|
|
for e in trial_duration.keys():
|
|
- events_new[events_new[:, 2] == e] = trial_duration[e]
|
|
|
|
|
|
+ events_new[events_new[:, 2] == e, 1] = int(trial_duration[e] * fs)
|
|
else:
|
|
else:
|
|
events_new[:, 1] = int(trial_duration * fs)
|
|
events_new[:, 1] = int(trial_duration * fs)
|
|
return events_new
|
|
return events_new
|