<div dir="ltr">Thank you so much for the suggestion and code. I will try this out. I am just getting used to understanding the codes and this will help.<div><br></div><div>Sincerely</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 19, 2023 at 11:48 PM Julian Keil via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</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;">Hi Varghese,<div><br></div><div>have you tried reading the .mff with EEGLab?</div><div>A while ago I worked with some older EGI data and reading directly to FieldTrip didn’t work. Using EEGLab with the MFFMatlabIO extension did the trick, and then you can use eeglab2fieldtrip to move over to FieldTrip.</div><div>Here’s a link to the code I used, although I did a lot of preprocessing in EEGLab: <a href="https://urldefense.com/v3/__https://osf.io/uh5rk__;!!HJOPV4FYYWzcc1jazlU!9Yh_5cOpyEfLD2Lxtli-X9YZbZN7V7Wq4TC5vPr_4jkhBDUWiH-8EJaz356EB1tVQt72kuDBEiW8TpP1zIi7R5RY6w$" target="_blank">https://osf.io/uh5rk</a></div><div><br></div><div>Good Luck,</div><div><br></div><div>Julian<br><div><br><blockquote type="cite"><div>Am 19.04.2023 um 16:27 schrieb Varghese Mathew 1881002 via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a>>:</div><br><div><div dir="ltr">Hi<div>I am doing analysis on Netstation EGI .mff file using Fieldtrip, I have tried using .mff file directly and after converting to EDF. However, I am getting error in defining trials. Mostly I get an error message 

<span style="color:rgb(52,53,65);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px;white-space:pre-wrap">Unrecognized field name "headerfile" </span> . </div><div>I would like to know how to go about this in EDF or .mff format.</div><div>It will also be helpful if someone can help with how to modify ft_trialfun_general for .mff file as well.</div><div>I am pasting the code I used, below.</div><div><div><div style="padding:30px"><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap">cfg=[]</span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap">cfg.dataset     = <span style="color:rgb(167,9,245)">'E:\FT\OP17.mff'</span>;</span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap">cfg.dataformat = <span style="color:rgb(167,9,245)">'egi_mff_v3'</span></span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap">cfg.headerformat = <span style="color:rgb(167,9,245)">'egi_mff_v3'</span></span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap">cfg.trialdef.eventtype                  = <span style="color:rgb(167,9,245)">'stim'</span>;</span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap">cfg.trialdef.prestim                       = 1;</span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap">cfg.trialdef.poststim                   =1;</span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap">cfg.trialdef.eventvalue         = {<span style="color:rgb(167,9,245)">'01''02''03''04'</span>};</span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap">cfg.trialfun                = <span style="color:rgb(167,9,245)">'ft_trialfun_general_stimmod'</span>;</span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap">cfg   = ft_definetrial(cfg)</span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap"><br></span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap"><br></span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre-wrap">For modifying trialfun_general</span></div><div style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><div style="padding:30px"><div style="font-size:10pt"><span style="white-space:pre-wrap"><span style="color:rgb(14,0,255)"><br></span></span></div><div style="font-size:10pt"><span style="white-space:pre-wrap"><span style="color:rgb(14,0,255)">function </span>[trl, event] = ft_trialfun_general_stimmod(cfg)</span></div><div style="font-size:10pt"></div><div style="font-size:10pt"><span style="white-space:pre-wrap">event = ft_read_event(cfg.dataset, <span style="color:rgb(167,9,245)">'headerformat'</span>, <span style="color:rgb(167,9,245)">'egi_mff_v3'</span>);</span></div><div style="font-size:10pt"></div><div style="font-size:10pt"><span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">% Find trigger values</span></span></div><div style="font-size:10pt"><span style="white-space:pre-wrap">trigger = [event(strcmp(<span style="color:rgb(167,9,245)">'stim'</span>, {event.type})).value]';</span></div><div style="font-size:10pt"><span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">% Note: Replace 'STI101' with the label of the trigger channel that</span></span></div><div style="font-size:10pt"><span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">% contains the trigger values for your data</span></span></div><div style="font-size:10pt"></div><div style="font-size:10pt"><span style="white-space:pre-wrap"><span style="color:rgb(0,128,19)">% Define trial segments</span></span></div><div style="font-size:10pt"><span style="white-space:pre-wrap">trl = [];</span></div><div style="font-size:10pt"><span style="white-space:pre-wrap"><span style="color:rgb(14,0,255)">for </span>j = 1:length(trigger)</span></div><div style="font-size:10pt"><span style="white-space:pre-wrap">    <span style="color:rgb(14,0,255)">if </span>any(trigger(j) == [01 02 03 04])</span></div><div style="font-size:10pt"><span style="white-space:pre-wrap">        trlbegin = event(j).sample;</span></div><div style="font-size:10pt"><span style="white-space:pre-wrap">        trlend = trlbegin + 1000; <span style="color:rgb(0,128,19)">% define trial length as 1 second</span></span></div><div style="font-size:10pt"><span style="white-space:pre-wrap">        offset = 0; <span style="color:rgb(0,128,19)">% no offset</span></span></div><div style="font-size:10pt"><span style="white-space:pre-wrap">        newtrl = [trlbegin trlend offset trigger(j)];</span></div><div style="font-size:10pt"><span style="white-space:pre-wrap">        trl = [trl; newtrl];</span></div><div style="font-size:10pt"><span style="white-space:pre-wrap">    <span style="color:rgb(14,0,255)">end</span></span></div><div style="font-size:10pt"><span style="white-space:pre-wrap"><span style="color:rgb(14,0,255)">end</span></span></div></div></div></div></div><div>Please help with the issue, as I am trying to pick up analysis using Fieldtrip and I do not have a coding background.<br></div><div><div>Looking forward for a response, </div></div><div><br></div><div>Sincerely</div><span>-- </span><br><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Varghese Mathew</div><div dir="ltr"><br></div></div></div></div></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://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9Yh_5cOpyEfLD2Lxtli-X9YZbZN7V7Wq4TC5vPr_4jkhBDUWiH-8EJaz356EB1tVQt72kuDBEiW8TpP1zIjXO0okaA$" 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://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8CaXs2tEtqE9qa9v7Breg2ImNICRtmWJ0pKPov53Kn1-EX3FIbh28qCX9XuMChOKWA3NfLoC_qkM1xOvAo-wSqPTEfosDDhH9I44KNN_tQeI$" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Varghese Mathew</div><div dir="ltr"><div><div>Mobile No. 9535395896</div></div></div></div></div></div></div>