<div dir="ltr">Hi,<div>Thanks for your response and consideration.</div><div>I am still waiting for an effective reply, meanwhile I tried different codes to access the event code and how I can preprocess this data initially, so I use the following code and you can see the warning.<div>>> dataset = './dataset/S03_ME/motorexecution_subject3_run1.gdf';<br>>> hdr    = ft_read_header(dataset);<br>data   = ft_read_data(dataset, 'header', hdr );<br>events = ft_read_event(dataset, 'header', hdr );<br>Warning: BIOSIG does not have a consistent event representation, skipping events </div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 2, 2024 at 2:46 PM Schoffelen, J.M. (Jan Mathijs) 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,
<div><br>
</div>
<div>As you may have already found in the fieldtrip documentation in <a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffieldtriptoolbox.org%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C041d95ebd14c4d74a35b08dc6ad7c2fd%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638502722122927280%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=e3lKBaeNOr78IAhf0y%2FWHS25AkWaWyd6VXz0CwNucyE%3D&reserved=0" target="_blank">
https://fieldtriptoolbox.org</a>, events are read in by the function ft_read_event.</div>
<div><br>
</div>
<div>I guess you have already started inspecting the code in ft_read_event using the MATLAB debugger, and you may have found the relevant lines 484-504 dealing with the .gdf file format.</div>
<div><br>
</div>
<div>I assume (although you did not explicitly mention this) that ft_read_event in the case of the dataset that you mentioned returns an empty event structure, which means that you will have had the warning on your screen that is in line 500. In other
 words, based the specific data organization in the file, FieldTrip does not know how to interpret the trigger information. </div>
<div><br>
</div>
<div>Continuing the detective work, you will have noticed that in line 492 the function ft_read_header is called, producing a variable hdr, based on which consecutively a ’statusindex’ is determined, which consecutively determines whether or not the
 warning is thrown. Now, if we take a close look at the section in ft_read_header that deals with .gdf files, you will see in line 1545 that the read_biosig_header function is used to read in the metadata from the datafile. The read_biosig_header function uses
 biosig’s sopen function to do the heavy lifting. </div>
<div><br>
</div>
<div>Apparently, there has never been somebody who managed to write some ‘glue code’ that translates the events which are not represented on a digital STATUS channel into a representation that FieldTrip can work with.</div>
<div><br>
</div>
<div>We look forward to a generic implementation that broadcasts the events from the biosig header to FieldTrip as an improvement to be able to deal with a broader selection of .gdf files. Please submit your suggested code changes as a PR to our toolbox’s
 repository on github, which is located at <a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffieldtrip%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C041d95ebd14c4d74a35b08dc6ad7c2fd%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638502722122927280%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=VgMRfCSYwh76Csyl1ftaNVdeTVu%2Bfjh9fxSMxWlYaj8%3D&reserved=0" target="_blank">
https://github.com/fieldtrip/fieldtrip</a>.</div>
<div><br>
</div>
<div>Best wishes and happy coding,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br>
<div><br>
<blockquote type="cite">
<div>On 2 May 2024, at 19:04, Sina Makhdoomi Kaviri via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a>> wrote:</div>
<br>
<div>
<div dir="ltr">I want to add this note that if I uploaded the dataset into the fieldtrip directly, it does not recognize the dataset related to specific event type. Please help me how can I access the event code in this dataset and separate it to process
 in the beamforming method. Here is my code:
<div><span style="white-space:pre-wrap;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:10pt">dataset =
</span><span style="white-space:pre-wrap;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:10pt;color:rgb(167,9,245)">'./dataset/S03_ME/motorexecution_subject3_run1.gdf'</span><span style="white-space:pre-wrap;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:10pt">;</span></div>
<div><span style="white-space:pre-wrap;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:10pt">cfg = [];</span></div>
<div><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">cfg.dataset = dataset;</span></div>
<div><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">cfg.trialdef.eventtype =
</span><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;color:rgb(167,9,245)">'1541'</span><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">;
</span><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;color:rgb(0,128,19)">% get a list of the available types</span></div>
<div><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">cfg.trialfun =
</span><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;color:rgb(167,9,245)">'ft_trialfun_general'</span><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">;</span></div>
<div><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">cfg.trialdef.triallength = 1;
</span><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;color:rgb(0,128,19)">% duration in seconds</span></div>
<div><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">cfg = ft_definetrial(cfg);</span></div>
<div>cfg.dftfreq<span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"> = [50];</span></div>
<div><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">cfg.channel =
</span><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;color:rgb(167,9,245)">'EEG'</span><span style="white-space:pre-wrap;font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">;</span></div>
<div><span style="font-size:10pt;white-space:pre-wrap;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">data_segmented = ft_preprocessing(cfg);</span></div>
<div><span style="white-space:pre-wrap;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:10pt"><br>
</span></div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, May 2, 2024 at 11:16 AM Sina Makhdoomi Kaviri <<a href="mailto:sinam1@umbc.edu" target="_blank">sinam1@umbc.edu</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 dir="ltr">To whom it may concern,<br>
<br>
I want to implement, "A novel explainable machine learning approach for EEG-based brain computer interface systems" published in Springer Nature, in fieldtrip. Regarding that they used (
<a href="https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbnci-horizon-2020.eu%2Fdatabase%2Fdata-sets&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C041d95ebd14c4d74a35b08dc6ad7c2fd%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638502722122927280%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=ZOMkv3C374WwkbTOVhUOsCt6J3AdtFPZKsX9aprONac%3D&reserved=0" target="_blank">
http://bnci-horizon-2020.eu/database/data-sets</a> (Accession Number 001-2017)) as dataset in GDF file, I want to preprocess and use ft_definetrial, but it is not accessed to the event code. In this regard I use EEGLAB to load the dataset with biosig, after
 that when I convert to fieldtrip (eeglab2fieldtrip or save it and use ft_read_event,..) I face this problem as follows. Could you please help me how can I preprocess this dataset for beamforming source localization for specific event code.
<div><br>
</div>
<div>Error using isfolder<br>
Input path must be text.<br>
<br>
Error in ft_filetype (line 166)<br>
if isfolder(filename)<br>
<br>
Error in dataset2files (line 42)<br>
  format = ft_filetype(filename);<br>
<br>
Error in ft_checkconfig (line 675)<br>
    [cfg.dataset, cfg.headerfile, cfg.datafile] = dataset2files(cfg.dataset, []);<br>
<br>
Error in ft_preprocessing (line 385)<br>
  cfg = ft_checkconfig(cfg, 'dataset2files', 'yes');<br>
<div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C041d95ebd14c4d74a35b08dc6ad7c2fd%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638502722122927280%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=YhPuPSYLY9PdP15Bv%2BN2M31GC0xzH2szXFlAgj85Xtw%3D&reserved=0" 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>