<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="ltr">
<div dir="ltr">
<div class="gmail_default" style="font-family:georgia,serif">Thank you for your help Poppy! I seem to have a bit of a start here. I do have one question after reading a few other tutorials, and of course after getting an error message.<br>
</div>
<div class="gmail_default" style="font-family:georgia,serif"><br>
</div>
<div class="gmail_default" style="font-family:georgia,serif">It is my understanding is that definetrial will have to be completed for each trial type. For example, if I have 2 trial types (threat and neutral), I would have to define and then analyze each of
 these trial types separately. Is this correct?</div>
<div class="gmail_default" style="font-family:georgia,serif"><br>
</div>
<div class="gmail_default" style="font-family:georgia,serif">Next, for my error. My script reads as this so far:</div>
<div class="gmail_default" style="font-family:georgia,serif">cfg = [];<br>
cfg.dataset = 'C:\Users\danie\OneDrive\LEAP\ALE\EEG\5 AD\003.set';<br>
hdr = ft_read_header( 'C:\Users\danie\OneDrive\LEAP\ALE\EEG\5 AD\003.set' ); <br>
data = ft_read_data( 'C:\Users\danie\OneDrive\LEAP\ALE\EEG\5 AD\003.set', 'header', hdr );
<br>
events = ft_read_event( 'C:\Users\danie\OneDrive\LEAP\ALE\EEG\5 AD\003.set', 'header', hdr );<br>
<br>
cfg = [];<br>
cfg.trialdef.eventtype = 'PNU'; <br>
cfg.trialdef.eventvalue = 'B3(5)'; <br>
cfg.trialdef.prestim    = '-.2'; <br>
cfg.trialdef.poststim   = '3';    <br>
cfg = ft_definetrial(cfg); <br>
MypreProcData = ft_preprocessing(cfg);<br>
cfg.outputfile  = 'C:\Users\danie\OneDrive\LEAP\ALE\EEG\5c Preprocessing\003PNU.mat';<br>
</div>
<div class="gmail_default" style="font-family:georgia,serif"><br>
</div>
<div class="gmail_default" style="font-family:georgia,serif">The error I receive is:</div>
<div class="gmail_default" style="font-family:georgia,serif">Warning: no trialfun was specified, using<br>
ft_trialfun_general <br>
 In ft_definetrial at line 145<br>
