[FieldTrip] Redoing Brain Vision Analyzer in Field Trip

Herring, J.D. (Jim) j.herring at fcdonders.ru.nl
Thu Nov 13 13:16:25 CET 2014


Hi Gerome and Tzvetan,

Actually, you are referencing to the linked mastoids if EXG1 and EXG2 represent the mastoid channels as you specified them in cfg.refchannel. cfg.channel only specifies on what channels to apply the re-referencing on.

At a first glance I can see that in Fieldtrip you are applying a band-stop filter between 92 and 108 Hz, while in BVA you are  applying a band-stop filter at 100Hz with a bandwidth of 8. I am not that familiar with BVA but does that mean plus AND minus 8Hz or 8Hz around 100Hz, so 96 - 104Hz?

Also, in BVA you are applying a notch filter at 50Hz, in Fieldtrip you are applying a DFT filter at 50, 100 and 150Hz. A notch filter is a band-stop filter with a narrow band (usually 1-2Hz). DFT filters try to fit and subtract sinusoids at the specified frequency. To make it more similar to BVA I would suggest a band-stop filter between 49 and 51Hz.
Furthermore, in Fieldtrip you are applying Butterworth filters, is this the same filter-type applied in BVA? Additionally, in BVA your baseline is from -200 to -5ms, while in Fieldtrip you specify: cfg.baselinewindow = [-0.2 -0.05]; which is from -200 to -50ms.

I hope this can help you make the analysis more similar. Could you perhaps make a picture of a result that you find is different (e.g. ERPs calculated in Fieldtrip and BVA)?.  That could help identifying the exact problem if this did not help you.

Best,

Jim


From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Tzvetan Popov
Sent: donderdag 13 november 2014 11:14
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip


Dear Gerome,

one thing you could change is keep the reference the same in both cases. So far you are referencing the data against the mastoids in BVA and a common reference in FieldTrip.
This is a potential source of variance in the waveforms you'll get.

best
tzvetan



Hello All,

I would like some help to  replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-)


Thanks alot,
Gerome

Here is the brain vision sequence I am trying to replicate
  - Read in Data
 - Reference to mastiod
 - 100Hz Band rejection filter - bandwidth 8, slope 2
 - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct)
 - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct)
 - Notch Filter at 50Hz
 - Segmentation
 - Baseline Correction -200 ms to - 5 ms
 - Averaging segments



Here is my Field trip code:

%rereference all trials
cfg.reref = 'yes';
cfg.continuous = 'yes';

% reference what channels
cfg.channel = 'all';
%choose the reference channel
cfg.refchannel = {'EXG1' 'EXG2'};

% cfg.dataset = 'CVP1S1.bdf';
cfg.continuous = 'yes';
%

%bandfilter
cfg.bsfilter = 'yes';
cfg.bsfiltord = 2;
% cfg.bsfiltdir = 'onepass-zerophase';
cfg.bsfreq = [92 108];


%
%DFT
cfg.dftfilter = 'yes';

% IIR Filters
cfg.lpfilter = 'yes';
cfg.lpfilttype  = 'but';
% cfg.lpfiltdir = 'onepass-zerophase';
cfg.lpfreq  = 45;

cfg.hpfilter = 'yes';
cfg.hpfilttype  = 'but';
% cfg.hpfiltdir = 'onepass-zerophase';
cfg.hpfreq  = 0.53;

data = ft_preprocessing(cfg);


% Define Trial
cfg = [];
cfg.trialdef.eventtype  = 'STATUS';
cfg.dataset = eeg_file;
cfg.trialdef.eventvalue = 65522;
cfg.trialdef.prestim    = 0.2;
cfg.trialdef.poststim   = 0.3;
cfg = ft_definetrial(cfg);

data_vep = ft_redefinetrial(cfg, data);

% Baseline Correction
cfg = [];
cfg.demean = 'yes';
cfg.baselinewindow = [-0.2 -0.05];
data_vep = ft_preprocessing(cfg, data_vep);

%Averaging
cfg=[];
avg_data = ft_timelockanalysis(cfg, data_vep);


cfg.ylim = [-10 10];
cfg.channel = 'O1';

ft_singleplotER(cfg,avg_data);

--
_____________________
Gerome Manson PhD Student
Laboratoire de Neuroscience Cognitives- Aix Marseille Université
Perceptual Motor Behavior lab- University of Toronto
gerome.manson at utoronto.ca<mailto:gerome.manson at utoronto.ca>
gerome.manson at univ-amu.fr<mailto:gerome.manson at univ-amu.fr>
416-978-6109

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20141113/034b95e1/attachment-0002.html>


More information about the fieldtrip mailing list