Back to the main page.

Bug 1027 - Error when running artf rejection with unequal trial lengths

Status CLOSED FIXED
Reported 2011-10-10 13:25:00 +0200
Modified 2011-10-26 16:22:05 +0200
Product: FieldTrip
Component: preproc
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P1 normal
Assigned to: Jan-Mathijs Schoffelen
URL:
Tags:
Depends on:
Blocks:
See also:

Niels Kloosterman - 2011-10-10 13:25:01 +0200

Hello, When I run artifact rejection on my continuous dataset containing variable trial lengths, I get the error listed below. My guess is that ft_artifact_zvalue does not handle the variable trial lengths correctly, so plotting separate trials goes wrong. I have attached a data struct with 3 trials, so you can try it for yourself. With previous versions of ft it worked. Index exceeds matrix dimensions. Error in ==> ft_artifact_zvalue>redraw_cb at 803 plot(xval(selpad), data(selpad), 'color', [0.5 0.5 1], 'displayname', 'line1'); Error in ==> ft_artifact_zvalue at 358 redraw_cb(h); Error in ==> MIBexp_artefact_EOG at 25 [cfg, artf_eog] = ft_artifact_zvalue(cfg); Error in ==> MIBexp_preproc at 17 MIBexp_artefact_EOG %%%% Automatic Artifact detection scripts Error in ==> MIBexp_preproc_peersetup at 77 cellfun(@MIBexp_preproc, cfg1, cfg2, cfg3, outputfile); I tried running artifact rejection with the parameters below. It does plot the run overview, but gives the error when plotting single trials (data and z-scored). I use cfg1.padding = 1. % MIBexp_artefact_EOG disp('Looking for EOG artifacts . . .') cfg = []; cfg.datafile = cfg1.datafile; cfg.headerfile = cfg1.datafile; cfg.headerformat = cfg1.headerformat; cfg.trl = data.cfg.trl; % cfg.padding = 1; cfg.continuous = 'yes'; % cutoff and padding % select a set of channels on which to run the artifact detection (e.g. can be 'MEG') cfg.artfctdef.zvalue.channel = 'EOG'; cfg.artfctdef.zvalue.cutoff = 4; cfg.artfctdef.zvalue.trlpadding = 0.5*cfg1.padding; cfg.artfctdef.zvalue.artpadding = 0.1*cfg1.padding; cfg.artfctdef.zvalue.fltpadding = 0.1*cfg1.padding; % algorithmic parameters cfg.artfctdef.zvalue.bpfilter = 'yes'; cfg.artfctdef.zvalue.bpfilttype = 'but'; cfg.artfctdef.zvalue.bpfreq = [1 15]; cfg.artfctdef.zvalue.bpfiltord = 4; cfg.artfctdef.zvalue.hilbert = 'yes'; % feedback cfg.artfctdef.zvalue.interactive = 'yes'; [cfg, artf_eog] = ft_artifact_zvalue(cfg); I hope you can figure it out! Thanks for your help, Niels


Niels Kloosterman - 2011-10-10 13:28:05 +0200

Adding attachment does not work. Let me know if you need it and if the server allows uploading attachments.


Jan-Mathijs Schoffelen - 2011-10-19 15:34:40 +0200

Hi Niels, The data seems to have gone missing; could you upload it again?


Niels Kloosterman - 2011-10-19 18:15:39 +0200

Created attachment 167 data containing 3 trials of unequal length. causes art rejection to crash


Jan-Mathijs Schoffelen - 2011-10-20 09:38:29 +0200

Hi Niels, Thanks for posting the bug and adding the data. I think I fixed it now. The fix should be available on google code soon, or otherwise in tonight's release. Could you verify this? Fixed with release 4529


Niels Kloosterman - 2011-10-20 12:40:22 +0200

