[FieldTrip] ft_definetrial() and ft_preprocessing()

Aykut Eken ekenaykut at gmail.com
Sat Mar 10 22:32:07 CET 2018


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20180311/1ed944b3/attachment.html>


More information about the fieldtrip mailing list