[FieldTrip] Redefining trials, data is both raw and not raw...

Roemer van der Meij r.vandermeij at donders.ru.nl
Thu May 24 17:14:26 CEST 2012


Hey Tom,

It seems like you accidentally switched input arguments in your call to
redefine_trial:
* data=ft_redefinetrial(data,cfg);*

This should read:
*data=ft_redefinetrial(cfg,data);*

Cheers,
Roemer



On Thu, May 24, 2012 at 4:18 PM, Tom Marshall <t.marshall at fcdonders.ru.nl>wrote:

>  Hi 'trippers...
>
> So I'm having some trouble with the following pipeline:
>
> Import and filter continuous data using ft_preprocessing
> Create trial definition using ft_definetrial
> Apply trial definition to imported, filtered data using ft_redefinetrial
> (in case it helps, full code is below)
>
> When I call ft_redefinetrial, it fails with:-
> *??? Error using ==> ft_checkdata at 307
> This function requires raw data as input.
>
> Error in ==> ft_redefinetrial at 103
> data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback);*
>
> However, when I check my data myself using ft_checkdata...
> *ft_checkdata(data,'datatype','raw','feedback','yes')*
> ...the feedback it gives me is...
> *the input is raw data with 2 channels and 1 trials*
> ...which is exactly what I'd expect. (There are only two channels because
> I am just looking at my heog and veog data).
>
> It seems that my zenlike data are both raw and not raw, depending on
> whether ft_checkdata is called within ft_redefinetrial or by me. Any ideas
> why it could be failing in the former case?
>
> Best,
> Tom
>
> PS - full code here:-
> *
> % import eog data
>
>   veog_chan='UADC001';
>   heog_chan='UADC002';
>
>   cfg = [];
>   cfg.dataset        = full_file;
>   cfg.channel        = {heog_chan, veog_chan};
>   cfg.continuous     = 'yes';
>   data        = ft_preprocessing(cfg);
>
> % define trials
>
>   cfg                         = [];
>   cfg.dataset                 = meg_file;
>   cfg.trialdef.prestim        = -0.1; % ie 100ms after stim
>   cfg.trialdef.poststim       = 5; % in seconds
>   cfg.trialdef.behavdata     = fullfile(behav_file_dir, behav_file);
>
>   cfg.trialfun = 'trialfun_find_eog';
>
>   cfg = ft_definetrial(cfg);
>
> % apply trial def to continuous data
>
>   data=ft_redefinetrial(data,cfg);*
>
> --
> Tom Marshall, MSc.
> Neuronal Oscillations Group, Donders Centre for Cognitive Neuroimaging
> tel: +31(0)243668487
> email: t.marshall at fcdonders.ru.nl
> postal: PO Box 9101, 6500HB, Nijmegen, The Netherlands
> visiting: Kapittelweg 29, 6525EN, Nijmegen, The Netherlands
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at science.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>



-- 
Roemer van der Meij M.Sc.
PhD student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognition
P.O. Box 9104
6500 HE Nijmegen
The Netherlands
Tel: +31(0)24 3655932
E-mail: r.vandermeij at donders.ru.nl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120524/9efeec3f/attachment-0002.html>


More information about the fieldtrip mailing list