Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions hmp/io/mne_epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,28 +109,32 @@ def read_mne_epochs(
],
)

epoch_data = [
utils.hmp_data_format(
epochs.get_data(copy=False).astype(dtype),
epochs.info['sfreq'],
epochs.tmin,
epochs.tmax,
epochs=[int(x) for x in valid_epoch_index],
channel=epochs.ch_names,
metadata=epochs.metadata,
)
for epochs, valid_epoch_index in epochs_list
]

# Recover info from first epochs object
info = epochs_list[0][0].info
final_prep_kwargs = deepcopy(preprocessing_kwargs)
final_prep_kwargs['sfreq'] = epochs_list[0][0].info['sfreq']
final_prep_kwargs['lowpass'] = epochs_list[0][0].info['lowpass']
final_prep_kwargs['highpass'] = epochs_list[0][0].info['highpass']

epoch_data = []
while epochs_list:
epochs, valid_epoch_index = epochs_list.pop(0)
epoch_data.append(
utils.hmp_data_format(
epochs.get_data(copy=False).astype(dtype),
epochs.info['sfreq'],
epochs.tmin,
epochs.tmax,
epochs=[int(x) for x in valid_epoch_index],
channel=epochs.ch_names,
metadata=epochs.metadata,
)
)
del epochs, valid_epoch_index


epoch_data = utils._concat_recordings(epoch_data, recordings,
{}, final_prep_kwargs, subj_name)

return epoch_data, info

def _process_epoch_dataset(recording, montage, verbose,
Expand Down