ERROR: Cannot handle other than dense or sparse matrices yet

I get an error when I’m trying to read a MEG recording file (.fif) in Brainstorm which says:


** Error: Line 232: fiff_read_tag (line 232)
** Cannot handle other than dense or sparse matrices yet
**
** Call stack:
** >fiff_read_tag.m at 232
** >fiff_open.m at 80
** >in_fopen_fif.m at 53
** >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 590
**


What does it mean? Is there something wrong with the data? How can I read the data, if at all, in that case?

Hi,

This most likely means your .fif file is corrupted. Can you open the recording in your acquisition software, or with MNE-Python?

Refer to this topic about a similar issue: Error in opening a fif file

Hi Martin,

The link you shared was helpful in the sense that I now understand the problem is transferring data from Linux to Windows. Fortunately, I could successfully transfer one of the four FIFF files that I have and could read it in Brainstorm. But the other three seem to not go through and keep on alternating between the previous error and the following one:

“** Error: Line 81: Reference to non-existent field ‘data’.
**
** Call stack:
** >fiff_open.m at 81
** >in_fopen_fif.m at 53
** >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 590”

I have tried formatting the pen drive multiple number of times, quick format and the longer way as well. I’m thinking of using email to transfer this time but before touching the files on the original computer again so that I don’t corrupt the files there also, I was wondering if you have some experience with this and can share it here.

Let me know what you think. Have a good day!

Can you please upload one of these files somewhere (eg. dropbox, google drive…) and share the link on this forum? (one file for each error)

Dear Francois,

Currently, I have all the 3 leftover files giving the second error. One of them I’ve uploaded with the link:
https://drive.google.com/open?id=1-tJxg1ylLyq8JLcqmKYB9DQuaiN5CQo3

I can get you a file with the first error as well by recopying again and again until I hit, if you want.

Thanks!

Response from Matti Hamalainen:

This file is weird. There is no tag directory where it is claimed to be. Furthermore, the content after a certain point does not make sense.

What is the history of the file, i.e., what were the processing steps taken?

Has the file been transferred between computers. Is it possible that the binary file was copied between Linux/Mac and Windows by assuming that it is a text file?

Yes, the file was transferred between Linux and Windows. But I don’t know about the copying as a text file part.

The history is: Acquisition and filtering (using the software Maxfilter) in the same Linux system and then transfer to Windows computer.

The file is not readable in its current state, this is not a problem related with Brainstorm.
The only solution I see is to try copying this file again.

Another message from Matti:

Do you still have the original Linux file? Is the size of the original file exactly 747563060 bytes on linux as reported by ls -l?

Hello again, I have some good news. So the file was getting corrupted because the safely remove option of the Linux PC is apparently broken. The solution to this problem was using the shell command sync. Now I have the file working on my Windows PC using Brainstorm.

Thank you all for taking a look at the problem and I hope I didn’t create an unnecessary hoopla around such a trivial problem.

Cheers!