Skip to content

Error using mne.read_evoked_fieldtrip #7293

Description

@Federica-2

I have a .mat file with averages for different conditions that were computed in Fieldtrip with FT_TIMELOCKANALYSIS. I am trying to use mne.read_evoked_fieldtrip, but when I run this code I get an error: KeyError: 'data'

#Sampling frequency
sfreq = 1000 
#Definition of channel types and names.
ch_types = ['eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eeg','eog','eog']
ch_names = ['FP1','FP2','F3', 'F4', 'C3', 'C4', 'P3', 'P4', 'O1', 'O2', 'F7', 'F8', 'T7', 'T8', 'P7', 'P8', 'FZ', 'CZ', 'PZ', 'OZ', 'FC1', 'FC2', 'CP1', 'CP2', 'FC5', 'FC6', 'CP5', 'CP6', 'FT9', 'FT10', 'TP9', 'TP10', 'F1', 'F2', 'C1', 'C2', 'P1', 'P2', 'AF3', 'AF4', 'FC3', 'FC4', 'CP3', 'CP4', 'PO3', 'PO4', 'F5', 'F6', 'C5', 'C6', 'P5', 'P6', 'AF7', 'AF8', 'FT7', 'FT8', 'TP7', 'TP8', 'PO7', 'PO8', 'FPZ', 'FCZ', 'CPZ', 'POZ', 'VEOG', 'HEOG']
#Creation of info object
info = mne.create_info(ch_names=ch_names, sfreq=sfreq, ch_types=ch_types)

file_path = r"D:/EEGdata/toFIELDTRIP";
filename = file_path + '/averages_for_ft.mat'

myepochs = mne.read_evoked_fieldtrip(filename, info)

I have also tried to specify the 'data_name', selecting only one of the conditions included in the 'averages_for_ft.mat', but again, I get an error: TypeError: list indices must be integers or slices, not str

myepochs = mne.read_evoked_fieldtrip(filename, info, data_name='pretargetID_ft')

I am using mne 0.20.dev0, and I am happy to send the 'averages_for_ft.mat' privately, if needed. Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions