[FieldTrip] Reading brainvision data: problem with channel's resolution

Ricardo Moura ricardoojm at gmail.com
Fri Feb 15 11:52:32 CET 2013

Hi Jan-Mathijs,
Thank you very much for your reply.

I found a mistake of mine in the data export. I didn't export it as ".dat"
binary file. I was exporting it as text file. Now, the same script I sent
in the first email is working in the sense that the program is properly
recognizing the samples in the data (the 797740 sampling points, instead of
only 80). Nevertheless, I still have a problem with the channel's

I saw that when exporting the binary files as ieee 32-bit floating, the
resolution of the channels is not recorded in the header. So I changed it
to the "32-bit signed integer" format, and now I have the resolution (in
the header, it appears as "Ch1=AF3,NewRef,4.1322874E-08,┬ÁV", under "Channel
Infos"), but then, another error message is returned:

??? Error using ==> read_brainvision_eeg at 155
unsupported sub-fileformat

I tried to export the data in different ways, but the error persists.

I am afraid there is something else wrong in the way I am exporting the
data. Could you tell me how I must export the data, or just show me where I
can find more detailed specifications about it? I searched through the site
and mailing list, and haven't find further information about it.

Thanks again,
Best wishes,

On 14 February 2013 16:12, Ricardo Moura <ricardoojm at gmail.com> wrote:

> Dear all,
> I am very new to fieldtrip and I am experiencing a problem when reading
> brainvision data. I searched in the mailinglist archives but I didn't find
> anything that could help me. In case there is information about it
> somewhere else, I would appreciate if someone can send me a reference.
> The problem is the following. I am tring to read continuous data from the
> brainvision analyzer (already preprocessed), but I always have an error
> which seems to be due to a problem with the identification of the channels
> resolution. I exported the data from brainvision in ".dat" vectorized
> format, and I am loading it first with the ft_preprocessing command.
> Here is the command I am running to load it:
> cfg = [];
> cfg.dataset = 'Raw Data Inspection.dat';
> eegData = ft_preprocessing(cfg)
> Then the following warning message is returned, for each of the 56
> channels I have in the data:
> Warning: Unknown resolution for channel 55 in Raw Data Inspection.vhdr!
> > In fileio\private\read_brainvision_vhdr at 50
>   In ft_read_header at 381
>   In ft_preprocessing at 394
> And at the end, I have the following error:
> ??? Index exceeds matrix dimensions.
> Error in ==> read_brainvision_eeg at 150
>     dat(chan,:) = tmp(begsample:endsample);
> Error in ==> ft_read_data at 400
>     dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample,
> chanindx);
> Error in ==> ft_preprocessing at 573
>       dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample',
> begsample, 'endsample', endsample, 'chanindx', rawindx,
>       'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat',
> cfg.dataformat)
> Interestingly, when I read the header file with the "hdr =
> ft_read_header('Raw Data Inspection.vhdr')", it says that I have only 80
> samples in the data. When checking the header file with the notepad, it
> says that there are actualy 797740 data points.
> So, am I realling doing it right?
> Thank you very much in advance, and best wishes,
> Ricardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130215/d4c99a33/attachment-0002.html>

More information about the fieldtrip mailing list