Could not find any EEG data in the 0 files found in mff

@drammock @alexrockhill

I was trying to read an mff file and I came across this error

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 raw= mne.io.read_raw_egi(fname)

File <decorator-gen-238>:12, in read_raw_egi(input_fname, eog, misc, include, exclude, preload, channel_naming, verbose)

File ~/anaconda3/envs/mne/lib/python3.9/site-packages/mne/io/egi/egi.py:156, in read_raw_egi(input_fname, eog, misc, include, exclude, preload, channel_naming, verbose)
    154 input_fname = str(input_fname)
    155 if input_fname.endswith('.mff'):
--> 156     return _read_raw_egi_mff(input_fname, eog, misc, include,
    157                              exclude, preload, channel_naming, verbose)
    158 return RawEGI(input_fname, eog, misc, include, exclude, preload,
    159               channel_naming, verbose)

File <decorator-gen-235>:12, in _read_raw_egi_mff(input_fname, eog, misc, include, exclude, preload, channel_naming, verbose)

File ~/anaconda3/envs/mne/lib/python3.9/site-packages/mne/io/egi/egimff.py:379, in _read_raw_egi_mff(input_fname, eog, misc, include, exclude, preload, channel_naming, verbose)
    318 @verbose
    319 def _read_raw_egi_mff(input_fname, eog=None, misc=None,
    320                       include=None, exclude=None, preload=False,
    321                       channel_naming='E%d', verbose=None):
    322     """Read EGI mff binary as raw object.
    323 
    324     .. note:: This function attempts to create a synthetic trigger channel.
   (...)
    377     .. versionadded:: 0.15.0
    378     """
--> 379     return RawMff(input_fname, eog, misc, include, exclude,
    380                   preload, channel_naming, verbose)

File <decorator-gen-236>:12, in __init__(self, input_fname, eog, misc, include, exclude, preload, channel_naming, verbose)

File ~/anaconda3/envs/mne/lib/python3.9/site-packages/mne/io/egi/egimff.py:394, in RawMff.__init__(self, input_fname, eog, misc, include, exclude, preload, channel_naming, verbose)
    391 input_fname = _check_fname(input_fname, 'read', True, 'input_fname',
    392                            need_dir=True)
    393 logger.info('Reading EGI MFF Header from %s...' % input_fname)
--> 394 egi_info = _read_header(input_fname)
    395 if eog is None:
    396     eog = []

File ~/anaconda3/envs/mne/lib/python3.9/site-packages/mne/io/egi/egimff.py:210, in _read_header(input_fname)
    197 def _read_header(input_fname):
    198     """Obtain the headers from the file package mff.
    199 
    200     Parameters
   (...)
    208         Main headers set.
    209     """
--> 210     mff_hdr = _read_mff_header(input_fname)
    211     with open(input_fname + '/signal1.bin', 'rb') as fid:
    212         version = np.fromfile(fid, np.int32, 1)[0]

File ~/anaconda3/envs/mne/lib/python3.9/site-packages/mne/io/egi/egimff.py:27, in _read_mff_header(filepath)
     25 def _read_mff_header(filepath):
     26     """Read mff header."""
---> 27     all_files = _get_signalfname(filepath)
     28     eeg_file = all_files['EEG']['signal']
     29     eeg_info_file = all_files['EEG']['info']

File ~/anaconda3/envs/mne/lib/python3.9/site-packages/mne/io/egi/general.py:146, in _get_signalfname(filepath)
    142     all_files[signal_type] = {
    143         'signal': 'signal{}.bin'.format(bin_num_str),
    144         'info': infofile}
    145 if 'EEG' not in all_files:
--> 146     raise FileNotFoundError(
    147         'Could not find any EEG data in the %d file%s found in %s:\n%s'
    148         % (len(infofiles), _pl(infofiles), filepath, '\n'.join(infofiles)))
    149 return all_files

FileNotFoundError: Could not find any EEG data in the 0 files found in /home/subrat/Downloads/PhantomRebuilt_HDEEG256_04172022_L6_20220417_165929.mff:

I was able to open it with Brainstorm. Previously, I came across a similar problem which I could solve by changing the event file name in my mff file.

Can anyone of you look into this problem to see what is causing the issue? Currently I am opening the file by converting it into edf by using brainstorm.

The google drive link is attached below.

https://drive.google.com/drive/folders/1WxTKsXAJLVDybEo49MVrkJJyK5DDc_A8?usp=sharing

I don’t really know anything about mmf files, maybe someone who has worked with that date type can help, sorry.

Hi @Subrat_Bastola I read in one of your files using mne.io.read_raw_egi() and it seems to load okay for me.

I am using MNE-Python 1.0.2, the latest stable release.

If you downloaded the file from a server (or google drive), due to the nature of the .mff file format, .mff files can be corrupted during the download process if you don’t zip the file first (it has happened to me many times). Although I am not sure if this is what caused your issue, it is only a guess.
Hope this helps.

3 Likes