<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Dear Abhishek,<div class=""><br class=""></div><div class="">this error occurs if less time than specified in cfg.trialdef.poststim is left after the last event code. In other words, you are trying to cut out more trials with a fixed latency than you have data.</div><div class=""><br class=""></div><div class="">Please note that it appears as if your trial definition based on the EMG channel fails (see the „found 0 events“ notice and the rather large number of trials). I suggest going back to your trial function and checking whether everything works as intended there.</div><div class=""><br class=""></div><div class="">Good luck,</div><div class=""><br class=""></div><div class="">Julian</div><div class=""><br class=""></div><div class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">________________<br class="">Prof. Dr. Julian Keil<br class=""><br class="">Biological Psychology<br class="">Olshausenstrasse 62 - R. 306<br class="">24118 Kiel, Germany<br class=""><br class="">+49 - 0431 - 880 - 4872<br class=""><a href="http://www.biopsych.uni-kiel.de/en" class="">http://www.biopsych.uni-kiel.de/en</a><br class=""><br class="">Department of Psychiatry and Psychotherapy<br class="">Charité at St. Hedwig-Hospital<br class="">Große Hamburger Strasse 5-11<br class="">10115 Berlin, Germany<br class=""><br class="">+030 - 2311 - 1879<br class="">www.multisensorymind.com</div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">Am 20.07.2018 um 14:52 schrieb Abhishek Samal <<a href="mailto:007abhisheksamal@gmail.com" class="">007abhisheksamal@gmail.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Sir,<div class="">This is Abhishek. I am trying to analyse Motor Evoked field MEG data. I have been trying to use the EMG channel as the trial definition for the triggers of epoch creation. But when I use the script that is given in tutorial definition I am getting the following error. </div><div class=""><br class=""></div><div class="">The Input</div><div class=""><br class=""></div><div class=""><div class="">cfg = [];</div><div class="">cfg.dataset = 'preetham_lt_motor_raw_tsss_mc.fif';</div><div class="">cfg.trialdef.prestim = 1;</div><div class="">cfg.trialdef.poststim = 0.5;</div><div class="">cfg.trialfun = 'trialfun_emgdetect';</div><div class="">cfg = ft_definetrial(cfg);</div><div class="">data = ft_preprocessing(cfg);</div></div><div class=""><br class=""></div><div class="">The Error</div><div class=""><br class=""></div><div class=""><div class="">306 MEG channel locations transformed</div><div class="">Reading preetham_lt_motor_raw_tsss_mc.fif ...</div><div class="">Opening raw data file preetham_lt_motor_raw_tsss_mc.fif...</div><div class=""><span style="white-space:pre" class=""> </span>Range : 124000 ... 669999 = 62.000 ... 335.000 secs</div><div class="">Ready.</div><div class="">Reading 124000 ... 669999 = 62.000 ... 335.000 secs... [done]</div><div class="">found 0 events</div><div class="">created 210265 trials</div><div class="">the call to "ft_definetrial" took 528 seconds</div><div class=""><span style="white-space:pre" class=""> </span>306 MEG channel locations transformed</div><div class="">Reading preetham_lt_motor_raw_tsss_mc.fif ...</div><div class="">Opening raw data file preetham_lt_motor_raw_tsss_mc.fif...</div><div class=""><span style="white-space:pre" class=""> </span>Range : 124000 ... 669999 = 62.000 ... 335.000 secs</div><div class="">Ready.</div><div class="">processing channel { 'EOG001' 'ECG002' 'EEG001' 'EEG002' 'EEG003' 'EEG004' 'EEG005' 'EEG006' 'EEG007' 'EEG008' 'EEG009' 'EEG010' 'EEG011' 'EEG012' 'EEG013' 'EEG014' 'EEG015' 'EEG016' 'EEG017' 'EEG018' 'EEG019' 'EEG020' 'EEG021' 'EEG022' 'EEG023' 'EEG024' 'EEG025' 'EXCI' 'IASX+' 'IASX-' 'IASY+' 'IASY-' 'IASZ+' 'IASZ-' 'IAS_DX' 'IAS_DY' 'IAS_X' 'IAS_Y' 'IAS_Z' 'MEG0111' 'MEG0112' 'MEG0113' 'MEG0121' 'MEG0122' 'MEG0123' 'MEG0131' 'MEG0132' 'MEG0133' 'MEG0141' 'MEG0142' 'MEG0143' 'MEG0211' 'MEG0212' 'MEG0213' 'MEG0221' 'MEG0222' 'MEG0223' 'MEG0231' 'MEG0232' 'MEG0233' 'MEG0241' 'MEG0242' 'MEG0243' 'MEG0311' 'MEG0312' 'MEG0313' 'MEG0321' 'MEG0322' 'MEG0323' 'MEG0331' 'MEG0332' 'MEG0333' 'MEG0341' 'MEG0342' 'MEG0343' 'MEG0411' 'MEG0412' 'MEG0413' 'MEG0421' 'MEG0422' 'MEG0423' 'MEG0431' 'MEG0432' 'MEG0433' 'MEG0441' 'MEG0442' 'MEG0443' 'MEG0511' 'MEG0512' 'MEG0513' 'MEG0521' 'MEG0522' 'MEG0523' 'MEG0531' 'MEG0532' 'MEG0533' 'MEG0541' 'MEG0542' 'MEG0543' 'MEG0611' 'MEG0612' 'MEG0613' 'MEG0621' 'MEG0622' 'MEG0623' 'MEG0631' 'MEG0632' 'MEG0633' 'MEG0641' 'MEG0642' 'MEG0643' 'MEG0711' 'MEG0712' 'MEG0713' 'MEG0721' 'MEG0722' 'MEG0723' 'MEG0731' 'MEG0732' 'MEG0733' 'MEG0741' 'MEG0742' 'MEG0743' 'MEG0811' 'MEG0812' 'MEG0813' 'MEG0821' 'MEG0822' 'MEG0823' 'MEG0911' 'MEG0912' 'MEG0913' 'MEG0921' 'MEG0922' 'MEG0923' 'MEG0931' 'MEG0932' 'MEG0933' 'MEG0941' 'MEG0942' 'MEG0943' 'MEG1011' 'MEG1012' 'MEG1013' 'MEG1021' 'MEG1022' 'MEG1023' 'MEG1031' 'MEG1032' 'MEG1033' 'MEG1041' 'MEG1042' 'MEG1043' 'MEG1111' 'MEG1112' 'MEG1113' 'MEG1121' 'MEG1122' 'MEG1123' 'MEG1131' 'MEG1132' 'MEG1133' 'MEG1141' 'MEG1142' 'MEG1143' 'MEG1211' 'MEG1212' 'MEG1213' 'MEG1221' 'MEG1222' 'MEG1223' 'MEG1231' 'MEG1232' 'MEG1233' 'MEG1241' 'MEG1242' 'MEG1243' 'MEG1311' 'MEG1312' 'MEG1313' 'MEG1321' 'MEG1322' 'MEG1323' 'MEG1331' 'MEG1332' 'MEG1333' 'MEG1341' 'MEG1342' 'MEG1343' 'MEG1411' 'MEG1412' 'MEG1413' 'MEG1421' 'MEG1422' 'MEG1423' 'MEG1431' 'MEG1432' 'MEG1433' 'MEG1441' 'MEG1442' 'MEG1443' 'MEG1511' 'MEG1512' 'MEG1513' 'MEG1521' 'MEG1522' 'MEG1523' 'MEG1531' 'MEG1532' 'MEG1533' 'MEG1541' 'MEG1542' 'MEG1543' 'MEG1611' 'MEG1612' 'MEG1613' 'MEG1621' 'MEG1622' 'MEG1623' 'MEG1631' 'MEG1632' 'MEG1633' 'MEG1641' 'MEG1642' 'MEG1643' 'MEG1711' 'MEG1712' 'MEG1713' 'MEG1721' 'MEG1722' 'MEG1723' 'MEG1731' 'MEG1732' 'MEG1733' 'MEG1741' 'MEG1742' 'MEG1743' 'MEG1811' 'MEG1812' 'MEG1813' 'MEG1821' 'MEG1822' 'MEG1823' 'MEG1831' 'MEG1832' 'MEG1833' 'MEG1841' 'MEG1842' 'MEG1843' 'MEG1911' 'MEG1912' 'MEG1913' 'MEG1921' 'MEG1922' 'MEG1923' 'MEG1931' 'MEG1932' 'MEG1933' 'MEG1941' 'MEG1942' 'MEG1943' 'MEG2011' 'MEG2012' 'MEG2013' 'MEG2021' 'MEG2022' 'MEG2023' 'MEG2031' 'MEG2032' 'MEG2033' 'MEG2041' 'MEG2042' 'MEG2043' 'MEG2111' 'MEG2112' 'MEG2113' 'MEG2121' 'MEG2122' 'MEG2123' 'MEG2131' 'MEG2132' 'MEG2133' 'MEG2141' 'MEG2142' 'MEG2143' 'MEG2211' 'MEG2212' 'MEG2213' 'MEG2221' 'MEG2222' 'MEG2223' 'MEG2231' 'MEG2232' 'MEG2233' 'MEG2241' 'MEG2242' 'MEG2243' 'MEG2311' 'MEG2312' 'MEG2313' 'MEG2321' 'MEG2322' 'MEG2323' 'MEG2331' 'MEG2332' 'MEG2333' 'MEG2341' 'MEG2342' 'MEG2343' 'MEG2411' 'MEG2412' 'MEG2413' 'MEG2421' 'MEG2422' 'MEG2423' 'MEG2431' 'MEG2432' 'MEG2433' 'MEG2441' 'MEG2442' 'MEG2443' 'MEG2511' 'MEG2512' 'MEG2513' 'MEG2521' 'MEG2522' 'MEG2523' 'MEG2531' 'MEG2532' 'MEG2533' 'MEG2541' 'MEG2542' 'MEG2543' 'MEG2611' 'MEG2612' 'MEG2613' 'MEG2621' 'MEG2622' 'MEG2623' 'MEG2631' 'MEG2632' 'MEG2633' 'MEG2641' 'MEG2642' 'MEG2643' 'STI101' 'SYS201' 'CHPI001' 'CHPI002' 'CHPI003' 'CHPI004' 'CHPI005' 'CHPI006' 'CHPI007' 'CHPI008' 'CHPI009' }</div><div class="">reading and preprocessing</div><div class="">reading and preprocessing trial 1 from 210265</div><div class="">Reading 264027 ... 4792reading and preprocessing trial 2 from 210265</div><div class="">Reading 327742 ... 4802reading and preprocessing trial 3 from 210265</div></div><div class="">.</div><div class="">.</div><div class="">.</div><div class="">.</div><div class="">.</div><div class=""><div class="">Reading 635443 ... 66reading and preprocessing trial 116 from 210265</div><div class=""><font color="#ff0000" class="">Error using ft_read_data (line 225)</font></div><div class=""><font color="#ff0000" class="">cannot read data after the end of the file</font></div><div class=""><font color="#ff0000" class=""><br class=""></font></div><div class=""><font color="#ff0000" class="">Error in ft_preprocessing (line 582)</font></div><div class=""><font color="#ff0000" class=""> dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx,</font></div><div class=""><font color="#ff0000" class=""> 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat);</font></div></div><div class=""><font color="#ff0000" class=""><br class=""></font></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><font class="">I am new to fieldtrip. Please help me with the above error.</font></div><div class=""><font class="">Regards,</font></div><div class=""><font class="">Abhishek.</font></div></div>
_______________________________________________<br class="">fieldtrip mailing list<br class=""><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">https://doi.org/10.1371/journal.pcbi.1002202<br class=""></div></blockquote></div><br class=""></div></body></html>