<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:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Dear all,</p>
<p><br>
</p>
<p>My name is Nik Murphy and I work in the department of psychiatry at UTHealth Houston.  I'm currently experiencing some problems with the design of my MEG pipeline which seem to stem back to how the data is loaded.  </p>
<p><br>
</p>
<p>When I run the read header and data commands Fieldtrip begins the reading at an (I'm guessing) arbitrary point in the data.  I have a total of 452,999 samples (1000hz sampling rate) per run and a total of 54 trials.  When I load the data using brainstorm
 the total number of samples and events identified is correct, however, when I load the data using fieldtrip I consistently lose up to 100,000 samples from the beginning of my data.</p>
<p><br>
</p>
<p>My pipeline currently looks like this</p>
<p><br>
</p>
<p>hdr = ft_read_header(file);</p>
<p>data = ft_read_data(file);</p>
<p>events = ft_read_events(file);</p>
<p><br>
</p>
<p>cfg = [];</p>
<p>cfg.dataset = file;</p>
<p>cfg.channel = 'meg';</p>
<p>cfg.padding = 0;</p>
<p>cfg.padtype = 'data';</p>
<p>cfg.bpfilter = 'yes';</p>
<p>cfg.bpfreq = [0.1 100];</p>
<p>cfg.bsfilter = 'yes';</p>
<p>cfg.bsfreq = [59 61];</p>
<p>cfg.event = events;</p>
<p>cfg.trialdef.eventtype = 'STI101';</p>
<p>cfg.trialdef.prestim = .5;</p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;">cfg.trialdef.poststim= 6;</span><br>
</p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;"><span style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;">cfg.baselinewindow
 = [-.2 0];</span><br>
</span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;"><span style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;">cfg.demean
 = 'yes';</span></span></p>
<p><br>
</p>
<p>cfg = ft_defintetrial(cfg);</p>
<p>[data_new] = ft_preprocessing(cfg);</p>
<p><br>
</p>
<p>Any help with this would be greatly appreciated.</p>
<p><br>
</p>
<p>Many thanks</p>
<p><br>
</p>
<p>Regards</p>
<p><br>
</p>
<p>Nik</p>
<p><br>
</p>
<p>------------------</p>
<p>Dr Nicholas Murphy MSc BSc(HONS)</p>
<p>Nicholas.R.Murphy@uth.tmc.edu </p>
<p><br>
</p>
<p><br>
</p>
</div>
</body>
</html>