[FieldTrip] Invalid file identifier when reading file with fiff_read_raw_segment

Xan McPherson amcphers at uw.edu
Wed Apr 3 01:07:37 CEST 2024


Hello everyone,

My name is Alexandria McPherson and I am a PhD student working with the
physics behind MEG at the Institute for Learning and Brain Sciences,
University of Washington, Seattle. Currently, I am focusing on ways to
modify the signal space separation method for use with on-scalp MEG sensor
systems.

 I am running into some issues using FieldTrip to load raw data from .fif
files. Specifically, I have been working with the example file
"sample-audvis-raw.fif" which is provided by MNE-Python in their
"MEG/sample" data folder. Here is a Dropbox link to the data:
https://www.dropbox.com/scl/fo/gffle6d9ppa47pkmes8gj/h?rlkey=8swrsnlyiz61si5ycrxg5x9c2&dl=0
.
I am first loading in the "info" structure, here is the code I am running:
 filename =
"C:/Users/.../mne_data/MNE-sample-data/MEG/sample/sample_audvis_raw.fifinfo
= fiff_read_meas_info(filename);[raw] =
fiff_setup_read_raw(filename);[data,times]
= fiff_read_raw_segment(raw);

I am able to read the "info" and "raw" objects, but when I run
"fiff_read_raw_segment", I recieve the following error:
Error using fseek. Invalid file identifier. Use fopen to generate a valid
file identifier.
Error in fiff_read_tag (line 83)
fseek(fid,pos,'bof');
Error in fiff_read_raw_segment (line 152)
tag = fiff_read_tag(raw.fid,this.ent.pos);

I also get this same error with other MEG "fif" files. Would you have any
ideas as to what might be the issue?

Thanks!
Alexandria
Physics PhD Student | I-LABS | University of Washington
B.S. Engineering Physics | Colorado School of Mines
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240402/287ffe2a/attachment.htm>


More information about the fieldtrip mailing list