Unable to import neuromag raw file (.fif)

Hello,

Recently, I got an error message when I tried to import fif files. I also tested with the fif files which can be imported successfully last year, but Brainstorm showed me the same error message.

Here is the error message:

BST> Error: Could not find measurement data:
Unrecognized function or variable 'desc'.

99 coil definition templates available
0 MEG coil definitions and 0 EEG electrodes set up

** Error: Line 131: Reference to non-existent field 'meas_date'.
**
** Call stack:
** >in_fopen_fif.m at 131
** >in_fopen.m at 68
** >import_raw.m at 126
** >bst_call.m at 28
** >tree_callbacks.m>@(h,ev)bst_call(@import_raw,[],[],iSubject) at 636
**


It seems that the structure "meas_info" in fiff_read_meas_info.m does not provide enough information. for several variables like "dev_head_t" and "nchan".

Did I do anything wrong? How to import or review the fif file in Brainstorm?

Thanks!

Ling

Hi Ling,

First make sure you don't have anything saved in your Matlab path that does not belong to the Matlab installation itself. Having other toolboxes that shadow some basic Matlab functions is a common source of problems.

BST> Error: Could not find measurement data:
Unrecognized function or variable 'desc'.

This error is generated here:

This is related with an error generated in function brainstorm3/external/mne/matlab/fiff_read_meas_info.m, which is part of the external MNE-matlab library, which is maintained by a different group of developers.

There is most likely some error or unexpected data in you .fif file.
If you want help with this issue, please:

  • create a new issue on the mne-matlab github repository:
    Issues · mne-tools/mne-matlab · GitHub
  • in this new issue, include a link to download you faulty .fif file
  • post here the link to the github issue, so that we can follow the updates

** Error: Line 131: Reference to non-existent field 'meas_date'.
**
** Call stack:
** >in_fopen_fif.m at 131
** >in_fopen.m at 68
** >import_raw.m at 126
** >bst_call.m at 28
** >tree_callbacks.m>@(h,ev)bst_call(@import_raw,,,iSubject) at 636

I posted a fix for this issue:

Update Brainstorm and try again. It will not make your data readable, but will crash in a different, hopefully slightly more elegant, way.

Hi Francois,

Thank you very much for your quick response. I reported this issue to the github of MNE-matlab today.

I reinstalled the Brainstorm that I downloaded last September. Using this old version, I can successfully import fif files and do analysis. Hope that bug will be fixed soon!

Thanks again for your help.

Best,
Ling

Oooops, this was the result of a bug introduced in April only in Brainstorm... the only function of MNE-matlab that is modified in Brainstorm and not reported to the MNE repo.
Sorry about that...

It's fixed: https://github.com/brainstorm-tools/brainstorm3/commit/42bcca478305bd4a15d40b8a3fa3d1c872f2b5b0
Update Brainstorm and try again.

Hi Francois,

Thank you very much for your timely help!!

Ling