Hey Tom,<br><br>It seems like you accidentally switched input arguments in your call to redefine_trial:<br><b> data=ft_redefinetrial(data,cfg);</b><span class="HOEnZb"><font color="#888888"><br></font></span><br>This should read:<br>
<b>data=ft_redefinetrial(cfg,data);</b><span class="HOEnZb"><font color="#888888"><br></font></span><br>Cheers,<br>Roemer<br><span class="HOEnZb"><font color="#888888"><br><br></font></span><br><div class="gmail_quote">On Thu, May 24, 2012 at 4:18 PM, Tom Marshall <span dir="ltr"><<a href="mailto:t.marshall@fcdonders.ru.nl" target="_blank">t.marshall@fcdonders.ru.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi 'trippers...<br>
<br>
So I'm having some trouble with the following pipeline:<br>
<br>
Import and filter continuous data using ft_preprocessing<br>
Create trial definition using ft_definetrial<br>
Apply trial definition to imported, filtered data using
ft_redefinetrial<br>
(in case it helps, full code is below)<br>
<br>
When I call ft_redefinetrial, it fails with:-<br>
<b>??? Error using ==> ft_checkdata at 307<br>
This function requires raw data as input.<br>
<br>
Error in ==> ft_redefinetrial at 103<br>
data = ft_checkdata(data, 'datatype', 'raw', 'feedback',
cfg.feedback);</b><br>
<br>
However, when I check my data myself using ft_checkdata...<br>
<b>ft_checkdata(data,'datatype','raw','feedback','yes')</b><br>
...the feedback it gives me is...<br>
<b>the input is raw data with 2 channels and 1 trials</b><br>
...which is exactly what I'd expect. (There are only two channels
because I am just looking at my heog and veog data).<br>
<br>
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?<br>
<br>
Best,<br>
Tom <br>
<br>
PS - full code here:-<br>
<b><br>
% import eog data<br>
<br>
veog_chan='UADC001';<br>
heog_chan='UADC002';<br>
<br>
cfg = [];<br>
cfg.dataset = full_file;<br>
cfg.channel = {heog_chan, veog_chan};<br>
cfg.continuous = 'yes';<br>
data = ft_preprocessing(cfg);<br>
<br>
% define trials<br>
<br>
cfg = [];<br>
cfg.dataset = meg_file;<br>
cfg.trialdef.prestim = -0.1; % ie 100ms after stim<br>
cfg.trialdef.poststim = 5; % in seconds<br>
cfg.trialdef.behavdata = fullfile(behav_file_dir,
behav_file);<br>
<br>
cfg.trialfun = 'trialfun_find_eog';<br>
<br>
cfg = ft_definetrial(cfg);<br>
<br>
% apply trial def to continuous data<br>
<br>
data=ft_redefinetrial(data,cfg);</b><span class="HOEnZb"><font color="#888888"><br>
<pre cols="72">--
Tom Marshall, MSc.
Neuronal Oscillations Group, Donders Centre for Cognitive Neuroimaging
tel: <a href="tel:%2B31%280%29243668487" value="+31243668487" target="_blank">+31(0)243668487</a>
email: <a href="mailto:t.marshall@fcdonders.ru.nl" target="_blank">t.marshall@fcdonders.ru.nl</a>
postal: PO Box 9101, 6500HB, Nijmegen, The Netherlands
visiting: Kapittelweg 29, 6525EN, Nijmegen, The Netherlands</pre>
</font></span></div>
<br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br><br clear="all"><br>-- <br><font size="3"><font color="darkblue"><font face="calibri">Roemer
van der Meij M.Sc.<br>
PhD student<br>
Donders Institute for Brain, Cognition and Behaviour<br>
Centre for Cognition<br>
P.O. Box 9104<br>
6500 HE Nijmegen<br>
The Netherlands<br>
Tel: +31(0)24 3655932<br>
E-mail: <a href="mailto:r.vandermeij@donders.ru.nl" target="_blank">r.vandermeij@donders.ru.nl</a></font></font></font><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%">
</div><br>