<div dir="ltr">Dear all,<div>I know I asked this already twice, but I did not get the right answer yet and just cannot figure it out myself.</div><div style>So, I did cut my data in quite large trials using ft_define trial and logging it to the beginning of a slide. </div><div style><br></div><div style><p style="margin:0px;font-size:10px;font-family:Courier">cfg = [];</p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.dataset = name;</p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.trialfun = <span style="color:rgb(178,69,243)">'ft_trialfun_general'</span>; <span style="color:rgb(37,153,45)">% this is the default</span></p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.trialdef.eventtype = <span style="color:rgb(178,69,243)">'trigger'</span>;</p>
<p style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)"><span style="color:rgb(0,0,0)">cfg.trialdef.eventvalue = </span><span style="color:rgb(178,69,243)">'ceck'</span><span style="color:rgb(0,0,0)">; </span>% the value of the stimulus trigger </p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.trialdef.prestim = 0.216; <span style="color:rgb(37,153,45)">% in seconds</span></p>
<p style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)"><span style="color:rgb(0,0,0)">cfg.trialdef.poststim = 7.284; </span>% in seconds (max time of check slide)</p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg = ft_definetrial(cfg);</p>
<p style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"> </p>
<p style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">% cancel out training trials</p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.trl([1:4],:) = [];</p>
<p style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"> </p>
<p style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">%change timeline according to constant offset of 16 ms = 8 samples (because recorded with 500 hz)in</p>
<p style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">%structure trial - plus delay reported by EGE = 18 ms = 9 samples</p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.trl(:,3)=cfg.trl(:,3)-17</p>
<p style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"> </p>
<p style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"> </p><p style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"><br></p><p style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"><span style="font-family:arial;font-size:small"> Then I preprocessed these trials </span><br></p><p style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"><span style="font-family:arial;font-size:small"><br></span></p>
<p style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">%% preprocess data</p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.channel = <span style="color:rgb(178,69,243)">'all'</span>;</p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.preproc.detrend = <span style="color:rgb(178,69,243)">'yes'</span>;</p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.preproc.demean = <span style="color:rgb(178,69,243)">'yes'</span>;</p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.preproc.baselinewindow = [-0.1 0]</p>
<p style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">% <br></p>
<p style="margin:0px;font-size:10px;font-family:Courier">mov_data = ft_preprocessing(cfg);</p>
<p style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">% </p><div><p style="margin:0px;font-size:10px;font-family:Courier;color:rgb(178,69,243)"><span style="color:rgb(0,0,0)">save (strcat(sb,</span>'mov_data'<span style="color:rgb(0,0,0)">) , </span>'mov_data'<span style="color:rgb(0,0,0)">)</span></p>
<p style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"> </p>
<p style="margin:0px;font-size:12px;font-family:Courier;min-height:14px"><br></p></div><div style>Now I wanna cut out smaller pieces that are centered around another trigger - the response of the subject. I did not use this trigger at the beginning as then defining a baselinewindow is impossible (as the response is always happening at a different time).</div><div style><br></div><div style>I tried to just use ft_definetrial again, as I don't see a possibility to use ft_redefine trial:</div><div style><br></div><div style><p style="margin:0px;font-size:10px;font-family:Courier">cfg = []</p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.dataset= strcat(sb,<span style="color:rgb(178,69,243)">'mov_data.mat'</span>)<br></p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.trialdef.eventtype = <span style="color:rgb(178,69,243)">'trigger'</span>;<br></p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.trialdef.eventvalue = <span style="color:rgb(178,69,243)">'resp'</span></p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.trialdef.prestim = 0.75</p>
<p style="margin:0px;font-size:10px;font-family:Courier">cfg.trialdef.poststim = 0.75</p>
<p style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"> </p>
<p style="margin:0px;font-size:10px;font-family:Courier">mov_data_small = ft_definetrial(cfg)</p><p style="margin:0px;font-size:10px;font-family:Courier"><br></p><p style="margin:0px;font-size:10px;font-family:Courier">but I get the error message:</p><p style="margin:0px;font-size:10px;font-family:Courier"><br></p><p style="margin:0px;font-size:10px;font-family:Courier"></p><p style="margin:0px">Error using ft_read_header (line 1833)<br></p><p style="margin:0px">unsupported header format (matlab)</p><p style="margin:0px"><br></p><p style="margin:0px">Error in ft_trialfun_general (line 71)</p><p style="margin:0px">hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);</p><p style="margin:0px"><br></p><p style="margin:0px">Error in ft_definetrial (line 169)</p><p style="margin:0px"> [trl, event] = feval(cfg.trialfun, cfg);</p><p style="margin:0px"> </p><p></p>
<p style="margin:0px;font-size:12px;font-family:Courier;min-height:14px"><span style="font-family:arial;font-size:small"> I wonder if that is as the file produced by fieldtrip during the preprocessing is not one that is specified for ft_read_header - but how do I deal with this?</span><br></p><p style="margin:0px;font-size:12px;font-family:Courier;min-height:14px"><span style="font-family:arial;font-size:small"><br></span></p><p style="margin:0px;font-size:12px;font-family:Courier;min-height:14px"><span style="font-family:arial;font-size:small">Thanks a lot for your help</span></p><p style="margin:0px;font-size:12px;font-family:Courier;min-height:14px"><span style="font-family:arial;font-size:small"><br></span></p><p style="margin:0px;font-size:12px;font-family:Courier;min-height:14px"><span style="font-family:arial;font-size:small">Katrin</span></p></div></div></div>