Problem with brainvision files

Marco Rotonda marco.rotonda at GMAIL.COM
Sat May 22 12:48:46 CEST 2010


I've tried to set a brackpoint but stoped at line 76 of read_brainvision_eeg

Maybe I exported them in a wrog way?

Marco

2010/5/21 Vladimir Litvak <v.litvak at ion.ucl.ac.uk>:
>  Hi Marco,
>
> I've done some changes recently trying to improve the recognition of
> Brainvision files. These might or might not be related to your
> problem. Could you perhaps do:
>
> dbstop if error
>
> and try to get some idea about why the error in filetype_check_header
> happens. There is some problem with opening the .eeg file but it's not
> clear what it is. I tried to use code similar to yours on a different
> brainvision dataset and there is no problem so it may be something
> that happens on your system for some reason. If you can't figure it
> out, send me an example dataset via yousendit.com and I'll try to look
> at it.
>
> Best,
>
> Vladimir
>
> On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda <marco.rotonda at gmail.com> wrote:
>> Hi fildtrippers!
>> After I've updated fieldtrip I got some problems reading brainvision files I didn't
>> got before.
>>
>> Here are the errors (the only differences in this script are ft_definetrial and
>> ft_preprocessing that before were only definetrial and preprocessing):
>>
>> cfg=[];
>> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr';
>> cfg.trialdef.eventtype='Stimulus';
>> cfg.trialdef.eventvalue='S 55';
>> cfg.trialdef.prestim=2;
>> cfg.trialdef.poststim=1.999;
>> cfg=ft_definetrial(cfg);
>> data=ft_preprocessing(cfg);
>>
>> Warning: no trialfun was specified, using
>> trialfun_general
>>> In ft_definetrial at 95
>> evaluating trialfunction 'trialfun_general'
>> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'
>> found 256 events
>> created 41 trials
>> processing channel
>> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' '
>> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' }
>> reading and preprocessing
>> reading and preprocessing trial 1 from 41
>> Warning: could not open
>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg
>>> In fileio\private\filetype_check_header at 44
>>  In ft_filetype at 390
>>  In ft_read_data at 205
>>  In ft_preprocessing at 466
>> Warning: could not open
>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg
>>> In fileio\private\filetype_check_header at 44
>>  In ft_filetype at 395
>>  In ft_read_data at 205
>>  In ft_preprocessing at 466
>> ??? Error using ==> fseek
>> Invalid file identifier.  Use fopen to generate a valid
>> file identifier.
>>
>> Error in ==> read_brainvision_eeg at 52
>>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1),
>>  'cof');
>>
>> Error in ==> ft_read_data at 442
>>    dat = read_brainvision_eeg(filename, hdr.orig,
>>    begsample, endsample);
>>
>> Error in ==> ft_preprocessing at 466
>>      dat = ft_read_data(cfg.datafile, 'header', hdr,
>>      'begsample', begsample, 'endsample', endsample,
>>      'chanindx', rawindx, 'checkboundary',
>>      strcmp(cfg.continuous, 'no'), 'dataformat',
>>      cfg.dataformat)
>>
>>
>> If I'm trying to use another file that is an average (so no trial to select) and I
>> treat as a continous file I got these other problems:
>>
>> cfg=[];
>> cfg.dataset='L001_AVG_FeedNegBL1.vhdr';
>> data=ft_preprocessing(cfg);
>> Warning: cannot determine number of samples for this
>> sub-fileformat
>>> In fileio\private\read_brainvision_vhdr at 95
>>  In ft_read_header at 367
>>  In ft_preprocessing at 294
>> processing channel
>> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3
>> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' }
>> reading and preprocessing
>> reading and preprocessing trial 1 from 1
>> Warning: could not open L001_AVG_FeedNegBL1.eeg
>>> In fileio\private\filetype_check_header at 44
>>  In ft_filetype at 390
>>  In ft_read_data at 205
>>  In ft_preprocessing at 466
>> Warning: could not open L001_AVG_FeedNegBL1.eeg
>>> In fileio\private\filetype_check_header at 44
>>  In ft_filetype at 395
>>  In ft_read_data at 205
>>  In ft_preprocessing at 466
>> ??? Error using ==> zeros
>> NaN and Inf not allowed.
>>
>> Error in ==> read_brainvision_eeg at 76
>>  dat = zeros(endsample-begsample+1,
>>  hdr.NumberOfChannels);
>>
>> Error in ==> ft_read_data at 442
>>    dat = read_brainvision_eeg(filename, hdr.orig,
>>    begsample, endsample);
>>
>> Error in ==> ft_preprocessing at 466
>>      dat = ft_read_data(cfg.datafile, 'header', hdr,
>>      'begsample', begsample, 'endsample', endsample,
>>      'chanindx', rawindx, 'checkboundary',
>>      strcmp(cfg.continuous, 'no'), 'dataformat',
>>      cfg.dataformat)
>>
>> do I miss something?
>>
>> regards
>>
>> Marco
>>
>> ----------------------------------
>> 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.
>>
>>
>
> ----------------------------------
> 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.
>

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



More information about the fieldtrip mailing list