[FieldTrip] ft_definetrial() and ft_preprocessing()

Arjen Stolk a.stolk8 at gmail.com
Sat Mar 10 22:35:24 CET 2018


Hi Roberto,

ft_definetrial produces a cfg structure with a trl field that
fr_preprocessing uses to read in the data segments of interest.
conceptually, the order should be

cfg  = ft_definetrial(cfg)

% do not clear cfg

data = ft_preprocessing(cfg)

Best,
Arjen

On Sat, Mar 10, 2018 at 1:32 PM, Aykut Eken <ekenaykut at gmail.com> wrote:

> data_in                     =   ft_definetrial(cfg); %this will create a
> trl structure field, which is a list
> % of 3 columns, where every row describes a separate trial start, end and
> offset
> data_prej                   =   ft_preprocessing(cfg);
>
>
> As far as I see, you must give the “data_in” as a input to
> ft_preprocessing.
>
> Regards
>
> Aykut Eken, PhD
>
> Düzce University
> Faculty of Engineering
> Biomedical Engineering Department
>
> Düzce University, Konuralp Campus,
> 81620, Konuralp, Düzce, Turkey
>
> Tel: +905366777364 <+90%20536%20677%2073%2064>
> Office Tel: +90380542 11 00 /4546
> Mail address1: aykuteken at duzce.edu.tr
> Mail address2: ekenaykut at gmail.com
>
> On 11 Mar 2018, at 00:28, Roberto Petrosino <robpetrosino at gmail.com>
> wrote:
>
> Hi all,
>
> I am trying to preprocess my eeg raw data (from BrainVision amplifiers),
> but I am having troubles with error I can’t figure out how to fix. Here’s
> the code:
>
> clear;
> clc;
>
> data_path = ‘/.../raw/';
>
> %STEP 1: reading the data in
> cfg             =   [];
> cfg.dataset     =   [data_path ’subj1.vhdr'];
>
> %high-pass filter
> cfg.preproc.hpfilter    =   'yes';
> cfg.preproc.hpfiltord   =   2; %known bug for filtering; can be avoided
> by changing the order of the filter (2 is random)
> cfg.preproc.hpfreq      =   0.1; %in Hz
>
> %rereference
> cfg.preproc.reref       =   'yes';
> cfg.preproc.channel     =   'all';
> cfg.preproc.implicitref =   ''; %on-line reference is empty
> cfg.preproc.refchannel  =   {'M1', 'M2'}; %the channels we want to
> rereference our data against. In this
>                               %case, we will rereference against the
> linked mastoids
>
> %updating channel locations; %% MPI/DCCN versions of actiCAP?
> cfg.layout      =   '/Users/.../MATLAB/fieldtrip-master/template/
> layout/acticap-64ch-standard2.mat'; %the file we want to extract
> electrode coordinates from
>
> %demean
> cfg.deman       =   'yes';
> cfg.basewindow  =   [-.2 0];
>
> %STEP 2: defining trials and epoching
> cfg.trialdef.prestim        =   0.2;
> cfg.trialdef.poststim       =   1; % epochs will be -200 1000 ms
> cfg.trialdef.eventtype      =   'Stimulus';
> cfg.trialfun                =   'trialfun_congruency’; %customized
> function for the data
> data_in                     =   ft_definetrial(cfg); %this will create a
> trl structure field, which is a list
> % of 3 columns, where every row describes a separate trial start, end and
> offset
> data_prej                   =   ft_preprocessing(cfg);
>
>
>
> This is the error that pops up:
>
> Error using ft_preprocessing (line 387)
> you must call FT_DEFINETRIAL prior to FT_PREPROCESSING
>
>
> which is weird, since ft_definetrial() is called right *before *
> ft_preprocessing(). Does anyone know what the problem could be?
>
> Thanks,
> -Roberto
>
> ——
> Roberto Petrosino
> PhD student in Linguistics
> CT Institute from Brain and Cognitive Sciences
> University of Connecticut
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20180310/e0e7f531/attachment-0002.html>


More information about the fieldtrip mailing list