[FieldTrip] Preprocessing data

Eelke Spaak eelke.spaak at donders.ru.nl
Thu Aug 28 09:27:44 CEST 2014


Hello Sarita,

It should not be a surprise that ft_definetrial does not find any
trials for your data, since you are using trigger codes specified for
the example dataset used in the tutorials. For reading continuous
data, try adding cfg.continuous = 'yes' for your call to
ft_preprocessing:

cfg = [];
cfg.continuous = 'yes';
cfg.dataset = 'fr041110a_nat1.plx'; %reading the data
data_org = ft_preprocessing(cfg);

If that does not work, there is an error in some of the low-level
functions for reading Plexon data, and I would not know how to help
you on that.

Hope this helps, best,
Eelke

On 27 August 2014 19:56, Tamang, Sarita <sarita.tamang at mssm.edu> wrote:
>
> Hello Everybody,
>
> I'm just starting to use FieldTrip and I have some very basic questions.
>
> I'm trying to analyze LFP data along with the spikes which is in Plexon
> format.
>
> For the preprocessing part I tried to read it as continuous data so I did
> clear all
> close all
>
> cfg = [];
>
> cfg.dataset = 'fr041110a_nat1.plx'; %reading the data
> data_org = ft_preprocessing(cfg);
>
> It gave me this error with 32 u int thing
>
> Error using timestamp_plexon (line 27)
> invalid input
>
> Error in ft_read_data (line 1064)
>       ts  = timestamp_plexon(tsl, tsh); % use helper function, this returns
> an uint64 array
>
> Error in ft_preprocessing (line 573)
>       dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample',
> begsample, 'endsample',
>       endsample, 'chanindx', rawindx, 'checkboundary',
> strcmp(cfg.continuous, 'no'),
>       'dataformat', cfg.dataformat);
>
> Error in LFP (line 8)
> data_org = ft_preprocessing(cfg);
>
>
>  I though this was probably due to reading it as continuous data or
> something I couldn't figure out so i tried using the example to see if the
> code runs
>
> clear all
> close all
>
> cfg = [];
>
> cfg.dataset = 'fr041110a_nat1.plx'; %reading the data
>
> hdr   = ft_read_header(cfg.dataset);
> event = ft_read_event(cfg.dataset);
>
>
> cfg.trialfun                = 'ft_trialfun_general'; % this is the default
> cfg.trialdef.eventtype      = 'Strobed'
> cfg.trialdef.eventvalue     = 35; % the value of the stimulus trigger for
> fully incongruent (FIC).
> cfg.trialdef.prestim        = 0.5; % in seconds
> cfg.trialdef.poststim       = 1; % in seconds
> cfg.channel    = {'AD01' 'AD03'};
> cfg.continuous = 'yes';
>
> trl = [];
>
> for i=1:length(event)
>   if strcmp(event(i).type, cfg.trialdef.eventtype)
>     % it is a trigger, see whether it has the right value
>     if ismember(event(i).value, cfg.trialdef.eventvalue)
>       % add this to the trl definition
>       begsample     = event(i).sample - cfg.trialdef.prestim*hdr.Fs;
>       endsample     = event(i).sample + cfg.trialdef.poststim*hdr.Fs - 1;
>       offset        = -cfg.trialdef.prestim*hdr.Fs;
>       trigger       = event(i).value; % remember the trigger (=condition)
> for each trial
>       trl(end+1, :) = [round([begsample endsample offset])  trigger];
>     end
>   end
> end
>
> cfg = ft_definetrial(cfg);
> data_org = ft_preprocessing(cfg);
>
> And I just used the trl loop from the example give in the website because i
> kept getting error saying the trial is not defined. However even after
> putting the code I still get the same error.
>
> Error using ft_definetrial (line 184)
> no trials were defined, see FT_DEFINETRIAL for help
>
> I don't know what else should I try because I'm having trouble just doing
> the preprocessing. Your help will be very much appreciated.
>
> Thank you,
> Sarita
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip



More information about the fieldtrip mailing list