[FieldTrip] Reading in .bdf data into FieldTrip
Xavier Vrijdag
x.vrijdag at auckland.ac.nz
Thu Sep 30 01:41:13 CEST 2021
Hello Kyla,
I think your code contains two errors. 1) The addpath function is not needed, just the text string. 2) there is a file separator missing between the path and filename. So end your path with a “/”.
Your code line would look like this: filepath = '/Users/kmgm/Library/Application Support/MathWorks/MATLAB Add-Ons/Collections/FieldTrip/';
Is this the folder where your datafile (Pilot010.bdf) is stored?
Regards,
Xavier
From: Kyla Malayang <kylam at mun.ca>
Date: Thursday, 30 September 2021 at 1:21 AM
To: Xavier Vrijdag <x.vrijdag at auckland.ac.nz>
Subject: Re: [FieldTrip] Reading in .bdf data into FieldTrip
Hi Xavier,
Thank you so much. I ran that code, but it gave an error stating:
Error in ft_preprocessing (line 404)
hdr = ft_read_header(cfg.headerfile, headeropt{:});
This was the code I ran:
%----------------------------------------------------------Before beginning
clear variables
filepath = addpath('/Users/kmgm/Library/Application Support/MathWorks/MATLAB Add-Ons/Collections/FieldTrip');
filename = 'Pilot010.bdf';
cfg.dataset = [filepath filename];
cfg.channel = 1:64;
cfg.reref = 'yes';
cfg.refchannel = 'EEG'; %Average of all EEG channels
cfg.demean = 'yes';
cfg.detrend = 'yes';
data = ft_preprocessing(cfg);
When I run the ft_read_header function, it tells me the header is "unknown". Can you please help me with this?
On Wed, Sep 29, 2021 at 1:21 AM Xavier Vrijdag via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:
Hello Kyla,
I use a BioSemi system as well. I import my bdf data with higher-level Fieldtrip functions, see the example below. You can also find additional information on the fieldtrip website: https://www.fieldtriptoolbox.org/getting_started/biosemi/<https://www.fieldtriptoolbox.org/getting_started/biosemi/>
cfg.dataset = [filepath filename];
cfg.channel = 1:34;
cfg.reref = 'yes';
cfg.refchannel = 'EEG'; % average of all EEG channels
cfg.demean = 'yes';
cfg.detrend = 'yes';
data = ft_preprocessing(cfg);
regards,
Xavier
Xavier Vrijdag, MSc
Research fellow
Department of Anaesthesiology │ School of Medicine
Faculty of Medical & Health Sciences │ The University of Auckland
Private Bag 92019 │ Auckland 1142 │ New Zealand
M +64 21 0230 4558
E x.vrijdag at auckland.ac.nz<mailto:x.vrijdag at auckland.ac.nz>
[FMHS Logo]
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Kyla Malayang via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Reply to: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Date: Wednesday, 29 September 2021 at 2:30 AM
To: "fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>" <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Cc: Kyla Malayang <kylam at mun.ca<mailto:kylam at mun.ca>>
Subject: [FieldTrip] Reading in .bdf data into FieldTrip
Hello,
I'm trying to load data with a .bdf file extension into Matlab. I have the FieldTrip installed and added to my path. However, when I try reading in the data using the ft_read_data function, I receive an error message of "unsupported header format "unknown".
The data are continuous EEG data recorded from BioSemi in ActiView.
--
Sincerely,
Kyla
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
https://doi.org/10.1371/journal.pcbi.1002202<https://doi.org/10.1371/journal.pcbi.1002202>
--
Sincerely,
Kyla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210929/ff24b7da/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 22258 bytes
Desc: image001.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210929/ff24b7da/attachment.png>
More information about the fieldtrip
mailing list