minor problem loading fiff file

Jan Hirschmann Jan.Hirschmann at MED.UNI-DUESSELDORF.DE
Thu Dec 3 17:00:07 CET 2009


Hi,

this is my very first day with fieldtrip so there is some chance that the error is due to the user rather than to the code... Anyways, I had the following problem. I loaded a fif file using preprocessing which did not start a time 0 but later. I got an a error from the mne function fiff_read_raw_segment saying that there is no data in this range. I tried to define the trial differently setting trl in different ways but it didn't help so I looked at the code. Preprocessing calls the function read_header which said that nSamplesPre were -6031500 in my case. So I guess this means that there are samples missing between a trigger (I don"t know which) and the start of the file. Later in preprocessing the function read_data calls fiff_read_raw_segment with the following arguments:
read_data.m, line 691.m: dat = fiff_read_raw_segment(hdr.orig.raw,begsample+hdr.nSamplesPre-1,endsample+hdr.nSamplesPre-1,chanindx);
Thus fiff_read_raw_segment is launched with negative to and from values which finally causes the error. nSamples should have been subtracted here and not added (it is a negative integer).
I would suggest that in the future the call to the function should be only with arguments coming from the header file, i.e. from = hdr.orig.raw.last_samp and to = hdr.orig.raw.first_samp or that the pluses in the quoted line should be changed to minuses (which I did now in my version). However, I don't know if my file is strange (neg nSamplesPre) or if the code has a bug.

Hope this helps anyone

Best,

Jan


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20091203/5783076d/attachment.html>


More information about the fieldtrip mailing list