<br>
evaluating trialfunction 'ft_trialfun_general'<br>
</div>
<div class="gmail_default" style="font-family:georgia,serif">Reference to non-existent field<br>
'headerfile'.<br>
<br>
Error in ft_trialfun_general (line 83)<br>
  ft_info('reading the header from<br>
  ''%s''\n', cfg.headerfile);<br>
<br>
Error in ft_definetrial (line 185)<br>
    [trl, event] = feval(cfg.trialfun,<br>
    cfg);<br>
<br>
Error in ScriptDevelopment (line 21)<br>
cfg = ft_definetrial(cfg);</div>
<div class="gmail_default" style="font-family:georgia,serif"><br>
</div>
<div class="gmail_default" style="font-family:georgia,serif"> Would there be ideas on what I am doing wrong?</div>
<div class="gmail_default" style="font-family:georgia,serif">Thank you again!</div>
<div class="gmail_default" style="font-family:georgia,serif">Danielle</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, May 20, 2019 at 6:42 PM Poppy Watson <<a href="mailto:popwatson@hotmail.com">popwatson@hotmail.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 lang="EN-AU">
<div class="gmail-m_-7721624280067849926WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hi Danielle<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">You can use your existing bins – you need to define your import file and the event types and  values.<u></u><u></u></span></p>
<pre><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">So first find out what those are using the code provided on the wiki page below e.g., something like<u></u><u></u></span></pre>
<pre><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></pre>
<pre>events = ft_read_event( EEGLABFILE, 'header', hdr );<u></u><u></u></pre>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Then you need to import your data to field trip using something like the following – note that this was data pre-processed and imported from BVA but steps
 will be similar:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:13pt;font-family:"Courier New";color:black">cfg = [];</span><span style="font-family:"Courier New""><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:13pt;font-family:"Courier New";color:black">cfg.dataset = filename;</span><span style="font-family:"Courier New""><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:13pt;font-family:"Courier New";color:black">cfg.trialdef.eventtype =
</span><span style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'Stimulus'</span><span style="font-size:13pt;font-family:"Courier New";color:black">; %[this will change depending on what your event types actually are]</span><span style="font-family:"Courier New""><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:13pt;font-family:"Courier New";color:black">cfg.trialdef.eventvalue =
</span><span style="font-size:13pt;font-family:"Courier New";color:rgb(160,32,240)">'S120’; %[that was mine, obviously yours will be different]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:13pt;font-family:"Courier New";color:black">cfg.trialdef.prestim    = 2;
</span><span style="font-size:13pt;font-family:"Courier New";color:forestgreen">%seconds - import as much around your event marker as you have/need
</span><span style="font-family:"Courier New""><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:13pt;font-family:"Courier New";color:black">cfg.trialdef.poststim   = 0.5; %ditto             <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:13pt;font-family:"Courier New";color:black">cfg = ft_definetrial(cfg); %[this is just using the standard trialfun but you might want to write your own]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:13pt;font-family:"Courier New";color:black">MypreProcData = ft_preprocessing(cfg);</span><span style="font-family:"Courier New""><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hope this helps.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(117,123,128)">---------------------------------------------------------------------</span></b><span style="font-family:Calibri,sans-serif;color:black"><br>
</span><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(117,123,128)">Poppy Watson<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif"> fieldtrip <<a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank">fieldtrip-bounces@science.ru.nl</a>>
<b>On Behalf Of </b>Taylor, Danielle<br>
<b>Sent:</b> Tuesday, 21 May 2019 6:25 AM<br>
<b>To:</b> FieldTrip discussion list <<a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a>><br>
<b>Subject:</b> Re: [FieldTrip] Beginner in FieldTrip: EEGLab to FieldTrip + SSVEP Analysis<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">Thank you very much Dr. Delorme,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">I appreciate the information you shared, and have referenced the EEGLab website for converting data to FieldTrip.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">However, I am still left with a couple questions after referencing the website. Is it okay to import data to FieldTrip that has already been assigned bins in EEGLab or would I need to import the data
 from back a few steps and then assign bins using EEGLab? In addition, I am still unclear on how to evaluate specific windows for evaluating the SSVEP (400-700 ms, 700-1000, 1000-2000 and 2000-3000).<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">Again, apologies if these questions appear ill-informed. I have read several posts from the forum and watched/read several tutorials, and I am not quite sure how to begin.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">Thank you again!<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Georgia,serif;color:black">Danielle Taylor, M.S.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Georgia,serif;color:black">Doctoral Candidate,</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Georgia,serif;color:black">Clinical Psychology</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Georgia,serif;color:black">Oklahoma State University</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;color:rgb(80,0,80)"> </span><span style="color:rgb(80,0,80)"><u></u><u></u></span></p>
</div>
<p class="MsoNormal"><i><u><span style="font-size:7.5pt;font-family:Georgia,serif;color:rgb(153,153,153)">Breach of Confidentiality or Accidental Breach of Confidentiality:</span></u></i><i><span style="font-size:7.5pt;font-family:Georgia,serif;color:rgb(153,153,153)"> This
 email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you have received this email in error please notify the sender. This message contains confidential information
 and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute, or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from
 your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.</span></i><span style="color:rgb(80,0,80)"><u></u><u></u></span></p>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Mon, May 20, 2019 at 11:32 AM Arnaud Delorme <<a href="mailto:arno@ucsd.edu" target="_blank">arno@ucsd.edu</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">Dear Danielle, <u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">check out these two wiki pages.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="https://sccn.ucsd.edu/wiki/EEGLAB_and_Fieldtrip#Converting_between_EEGLAB_and_Fieldtrip_data_structures" target="_blank">https://sccn.ucsd.edu/wiki/EEGLAB_and_Fieldtrip#Converting_between_EEGLAB_and_Fieldtrip_data_structures</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="https://sccn.ucsd.edu/wiki/A08:_DIPFIT#Advanced_source_reconstruction_using_DIPFIT.2FFieldtrip" target="_blank">https://sccn.ucsd.edu/wiki/A08:_DIPFIT#Advanced_source_reconstruction_using_DIPFIT.2FFieldtrip</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Best wishes,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Arno<u></u><u></u></p>
<div>
<p class="MsoNormal"><br>
<br>
<u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal">On May 20, 2019, at 9:03 AM, Taylor, Danielle <<a href="mailto:danielle.taylor@okstate.edu" target="_blank">danielle.taylor@okstate.edu</a>> wrote:<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">Hello FieldTrippers,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">My name is Danielle Taylor and I am a graduate student at Oklahoma State University. I am currently trying to learn to use FieldTrip, and I am quite the novice. I am, however, quite familiar with
 EEGLab, and have previously used Matlab to run EEGLab processes.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"> I am currently processing data for a study in which I am evaluating an ERP (the LPP) and the SSVEP. I have compiled my ERPs, and therefore hoped to import my EEGLab data to Fieldtrip and complete
 SSVEP analyses.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">My questions are quite broad. <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">1) Can I import EEGLab data that has been processed through artifact rejection (I have used filters, ICA, have data binned and epoched, and have run automated artifact rejection routines)? Is it possible
 to import from this point and then complete fourier transformation in fieldtrip? If so, how? I have seen that one can use eeglab2fieldtrip, but do I need other specifications in my code? Alternatively, the EEGLab website recommends this code: <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";background:rgb(249,249,249)">hdr = ft_read_header</span><span class="gmail-m_-7721624280067849926gmail-m-8975964047182920878gmail-m-8975460521388408673gmail-m7438377151133083810gmail-br0"><span style="font-family:"Courier New";color:rgb(0,136,0)">(</span></span><span style="font-family:"Courier New";background:rgb(249,249,249)">
 EEGLABFILE </span><span class="gmail-m_-7721624280067849926gmail-m-8975964047182920878gmail-m-8975460521388408673gmail-m7438377151133083810gmail-br0"><span style="font-family:"Courier New";color:rgb(0,136,0)">)</span></span><span style="font-family:"Courier New";background:rgb(249,249,249)">; </span><span style="font-family:Georgia,serif"><u></u><u></u></span></p>
