Error in opening a fif file

Hello Francois,
I got a raw data from neuromag. When I tryed to open it in brainstorm, it show an error. The detaile description of the error is in the attachment. I don’t know what’s wrong with my new data. Why i can’t open it? And i had some other raw data acquired from neuromag which i could open them. Waiting For Your Reply. Thank you!
Best regards,
Chen Ying

Hello,

This is an indication that the .fif file is corrupted. Maybe something went wrong with the acquisition or the transfer of this file.
Have you tried to open it with the Neuromag software?

Francois

Hello,
I can open it with Neuromag software. Is there any opening this file? Because i got many fif file that had eeror like this. And the other error described with"line 232:can not handle other than dense or sparse matrices yet". Thank you for your reply!

I transferred your message to Matti Hamalainen, the author of the FIF reader we use in Brainstorm, he might be able to help you further.

Thank you!

you should open an issue on github at:

please also share a script to replicate the problem as well as a small dataset.

Best,
Alex

Answer from Matti Hamalainen:

How was the fif file produced? This error means that the matrix coding value encoded in the data type field is not understandable.
Is it possible that the fif file was some damaged in transfer?

I am so sorry to reply you so late for I was bothered by some matters during this time. The data could opened with Neuromag sofeware aftered transfer. Is it still the problem that caused by transfer?
Best,
Chenying

Hi Chenying,

Can you upload your file somewhere (eg. dropbox) and then post the link to the file here?
I will ask Matti Hamalainen if he can have a look at it.

Francois

Hi Francois,
Here is the link to the fif file. https://www.dropbox.com/s/da67k8qlxqo93ak/Yefeng_phantom_little_raw.fif?dl=0
Best,
Chenying

Thanks.
However, I have a different error than the one you reported.
Is it the same file?
Are you working with a recent version of Brainstorm?


** 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


I forwarded the link to Matti, hopefully he can help you with this.

Francois

Matti's response after looking at the file:

As I suspected, the file has been damaged in some file transfer operation, probably between Windows and Unix-based systems. The structure of the file is broken.

FYI I cannot load the file with mne-python either.

how was this file generated?

Alex

Thanks. Are there some contingency factors that exist in the transfer opreration? For that i can open some othe fif datas after the same operation. Should i change the transfer media? The transfer media i used all the time is U drive.

Thanks. This file was generated with Neuromag and it was transfered from the acquisition system to U drive and then to the other computer system.

chenying

I’m sorry, I have no experience with issues in file transfers…
I’ll ask around, maybe someone has some advice for you.

“show_fiff” simply says "Could not read the tag directory (file probably damaged)!"
Brainstorm (using MNE matlab routines) reads the first several tags okay, then reads an obviously corrupt tag.

I examined the file a bit closer to see if I could spot an obvious problem. The file opens properly as ieee-be and the first several tags are read in correctly, so an obvious byte-swap has not occurred, i.e. this file did not become somehow a consistent Little Endian. I checked for “carriage return line feeds” (char(13) char(10)) but did not see a consistent pattern.

Chenying, suggest you check the exact size of the Neuromag file on the system before transferring to your “U” drive, then the size after transferrring. In my institute, I have several Windows, HP/UX, linux, and Mac systems, transferring via SMB, NFS, and other protocols, and I have no issues with moving FIF files around. My suspicion is still that a “text” converter got into your data stream and removed or added some carriage returns or line feeds (char(13) or char(10)) in an attempt to “fix” your file between systems.

Very kind of you. I will keep you suggestion in mind next. Thank you for you apply!

Chenying