<div dir="ltr">hi Jan-Mathijs,<div><br></div><div>That's it, all sorted now!</div><div><br></div><div>Roy</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Mar 25, 2025 at 6:59 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>
Hi Roy,
<div><br>
</div>
<div>A warning is not an error, so that in itself shouldn’t be the issue. </div>
<div><br>
</div>
<div>What is the issue, though, is that one of the following will work:</div>
<div><br>
</div>
<div>put your my_events in the cfg, rather than the data, i.e. cfg.event = my_events, and supply this cfg to ft_databrowser(cfg,data);</div>
<div><br>
</div>
<div>put your my_events in data.cfg, rather than in data, i.e. data.cfg.event = my_events</div>
<div>
<div><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br>
<blockquote type="cite">
<div>On 21 Mar 2025, at 12:44, Roy Cox via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a>> wrote:</div>
<br>
<div>
<div dir="ltr">hi all,
<div><br>
</div>
<div>Likely I'm missing something obvious, but I'm trying to figure out how to pass an event structure read in by ft_read_event on to ft_databrowser in order to visualize events.</div>
<div><br>
</div>
<div>Reading in a Brainvision file using ft_preprocessing, followed by explicitly reading in the events and adding them to the dataset, like so:</div>
<div><br>
</div>
<div><i>%read continuous (single-trial) data</i></div>
<i>cfg=[];<br>
cfg.dataset='some_path';<br>
cfg.readbids = 'no';<br>
data=ft_preprocessing(cfg);</i>
<div><i><br>
%read the events<br>
my_events=ft_read_event(cfg.dataset,'eventformat','brainvision_vhdr','readbids','no');<br>
<br>
</i></div>
<div><i>%add to data</i></div>
<div><i>data.event=my_events;</i></div>
<div><i><br>
</i></div>
<div><i> %looks ok:</i></div>
<div><i>struct2table(data.event)<br>
<br>
ans =<br>
<br>
  6×5 table<br>
<br>
         type                           value                       sample      duration       offset  
<br>
    _______________    _______________________________________    __________    ________    ____________<br>
<br>
    {'Time 0'     }    {0×0 double                           }             1         0      {0×0 double}<br>
    {'Stimulus'   }    {'recordingtime: 10-Mar-2025 22:49:30'}             1         0      {0×0 double}<br>
    {'Time 0'     }    {0×0 double                           }             1         0      {0×0 double}<br>
    {'New Segment'}    {0×0 double                           }             1         0      {0×0 double}<br>
    {'Stimulus'   }    {'sync_Amp time'                      }           265     5e+05      {0×0 double}<br>
    {'Stimulus'   }    {'LOFF_Lights off'                    }    2.1014e+05     5e+05      {0×0 double}</i></div>
<div><i>ans =<br>
</i></div>
<div><br>
</div>
<div>When I call ft_databrowser on this data strcuture, I get multiple instances of the following warning and no event markers are plotted:</div>
<div><br>
</div>
<div><i>Warning: could not determine dimord of "event" in:<br>
<br>
           hdr: [1×1 struct]<br>
         label: {264×1 cell}<br>
          time: {[0 0.0040 0.0080 0.0120 0.0160 0.0200 0.0240 0.0280 0.0320 0.0360 0.0400 0.0440 0.0480 0.0520 0.0560 0.0600 0.0640 0.0680 0.0720 … ]}<br>
         trial: {[264×1571182 double]}<br>
       fsample: 250<br>
    sampleinfo: [1 1571182]<br>
           cfg: [1×1 struct]<br>
         event: [1×6 struct]</i></div>
<div><i><br>
</i></div>
<div>Dove in a bit, and it looks like <i>getdimord </i>is called on <i>data.event</i>, which is probably not what should happen.</div>
<div><br>
</div>
<div>Any suggestions? Thanks!</div>
<div><br>
</div>
<div>Roy</div>
</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%7C2efeb27eb00540133ea108dd6c80c510%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638786022503099113%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=HrTsaLQrDZWkRwiMOtzbpCHZsF5PnTSo6QRPNGRLWuo%3D&reserved=0" originalSrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C2efeb27eb00540133ea108dd6c80c510%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638786022503109453%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=D%2BOVBTw%2BD89pOB0503kkece79Bbh53f9%2Bluo%2Few4E0E%3D&reserved=0" originalSrc="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://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C2efeb27eb00540133ea108dd6c80c510%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638786022503118825%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=FDtmRtbTGcSuDlKmK17ILoyT9H3Z%2BXAdWt9LKRsrQsA%3D&reserved=0" originalSrc="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://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C2efeb27eb00540133ea108dd6c80c510%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638786022503127939%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=Ti3sffzSK0oAR9DzGjkNvMBmQPF%2F8Jmvkfr5DYSW7Vc%3D&reserved=0" originalSrc="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>