[FieldTrip] plotting events from ft_read_event in ft_databrowser

Roy Cox roycox.roycox at gmail.com
Fri Mar 21 12:44:42 CET 2025


hi all,

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.

Reading in a Brainvision file using ft_preprocessing, followed by
explicitly reading in the events and adding them to the dataset, like so:

*%read continuous (single-trial) data*



*cfg=[];cfg.dataset='some_path';cfg.readbids =
'no';data=ft_preprocessing(cfg);*




*%read the
eventsmy_events=ft_read_event(cfg.dataset,'eventformat','brainvision_vhdr','readbids','no');*
*%add to data*
*data.event=my_events;*

* %looks ok:*














*struct2table(data.event)ans =  6×5 table         type
      value                       sample      duration       offset
_______________    _______________________________________    __________
 ________    ____________    {'Time 0'     }    {0×0 double
          }             1         0      {0×0 double}    {'Stimulus'   }
 {'recordingtime: 10-Mar-2025 22:49:30'}             1         0      {0×0
double}    {'Time 0'     }    {0×0 double                           }
      1         0      {0×0 double}    {'New Segment'}    {0×0 double
                    }             1         0      {0×0 double}
{'Stimulus'   }    {'sync_Amp time'                      }           265
  5e+05      {0×0 double}    {'Stimulus'   }    {'LOFF_Lights off'
           }    2.1014e+05     5e+05      {0×0 double}*

*ans =*

When I call ft_databrowser on this data strcuture, I get multiple instances
of the following warning and no event markers are plotted:










*Warning: could not determine dimord of "event" in:           hdr: [1×1
struct]         label: {264×1 cell}          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 … ]}         trial: {[264×1571182
double]}       fsample: 250    sampleinfo: [1 1571182]           cfg: [1×1
struct]         event: [1×6 struct]*

Dove in a bit, and it looks like *getdimord *is called on *data.event*,
which is probably not what should happen.

Any suggestions? Thanks!

Roy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20250321/64f7056f/attachment.htm>


More information about the fieldtrip mailing list