<div dir="ltr">Hi Julian, <br>I will update the eeglab2fieldtrip function. Right now it is referencing it from the EEGlab folder (I have the latest one for that, so they must not have updated it). <br>As for ft.math, I looked at the documentation and cant figure anything out to fix it. I do use cfg.parameter = 'avg' which also exists in the data. Is there no way to do ft.math and also keep individual files? It works when I do it on data that does not have the individual field as well.<br>Here are the 2 files I am using and you can see the code I use to call the function below:<div><div><img src="cid:ii_k3hmy7v60" alt="image.png" width="562" height="365"><br></div></div><div><div><img src="cid:ii_k3hmyech1" alt="image.png" width="562" height="360"><br></div></div><div><div><img src="cid:ii_k3hmzivm2" alt="image.png" width="461" height="562"><br></div></div><div>The error I get is as follows: </div><div>Warning: timelock structure contains field with and without repetitions </div>selecting these fields that have repetitions: individual<br>removing these fields that do not have repetitions: avg, dof, var<br>Warning: timelock structure contains field with and without repetitions <br>selecting these fields that have repetitions: individual<br>removing these fields that do not have repetitions: avg, dof, var<br>Error using ft_math (line 144)<br>the requested parameter is not present in the data</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 27, 2019 at 1:05 AM Julian Keil <<a href="mailto:julian.keil@gmail.com">julian.keil@gmail.com</a>> wrote:<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;">Dear Amna,<div><br></div><div>First, I suggest you update your fieldtrip and EEGlab versions.</div><div>The line specified in your error does not match with the current eeglab2fieldtrip version (see here for the current implementation <a href="https://github.com/fieldtrip/fieldtrip/blob/master/external/eeglab/eeglab2fieldtrip.m" target="_blank">https://github.com/fieldtrip/fieldtrip/blob/master/external/eeglab/eeglab2fieldtrip.m</a>)</div><div><br></div><div>Second, what are you trying to compare with ft_math? Without posting your cfg structure, it’s not possible to see where you might be having issues. I suggest double checking the documentation (<a href="https://github.com/fieldtrip/fieldtrip/blob/master/ft_math.m" target="_blank">https://github.com/fieldtrip/fieldtrip/blob/master/ft_math.m</a>) to see how to call the function. The error you report could stem from either not specifying it at all (i.e. cfg.parameter is not in your cfg structure) or using one that is not present (i.e. using cfg.parameter = ‚avg‘, when ‚avg‘ is not in your data.</div><div><br></div><div>Hope that helps,</div><div><br></div><div>Julian<br><div><br><blockquote type="cite"><div>Am 27.11.2019 um 08:36 schrieb Amna Hyder <<a href="mailto:hyder.amna@gmail.com" target="_blank">hyder.amna@gmail.com</a>>:</div><br><div><div dir="ltr">Alternate possible solution!!<br>I thought I would add that the reason I am trying to import grand averaged ERPs from ERPlab is because I am running into some issues with the ft_timelockgrandaverage function when I use it on individual ERPs in fieldtrip. If I do cfg.keepindividual = 'yes' (which is required for cluster permutation analysis), the "avg" field is missing from the results. I only see the avg field if I specify "no" to keepindividual. I saw that someone had an issue with this in 2015 (<a href="https://mailman.science.ru.nl/pipermail/fieldtrip/2015-March/021876.html" target="_blank">https://mailman.science.ru.nl/pipermail/fieldtrip/2015-March/021876.html</a>). I have tried to combine the grand average ERP by doing it once with keepindividual='yes' and once with keepindividual='no'. See below:<div>    [avgERP2]          =  ft_timelockgrandaverage(cfg);<br>    avgERP.individual = avgERP2.individual; %avgERP has only the "avg" field and is missing "individual". The opposite is true for avgERP2<br>    avgERP.dimord = avgERP2.dimord;<br></div><div><br></div><div>All of this matters because when I try to apply ft.math on this data to compare conditions I get the following error:    'the requested parameter is not present in the data'. <br>It doesnt specify which field, so I am worried that there is some error in the way ft_timelockgrandaverage is working. <br>If you can help out with this issue, I wouldn't need to import already grand averaged ERP files from ERPlab.</div><div>Thanks so much for your prompt response.  </div><div>Amna</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 26, 2019 at 10:37 PM Julian Keil <<a href="mailto:julian.keil@gmail.com" target="_blank">julian.keil@gmail.com</a>> wrote:<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>Hi Amna,<div><br></div><div>is there a specific reason why you want to export the ERPs as ICA components?</div><div>eegla2fieldtrip has the option to use ’timelock’ as the second input option, which might be more sensible in your case.</div><div><br></div><div>Hope that helps,</div><div><br></div><div>Julian<br><div><div><br><blockquote type="cite"><div>Am 27.11.2019 um 02:23 schrieb Amna Hyder <<a href="mailto:hyder.amna@gmail.com" target="_blank">hyder.amna@gmail.com</a>>:</div><br><div><div dir="ltr">Hi, <div>I did all my preprocessing in EEGlab and ERPlab and wanted to put in my ERP files into fieldtrip to do the cluster permutation analysis on my ERPs. I tried using the function eeglab2fieldtrip as specified in the following link: <a href="https://mailman.science.ru.nl/pipermail/fieldtrip/2006-March/000441.html" target="_blank">https://mailman.science.ru.nl/pipermail/fieldtrip/2006-March/000441.html</a></div><div>I used the 'component analysis' option eg: <span style="white-space:pre-wrap">comp = eeglab2fieldtrip(ERP, 'componentanalysis').</span></div>However, I get the following error: <div>Reference to non-existent field 'icachansind'.<br>Error in eeglab2fieldtrip (line 54)<br> header.label   = { tmpchanlocs(EEG.icachansind).labels };</div><div><br></div><div>When I comment out these lines I run into another error:</div><div>Reference to non-existent field 'icaact'.<br><br>Error in eeglab2fieldtrip (line 119)<br>        if isempty(EEG.icaact)<br></div><div><br></div><div>It seems that this function requires ICA information in the EEGLAB ERP file, which isnt stored in the way that it is called. Can someone take a look into the function? Do I have to get the ERPs again in fieldtrip?</div><div>Amna</div></div>
_______________________________________________<br>fieldtrip mailing list<br><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br><a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br></div></blockquote></div><br></div></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>
_______________________________________________<br>fieldtrip mailing list<br><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br><a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br></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>