<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 Yannick,<div class=""><br class=""></div><div class="">Coding different types of events in an EDF file is not trivial, that is why ft_write_data does not support it (as shown by the error). I suggest that you use the brainvision_eeg format, which results in a vhdr+vmrk+eeg triplet of files. That not only has the advantage of supporting events, but also that the binary representation of the EEG data is not limited to 16 bits (which is the case for EDF). </div><div class=""><br class=""></div><div class="">best regards,</div><div class="">Robert</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 9 Mar 2022, at 17:28, LONGUET Yannick via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div dir="ltr" class=""><div style="margin: 0cm; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Dear community,</span></div><div style="margin: 0cm; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">My name is Yannick Longuet and I am a master 2 student, working in<b class=""> ICM </b>(Paris Brain institute) in Paris on Human intracranial-EEG data. </span></div><div style="margin: 0cm; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><br class=""></span></div><div style="margin: 0cm; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">I would like my dataset to follow the BIDS specification but my iEEG data are stored in</span> the <b class="">Poly5</b> format (TMSI). That's why I am looking to convert my i-EEG data in the <b class="">European Data Format</b> (EDF) </div><div style="margin: 0cm; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><br class=""></span></div><div style="margin: 0cm; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">I've been trying to use the ft_write_data() function for the conversion for several days but without success. </span></div><div style="margin: 0cm; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><span class="gmail-Apple-converted-space"><br class=""></span></span></div><div style="margin: 0cm; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><span class="gmail-Apple-converted-space"><b class=""> Here is my code : </b></span></span></div><div class="gmail-language-matlab gmail-highlighter-rouge" style="box-sizing:border-box;color:rgb(12,84,96);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";background-color:rgb(209,236,241)"><div class="gmail-highlight" style="box-sizing:border-box;background-color:rgb(240,240,240);padding:0.8em;border-top-left-radius:0.3em;border-top-right-radius:0.3em;border-bottom-right-radius:0.3em;border-bottom-left-radius:0.3em;margin-bottom:0.5rem"><pre class="gmail-highlight" style="box-sizing:border-box;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;margin-top:0px;margin-bottom:0px;overflow:auto;color:rgb(33,37,41)"><code style="box-sizing:border-box;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;color:inherit;word-break:normal" class=""><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class="">filename_data=<span style="color:rgb(170,4,249)" class="">'RUN01.Poly5'</span></div><div style="font-size: 10px; margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(170, 4, 249); min-height: 12px;" class=""><br class=""></div><div style="font-size: 10px; margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier;" class="">cfg = [];</div><div style="font-size: 10px; margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier;" class="">cfg.dataset = filename_data;</div><div style="font-size: 10px; margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier;" class="">cfg.continuous = <span style="color:rgb(170,4,249)" class="">'yes'</span>;</div><div style="font-size: 10px; margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier;" class="">cfg.chanel = <span style="color:rgb(170,4,249)" class="">'all';</span></div><div style="font-size: 10px; margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier;" class="">data_unfilt<span class="gmail-Apple-converted-space">  </span>= ft_preprocessing(cfg);</div><div style="font-size: 10px; margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier;" class="">DATA=data_unfilt.trial;</div><div style="font-size: 12px; margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; min-height: 14px;" class=""><span style="font-size:10px;color:inherit" class="">HEADER=ft_read_header(filename_data);</span><span class="gmail-Apple-converted-space" style="font-size:10px;color:inherit"> </span><br class=""></div><div style="font-size: 12px; margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; min-height: 14px;" class=""><span style="font-size:10px;color:inherit" class="">EVENT=ft_read_event(filename_data)</span><br class=""></div><p style="font-size:12px;margin:0px;font-stretch:normal;line-height:normal;font-family:Courier;min-height:14px" class="">
<br class="webkit-block-placeholder"></p><div style="font-size: 10px; margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; color: rgb(170, 4, 249);" class=""><span style="" class="">ft_write_data(</span>'Youyfu.edf'<span style="" class="">, DATA,</span>'header'<span style="" class="">,HEADER,</span>'event'<span style="" class="">,EVENT,</span>'dataformat'<span style="" class="">,</span>'edf'<span style="" class="">)</span></div><p style="font-size:12px;margin:0px;font-stretch:normal;line-height:normal;font-family:Courier;min-height:14px" class=""><br class="webkit-block-placeholder"></p></code></pre></div></div><div class=""><b class="">And here is the error message : </b></div><div class=""><pre class="gmail-highlight" style="background-color:rgb(240,240,240);box-sizing:border-box;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;margin-top:0px;margin-bottom:0px;overflow:auto"><code style="box-sizing:border-box;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;word-break:normal" class=""><div style="color: inherit; margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier;" class=""><br class=""></div><div style="font-size: 10px; margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; min-height: 12px;" class=""><font color="#666666" class="">EVENT = <br class=""><br class="">  1×252 struct array with fields:<br class=""><br class="">    type<br class="">    sample<br class="">    value<br class="">    offset<br class="">    duration</font><font color="#aa04f9" class=""><br class=""><br class=""></font><font color="#ff0000" class="">Error using ft_write_data (line 740)<br class="">writing events is not supported</font><font color="#aa04f9" class=""><br class=""></font></div></code></pre></div><div class=""><br class=""></div><div class="">Do you have any idea what could be causing the problem?</div><div class="">Any help would be appreciated. </div><div class=""><br class=""></div><div class="">Best regards </div><div class=""><br class=""></div><div class="">Yannick </div><div class=""><br class=""></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="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!5mdMNAikTzFHapBfN9d_ZNiiiCT00cULcQaiAdc-my-BoQ5i-YEYn1QAvpMTvJBZ-vyzIbIGAw-AqC-SSnVo72kTNhB5hQ$ <br class=""></div></blockquote></div><br class=""></div></body></html>