Hey Jan-Mathijs, It works, thanks. One other note: I get a huge list of warnings now when I try to read in my neuromag 306 channel data. Not sure if this is critical. Please let me know if you need raw data, one fif file is 1GB so we might need an ftp server for this. Cheers, Niels >> cfg.dataset='AK121011_run1_tsss.fif' cfg = dataset: 'AK121011_run1_tsss.fif' >> data=ft_preprocessing(cfg) 306 MEG channel locations transformed Opening raw data file AK121011_run1_tsss.fif... Range : 9920 ... 786159 = 7.936 ... 628.927 secs Ready. Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 71 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 166 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 208 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 217 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 226 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 262 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 277 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 315 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 319 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 323 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 340 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 349 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 358 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 362 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 Warning: could be Yokogawa system > In fileio/private/ft_senstype at 271 In ft_chantype at 366 In ft_chantype at 413 In fileio/private/ft_datatype_sens at 124 In ft_read_header at 1445 In ft_preprocessing at 360 processing channel { 'MEG0113' 'MEG0112' 'MEG0111' 'MEG0122' 'MEG0123' 'MEG0121' 'MEG0132' 'MEG0133' 'MEG0131' 'MEG0143' 'MEG0142' 'MEG0141' 'MEG0213' 'MEG0212' 'MEG0211' 'MEG0222' 'MEG0223' 'MEG0221' 'MEG0232' 'MEG0233' 'MEG0231' 'MEG0243' 'MEG0242' 'MEG0241' 'MEG0313' 'MEG0312' 'MEG0311' 'MEG0322' 'MEG0323' 'MEG0321' 'MEG0333' 'MEG0332' 'MEG0331' 'MEG0343' 'MEG0342' 'MEG0341' 'MEG0413' 'MEG0412' 'MEG0411' 'MEG0422' 'MEG0423' 'MEG0421' 'MEG0432' 'MEG0433' 'MEG0431' 'MEG0443' 'MEG0442' 'MEG0441' 'MEG0513' 'MEG0512' 'MEG0511' 'MEG0523' 'MEG0522' 'MEG0521' 'MEG0532' 'MEG0533' 'MEG0531' 'MEG0542' 'MEG0543' 'MEG0541' 'MEG0613' 'MEG0612' 'MEG0611' 'MEG0622' 'MEG0623' 'MEG0621' 'MEG0633' 'MEG0632' 'MEG0631' 'MEG0642' 'MEG0643' 'MEG0641' 'MEG0713' 'MEG0712' 'MEG0711' 'MEG0723' 'MEG0722' 'MEG0721' 'MEG0733' 'MEG0732' 'MEG0731' 'MEG0743' 'MEG0742' 'MEG0741' 'MEG0813' 'MEG0812' 'MEG0811' 'MEG0822' 'MEG0823' 'MEG0821' 'MEG0913' 'MEG0912' 'MEG0911' 'MEG0923' 'MEG0922' 'MEG0921' 'MEG0932' 'MEG0933' 'MEG0931' 'MEG0942' 'MEG0943' 'MEG0941' 'MEG1013' 'MEG1012' 'MEG1011' 'MEG1023' 'MEG1022' 'MEG1021' 'MEG1032' 'MEG1033' 'MEG1031' 'MEG1043' 'MEG1042' 'MEG1041' 'MEG1112' 'MEG1113' 'MEG1111' 'MEG1123' 'MEG1122' 'MEG1121' 'MEG1133' 'MEG1132' 'MEG1131' 'MEG1142' 'MEG1143' 'MEG1141' 'MEG1213' 'MEG1212' 'MEG1211' 'MEG1223' 'MEG1222' 'MEG1221' 'MEG1232' 'MEG1233' 'MEG1231' 'MEG1243' 'MEG1242' 'MEG1241' 'MEG1312' 'MEG1313' 'MEG1311' 'MEG1323' 'MEG1322' 'MEG1321' 'MEG1333' 'MEG1332' 'MEG1331' 'MEG1342' 'MEG1343' 'MEG1341' 'MEG1412' 'MEG1413' 'MEG1411' 'MEG1423' 'MEG1422' 'MEG1421' 'MEG1433' 'MEG1432' 'MEG1431' 'MEG1442' 'MEG1443' 'MEG1441' 'MEG1512' 'MEG1513' 'MEG1511' 'MEG1522' 'MEG1523' 'MEG1521' 'MEG1533' 'MEG1532' 'MEG1531' 'MEG1543' 'MEG1542' 'MEG1541' 'MEG1613' 'MEG1612' 'MEG1611' 'MEG1622' 'MEG1623' 'MEG1621' 'MEG1632' 'MEG1633' 'MEG1631' 'MEG1643' 'MEG1642' 'MEG1641' 'MEG1713' 'MEG1712' 'MEG1711' 'MEG1722' 'MEG1723' 'MEG1721' 'MEG1732' 'MEG1733' 'MEG1731' 'MEG1743' 'MEG1742' 'MEG1741' 'MEG1813' 'MEG1812' 'MEG1811' 'MEG1822' 'MEG1823' 'MEG1821' 'MEG1832' 'MEG1833' 'MEG1831' 'MEG1843' 'MEG1842' 'MEG1841' 'MEG1912' 'MEG1913' 'MEG1911' 'MEG1923' 'MEG1922' 'MEG1921' 'MEG1932' 'MEG1933' 'MEG1931' 'MEG1943' 'MEG1942' 'MEG1941' 'MEG2013' 'MEG2012' 'MEG2011' 'MEG2023' 'MEG2022' 'MEG2021' 'MEG2032' 'MEG2033' 'MEG2031' 'MEG2042' 'MEG2043' 'MEG2041' 'MEG2113' 'MEG2112' 'MEG2111' 'MEG2122' 'MEG2123' 'MEG2121' 'MEG2133' 'MEG2132' 'MEG2131' 'MEG2143' 'MEG2142' 'MEG2141' 'MEG2212' 'MEG2213' 'MEG2211' 'MEG2223' 'MEG2222' 'MEG2221' 'MEG2233' 'MEG2232' 'MEG2231' 'MEG2242' 'MEG2243' 'MEG2241' 'MEG2312' 'MEG2313' 'MEG2311' 'MEG2323' 'MEG2322' 'MEG2321' 'MEG2332' 'MEG2333' 'MEG2331' 'MEG2343' 'MEG2342' 'MEG2341' 'MEG2412' 'MEG2413' 'MEG2411' 'MEG2423' 'MEG2422' 'MEG2421' 'MEG2433' 'MEG2432' 'MEG2431' 'MEG2442' 'MEG2443' 'MEG2441' 'MEG2512' 'MEG2513' 'MEG2511' 'MEG2522' 'MEG2523' 'MEG2521' 'MEG2533' 'MEG2532' 'MEG2531' 'MEG2543' 'MEG2542' 'MEG2541' 'MEG2612' 'MEG2613' 'MEG2611' 'MEG2623' 'MEG2622' 'MEG2621' 'MEG2633' 'MEG2632' 'MEG2631' 'MEG2642' 'MEG2643' 'MEG2641' 'STI001' 'STI002' 'STI003' 'STI004' 'STI005' 'STI006' 'STI007' 'STI008' 'STI009' 'STI010' 'STI011' 'STI012' 'STI013' 'STI014' 'STI015' 'STI016' 'EOG061' 'ECG062' 'MISC001' 'STI101' 'STI201' 'STI301' } reading and preprocessing reading and preprocessing trial 1 from 1 Reading 9920 ... 786159 = 7.936 ... 628.927 secs... [done] the call to "ft_preprocessing" took 19 seconds and an estimated 1949 MB data = hdr: [1x1 struct] label: {328x1 cell} time: {[1x776240 double]} trial: {[328x776240 double]} fsample: 1250 sampleinfo: [1 776240] grad: [1x1 struct] cfg: [1x1 struct]


Jan-Mathijs Schoffelen - 2011-10-20 12:43:48 +0200

Yeah, I saw it too. For the time being it is not critical. You can switch it off by setting warning off before the function call.