<div dir="ltr">Dear Jan-Mathijs, <br><br>Thank you for your e-mail. <br><div><br></div><div>I am using data from the output of ICA (.mat data). Here is my <b>cfg for visual artifact</b>: </div><div><br></div><div><font face="monospace">cgf = [];<br>cfg.preproc.demean = 'yes'; <br>cfg.prepoc.baselinewindow  = [-0.2 0]; <br>data_process=ft_preprocessing(cfg,data_process );<br><br>cgf = [];<br>cfg.method   = 'trial';<br>cfg.ylim =  60; <br>visual_cleaned = ft_rejectvisual(cfg,data_process);<br><br>cgf = [];<br>cfg.method   = 'channel';<br>cfg.alim =  50 ; %why this value? <br>%cfg.eogscale = 5e-8;<br>vc_data = ft_rejectvisual(cfg,visual_cleaned);</font><br></div><div><font face="monospace"><br></font></div><b>For ICA: </b><div><font face="monospace">cfg = [];<br>%cfg.channel = 1:64;<br>cfg.method = 'runica';<br>cfg.demean = 'yes';<br>ica_cleaned = ft_componentanalysis(cfg, vc_data);<br><br>% %Save ICA data <br>outfile=strcat(save_dir,'/',infile,'_', sti,'.mat')<br>save(outfile, 'ica_cleaned', '-v7.3')<br></font></div><div><br></div><div><b>Before ICA, I did the following processing steps:</b></div><div>cfg = [];<br><font face="monospace">cfg.dataset=infile;   % infile: data.seg<br>cfg.trialfun = 'ft_trialfun_general'; % this is the default<br>cfg.trialdef.eventtype  = 'Stimulus'; %Event type: e.g. Stimulus, response, STATUS<br>cfg.trialdef.eventvalue = {stimulus}; </font></div><div><font face="monospace"><br>cfg.trialdef.prestim    = 2; %latency in seconds  <br>cfg.trialdef.poststim   = 2; %latency in seconds <br>cfg=ft_definetrial(cfg);<br><br>% Processing AOC, AMC and MC data<br>cfg.channel = [1:69]; %discard channels not used<br>cfg.preproc.reref = 'yes';<br>cfg.preproc.refchannel = {'M1' 'M2'}; %avg mastoids<br>cfg.continuous = 'no'; <br>cfg.preproc.detrend = 'no';<br>%Baseline correction<br>cfg.preproc.demean = 'yes'; <br>cfg.prepoc.baselinewindow  = [-0.2 0]; <br>%Filtering<br>cfg.preproc.lpfilter = 'yes';<br>cfg.preproc.hpfilter = 'yes';<br>cfg.preproc.lpfreq = 100;<br>cfg.preproc.hpfreq = 1;<br>data_process=ft_preprocessing(cfg);</font><br></div><div><br></div><div>Can the error be associated with the fact that I am using non-continuous data? </div><div><br></div><div>I am using BrainVision Format, that is, .seg, .vmrk and vhdr data. </div><div><br></div><div>Thank you,</div><div>Stay safe,</div><div>Helena Pereira</div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Schoffelen, J.M. (Jan Mathijs) <<a href="mailto:jan.schoffelen@donders.ru.nl">jan.schoffelen@donders.ru.nl</a>> escreveu no dia terça, 2/06/2020 à(s) 09:28:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div style="overflow-wrap: break-word;">
<font size="4">Hi Helena,</font>
<div><font size="4"><br>
</font></div>
<div><font size="4">ft_rejectvisual is not deprecated. As a matter of fact, there has been some recent updates to this function, to make its behavior more robust. Since these changes have passed our internal tests, the new version has made
 it into the release version. Unfortunately, this seems to cause you some problems. As of yet, it is not clear whether this now is a genuine bug, or a feature of an inconsistency in your data, which only surfaces now. In order to be able to confirm your problem,
 you’d need to give a bit more detail about what you have been doing. Important details to include are some characteristics of the data, and a specification of the cfg that you used as an input to ft_rejectvisual. Also, you couuld try and diagnose the problem
 a bit more yourself by using the matlab debugger, which you can use to investigate why the variable info.cfg.ylim seems to have an unexpected number of elements (as the error message suggests).</font></div>
<div><font size="4"><br>
</font></div>
<div><font size="4"><br>
</font></div>
<div><font size="4">Best wishes,</font></div>
<div><font size="4"><br>
</font></div>
<div><font size="4">Jan-Mathijs</font></div>
<div><font size="4"><br>
</font></div>
<div><font size="4"> <br>
</font>
<div><br>
<blockquote type="cite">
<div>On 1 Jun 2020, at 20:51, Helena Pereira <<a href="mailto:hri.pereira@campus.fct.unl.pt" target="_blank">hri.pereira@campus.fct.unl.pt</a>> wrote:</div>
<br>
<div>
<div style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Dear all,<u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<u></u> <u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
I am analysing data from EEG subjects. To remove artifacts, I used a code that was computed using the ft_rejectvisual function of 20191019 fieldtrip version. However, when the fieldtrip was uptaded to the 20200521, this error appeared:<span> </span><u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<u></u> <u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Index exceeds the number of array elements (1).<u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<u></u> <u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Error in rejectvisual_trial>redraw (line 274)<u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
  ymax = info.cfg.ylim(2);<u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<u></u> <u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Error in rejectvisual_trial (line 96)<u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
  redraw(h);<u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<u></u> <u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Error in ft_rejectvisual (line 230)<u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
    [chansel, trlsel, cfg] = rejectvisual_trial(cfg,<u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
    tmpdata);<u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<u></u> <u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Is ft_rejectvisual function deprecated? How can I solve this error? The version 20191019 is no longer available at the FTP server, but I know it works well because I tested the code with that old version.<u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<u></u> <u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Thanks in advance,<span> </span><u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Best regards,<span> </span><u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Helena Pereira<u></u><u></u></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<u></u> <u></u></div>
</div>
<span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">_______________________________________________</span><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">fieldtrip
 mailing list</span><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a></div>
</blockquote>
</div>
<br>
</div>
</div>

_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>