Hello,
I have a problem linked to the conversion of files into .fif format in MNE, in a way that these are readable in fieldtrip.
My original files are .csv tables with samples as rows and 8 EEG channels and one trigger as columns.
I read these and transform them to .fif format using the following code:
chan_names = list(data_csv.columns.values)
channel_types = ['eeg'] * 8 + ['stim']
dValues = data_csv.values.T
infor = create_info(channel_names, sfreq, channel_types)
eeg_raw = RawArray(dValues, info=infor, verbose=False)
eeg_raw.notch_filter(...)
eeg_raw.filter(...)
eeg_raw.save(eeg_raw.fif)
The issue arises when I’m trying to process those files in the Matlab “ERP PCA Toolkit” from Joseph Dien (ERP PCA Toolkit Activity, The ERP PCA Toolkit: an open source program for advanced statistical analysis of event-related potential data - PubMed). This toolbox can read in files in .fif format, but when it tries, it throws an error in the fieldtrip ‘fiff_open’ function. In exchange with the developer I learned that fiff_open.m wants the .fif file to start with the value 100 (FIFF.FIFF_FILE_ID) whereas MNE’s “RawArray” is not generating the file with 100 as the starting value, but instead 1296127052 (too long to be one of the .fif header codes).
So I’m wondering, is this some issue with how I convert these files, or with the MNE code itself?
- MNE version: e.g. 1.0.3
- fieldtrip version: 20221223
- operating system: Windows 10