<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:10pt;color:#000000;background-color:#FFFFFF;font-family:Arial,Helvetica,sans-serif;">
<p>Dear Fieldtrippers, </p>
<p><br>
</p>
<p>I am trying to use an LCMV beamformer to project 5 minutes of resting state data to the source level. During my data cleaning procedure I segment my continuous recording into 1 second "trials" and reject those with high amplitudes (using the ft_rejectvisual
 summary window). However I would then like to recombine these "trials" (to make 1 long "trial") before I do ft_timelockanalysis. Is there a way to do this whilst keeping the Fieldtrip structure intact . My current code is below:</p>
<p><br>
</p>
<p>% Segment into 1s chunks. Input is preprocessed variable called data.</p>
<p>cfg = [];</p>
<p>cfg.length = 1;</p>
<p>cfg.overlap = 0;</p>
<p>data_segmented = ft_redefinetrial(cfg,data);</p>
<p><br>
</p>
<p>% Reject deviant trials</p>
<p>cfg = [];</p>
<p>cfg.method = 'summary';</p>
<p>cfg.keepchannel = 'yes';</p>
<p>cfg.channel = 'MEGMAG';</p>
<p>clean1 = ft_rejectvisual(cfg,data_segmented);</p>
<p>% Now load this</p>
<p>cfg.channel = 'MEGGRAD';</p>
<p>clean2 = ft_rejectvisual(cfg,clean1);</p>
<p>data_clean_rs = clean2</p>
<p><br>
</p>
<p>clear clean1 clean2</p>
<p>save data_clean_rs data_clean_rs</p>
<p><br>
</p>
<p>% Now to recombine trials</p>
<p>data_clean_rs.trial = horzcat(data_clean_rs.trial{1,:}); % (This distorts the fieldtrip structure meaning ft_timelockanalysis doesn't work)</p>
<p><br>
</p>
<p><br>
</p>
<p>Many thanks, </p>
<p><br>
</p>
<p>Robert</p>
</div>
</body>
</html>