[FieldTrip] Error in using EMG channel as trial definition

Julian Keil julian.keil at gmail.com
Fri Jul 20 15:00:04 CEST 2018


Dear Abhishek,

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.

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.

Good luck,

Julian

________________
Prof. Dr. Julian Keil

Biological Psychology
Olshausenstrasse 62 - R. 306
24118 Kiel, Germany

+49 - 0431 - 880 - 4872
http://www.biopsych.uni-kiel.de/en

Department of Psychiatry and Psychotherapy
Charité at St. Hedwig-Hospital
Große Hamburger Strasse 5-11
10115 Berlin, Germany

+030 - 2311 - 1879
www.multisensorymind.com

> Am 20.07.2018 um 14:52 schrieb Abhishek Samal <007abhisheksamal at gmail.com>:
> 
> Sir,
> 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.
> 
> The Input
> 
> cfg = [];
> cfg.dataset    = 'preetham_lt_motor_raw_tsss_mc.fif';
> cfg.trialdef.prestim        = 1;
> cfg.trialdef.poststim       = 0.5;
> cfg.trialfun  = 'trialfun_emgdetect';
> cfg           = ft_definetrial(cfg);
> data          = ft_preprocessing(cfg);
> 
> The Error
> 
> 306 MEG channel locations transformed
> Reading preetham_lt_motor_raw_tsss_mc.fif ...
> Opening raw data file preetham_lt_motor_raw_tsss_mc.fif...
> 	Range : 124000 ... 669999  =     62.000 ...   335.000 secs
> Ready.
> Reading 124000 ... 669999  =     62.000 ...   335.000 secs... [done]
> found 0 events
> created 210265 trials
> the call to "ft_definetrial" took 528 seconds
> 	306 MEG channel locations transformed
> Reading preetham_lt_motor_raw_tsss_mc.fif ...
> Opening raw data file preetham_lt_motor_raw_tsss_mc.fif...
> 	Range : 124000 ... 669999  =     62.000 ...   335.000 secs
> Ready.
> 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' }
> reading and preprocessing
> reading and preprocessing trial 1 from 210265
> Reading 264027 ... 4792reading and preprocessing trial 2 from 210265
> Reading 327742 ... 4802reading and preprocessing trial 3 from 210265
> .
> .
> .
> .
> .
> Reading 635443 ... 66reading and preprocessing trial 116 from 210265
> Error using ft_read_data (line 225)
> cannot read data after the end of the file
> 
> Error in ft_preprocessing (line 582)
>       dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx,
>       'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat);
> 
> 
> 
> I am new to fieldtrip. Please help me with the above error.
> Regards,
> Abhishek.
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20180720/b9fcd270/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20180720/b9fcd270/attachment-0002.sig>


More information about the fieldtrip mailing list