<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
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 <fieldtrip@science.ru.nl> wrote:</div>
<br class="Apple-interchange-newline">
<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>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br>
https://doi.org/10.1371/journal.pcbi.1002202<br>
</div>
</blockquote>
</div>
<br>
</div>
</body>
</html>