</div>
<pre style="line-height:14.4pt;background:rgb(249,249,249);vertical-align:top;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal"><span style="font-size:12pt">data = ft_read_data<span class="gmail-m_-7721624280067849926gmail-m-8975964047182920878gmail-m-8975460521388408673gmail-m7438377151133083810gmail-br0"><span style="color:rgb(0,136,0)">(</span></span> EEGLABFILE, <span class="gmail-m_-7721624280067849926gmail-m-8975964047182920878gmail-m-8975460521388408673gmail-m7438377151133083810gmail-co2"><span style="color:rgb(160,32,240)">'header'</span></span>, hdr <span class="gmail-m_-7721624280067849926gmail-m-8975964047182920878gmail-m-8975460521388408673gmail-m7438377151133083810gmail-br0"><span style="color:rgb(0,136,0)">)</span></span>; <u></u><u></u></span></pre>
<pre style="line-height:14.4pt;background:rgb(249,249,249);vertical-align:top"><span style="font-size:12pt">events = ft_read_event<span class="gmail-m_-7721624280067849926gmail-m-8975964047182920878gmail-m-8975460521388408673gmail-m7438377151133083810gmail-br0"><span style="color:rgb(0,136,0)">(</span></span> EEGLABFILE, <span class="gmail-m_-7721624280067849926gmail-m-8975964047182920878gmail-m-8975460521388408673gmail-m7438377151133083810gmail-co2"><span style="color:rgb(160,32,240)">'header'</span></span>, hdr <span class="gmail-m_-7721624280067849926gmail-m-8975964047182920878gmail-m-8975460521388408673gmail-m7438377151133083810gmail-br0"><span style="color:rgb(0,136,0)">)</span></span>;<u></u><u></u></span></pre>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">Does it matter which method I use?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">2) I am evaluating the SSVEP in 4 separate windows that are the same measurements as my ERP (400-700ms, 700-1000, 1000-2000 and 2000-3000). I have seen samples of code that use a moving window, but
 not that have used specific windows such as this. <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">I apologize if these questions are too vague, but any help or even a sample script would be much appreciated. Thank you very much for your assistance in advance!<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif">Regards,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Georgia,serif"><u></u> <u></u></span></p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Georgia,serif">Danielle Taylor, M.S.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Georgia,serif">Doctoral Candidate,</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Georgia,serif">Clinical Psychology</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Georgia,serif">Oklahoma State University</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt;color:rgb(80,0,80)"> </span><span style="color:rgb(80,0,80)"><u></u><u></u></span></p>
</div>
<p class="MsoNormal"><i><u><span style="font-size:7.5pt;font-family:Georgia,serif;color:rgb(153,153,153)">Breach of Confidentiality or Accidental Breach of Confidentiality:</span></u></i><i><span style="font-size:7.5pt;font-family:Georgia,serif;color:rgb(153,153,153)"> This
 email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you have received this email in error please notify the sender. This message contains confidential information
 and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute, or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from
 your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.</span></i><span style="color:rgb(80,0,80)"><u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal">_______________________________________________<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><u></u><u></u></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<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><u></u><u></u></p>
</blockquote>
</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>
</div>
</body>
</html>