<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Varghese,<div class=""><br class=""></div><div class="">have you tried reading the .mff with EEGLab?</div><div class="">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 class="">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$" class="">https://osf.io/uh5rk</a></div><div class=""><br class=""></div><div class="">Good Luck,</div><div class=""><br class=""></div><div class="">Julian<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 19.04.2023 um 16:27 schrieb Varghese Mathew 1881002 via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi<div class="">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" class="">Unrecognized field name "headerfile" </span> . </div><div class="">I would like to know how to go about this in EDF or .mff format.</div><div class="">It will also be helpful if someone can help with how to modify ft_trialfun_general for .mff file as well.</div><div class="">I am pasting the code I used, below.</div><div class=""><div class=""><div class="gmail-rtcContent" style="padding:30px"><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class="">cfg=[]</span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class="">cfg.dataset     = <span style="color:rgb(167,9,245)" class="">'E:\FT\OP17.mff'</span>;</span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class="">cfg.dataformat = <span style="color:rgb(167,9,245)" class="">'egi_mff_v3'</span></span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class="">cfg.headerformat = <span style="color:rgb(167,9,245)" class="">'egi_mff_v3'</span></span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class="">cfg.trialdef.eventtype                     = <span style="color:rgb(167,9,245)" class="">'stim'</span>;</span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class="">cfg.trialdef.prestim                     = 1;</span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class="">cfg.trialdef.poststim                    =1;</span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class="">cfg.trialdef.eventvalue         = {<span style="color:rgb(167,9,245)" class="">'01''02''03''04'</span>};</span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class="">cfg.trialfun                = <span style="color:rgb(167,9,245)" class="">'ft_trialfun_general_stimmod'</span>;</span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class="">cfg   = ft_definetrial(cfg)</span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class=""><br class=""></span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class=""><br class=""></span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><span style="white-space:pre" class="">For modifying trialfun_general</span></div><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"><div class="gmail-rtcContent" style="padding:30px"><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class=""><span style="color:rgb(14,0,255)" class=""><br class=""></span></span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class=""><span style="color:rgb(14,0,255)" class="">function </span>[trl, event] = ft_trialfun_general_stimmod(cfg)</span></div><div class="gmail-lineNode" style="font-size:10pt"></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class="">event = ft_read_event(cfg.dataset, <span style="color:rgb(167,9,245)" class="">'headerformat'</span>, <span style="color:rgb(167,9,245)" class="">'egi_mff_v3'</span>);</span></div><div class="gmail-lineNode" style="font-size:10pt"></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class=""><span style="color:rgb(0,128,19)" class="">% Find trigger values</span></span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class="">trigger = [event(strcmp(<span style="color:rgb(167,9,245)" class="">'stim'</span>, {event.type})).value]';</span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class=""><span style="color:rgb(0,128,19)" class="">% Note: Replace 'STI101' with the label of the trigger channel that</span></span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class=""><span style="color:rgb(0,128,19)" class="">% contains the trigger values for your data</span></span></div><div class="gmail-lineNode" style="font-size:10pt"></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class=""><span style="color:rgb(0,128,19)" class="">% Define trial segments</span></span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class="">trl = [];</span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class=""><span style="color:rgb(14,0,255)" class="">for </span>j = 1:length(trigger)</span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class="">    <span style="color:rgb(14,0,255)" class="">if </span>any(trigger(j) == [01 02 03 04])</span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class="">        trlbegin = event(j).sample;</span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class="">        trlend = trlbegin + 1000; <span style="color:rgb(0,128,19)" class="">% define trial length as 1 second</span></span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class="">        offset = 0; <span style="color:rgb(0,128,19)" class="">% no offset</span></span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class="">        newtrl = [trlbegin trlend offset trigger(j)];</span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class="">        trl = [trl; newtrl];</span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class="">    <span style="color:rgb(14,0,255)" class="">end</span></span></div><div class="gmail-lineNode" style="font-size:10pt"><span style="white-space:pre" class=""><span style="color:rgb(14,0,255)" class="">end</span></span></div></div></div></div></div><div class="">Please help with the issue, as I am trying to pick up analysis using Fieldtrip and I do not have a coding background.<br class=""></div><div class=""><div class="">Looking forward for a response, </div></div><div class=""><br class=""></div><div class="">Sincerely</div><span class="gmail_signature_prefix">-- </span><br class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class="">Varghese Mathew</div><div dir="ltr" class=""><br class=""></div></div></div></div></div></div>
_______________________________________________<br class="">fieldtrip mailing list<br class=""><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class=""><a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9Yh_5cOpyEfLD2Lxtli-X9YZbZN7V7Wq4TC5vPr_4jkhBDUWiH-8EJaz356EB1tVQt72kuDBEiW8TpP1zIjXO0okaA$">https://doi.org/10.1371/journal.pcbi.1002202</a><br class=""></div></blockquote></div><br class=""></div></body></html>