[FieldTrip] Importing B-Alert X10 data
Robert Oostenveld
r.oostenveld at donders.ru.nl
Thu Jun 9 13:08:25 CEST 2016
Hi Robin
In terms of segmenting data after it having been read into memory, the following procedure works:
1) ft_preprocessing, without specifying cfg.trl or trialfun -> this reads the data as a single segment (i.e. one very long trial)
2) ft_definetrial, with cfg.trialfun, which could get events from another file -> this results in cfg.trl
3) ft_redefinetrial which takes the trl from step 2 and the continuous data from step 1.
With regards to the data format: the files are plain EDF and as such supported by FieldTrip out the box. E.g.
>> cfg = []
>> cfg.dataset = '000222000.010616.103900.Events.edf'
>> ft_databrowser(cfg)
>> hdr = ft_read_header(cfg.dataset)
hdr =
Fs: 1000
nChans: 1
label: {'EDF Annotations'}
nSamples: 13000
nSamplesPre: 0
nTrials: 1
orig: [1x1 struct]
chantype: {'unknown'}
chanunit: {'unknown'}
and
>> cfg = []
>> cfg.dataset = '000222000.010616.103900.Signals.Raw.edf'
>> ft_databrowser(cfg)
>> hdr = ft_read_header(cfg.dataset)
Warning: channels with different sampling rate not supported, using a subselection of 10 channels at
256.000000 Hz
> In read_edf (line 330)
In ft_read_header (line 678)
hdr =
Fs: 256
nChans: 10
label: {10x1 cell}
nSamples: 1145600
nSamplesPre: 0
nTrials: 1
orig: [1x1 struct]
chantype: {10x1 cell}
chanunit: {10x1 cell}
However, non-standard is to have the events in a separate file. Furthermore, the data file has channels with variable sampling rate, which is also not (by default) supported. See http://www.fieldtriptoolbox.org/getting_started/edf and http://www.fieldtriptoolbox.org/reference/edf2fieldtrip. Looking at the Events channel, I do think that you’ll need a separate trialfun anyway.
From the Signals.Raw I see
>> hdr.orig.Label
ans =
ECG
POz
Fz
Cz
C3
C4
F3
F4
P3
P4
ESUTimestamp
SystemTimestamp
Tilt X
Tilt Y
Tilt Z
EDF Annotations
which means that the annotations also seem to be present in the data file itself and the separate Event file might not be needed.
With
>> data = edf2fieldtrip('000222000.010616.103900.Signals.Raw.edf')
Warning: channels with different sampling rate not supported, using a subselection of 10 channels at
256.000000 Hz
> In read_edf (line 330)
In ft_read_header (line 678)
In edf2fieldtrip (line 36)
reading 1 channels with 8 Hz sampling rate
reading 3 channels with 128 Hz sampling rate
reading 10 channels with 256 Hz sampling rate
reading 1 channels with 512 Hz sampling rate
reading 1 channels with 1024 Hz sampling rate
upsampling 1 channels from 8 to 1024 Hz
the input is raw data with 1 channels and 1 trials
the call to "ft_selectdata" took 0 seconds and required the additional allocation of an estimated 3 MB
resampling data
resampling data in trial 1 from 1
original sampling rate = 8 Hz
new sampling rate = 1024 Hz
the call to "ft_resampledata" took 1 seconds and required the additional allocation of an estimated 146 MB
upsampling 3 channels from 128 to 1024 Hz
the input is raw data with 3 channels and 1 trials
the call to "ft_selectdata" took 0 seconds and required the additional allocation of an estimated 1 MB
resampling data
resampling data in trial 1 from 1
original sampling rate = 128 Hz
new sampling rate = 1024 Hz
the call to "ft_resampledata" took 1 seconds and required the additional allocation of an estimated 165 MB
upsampling 10 channels from 256 to 1024 Hz
the input is raw data with 10 channels and 1 trials
the call to "ft_selectdata" took 0 seconds and required the additional allocation of an estimated 1 MB
resampling data
resampling data in trial 1 from 1
original sampling rate = 256 Hz
new sampling rate = 1024 Hz
the call to "ft_resampledata" took 2 seconds and required the additional allocation of an estimated 507 MB
upsampling 1 channels from 512 to 1024 Hz
the input is raw data with 1 channels and 1 trials
the call to "ft_selectdata" took 0 seconds and required the additional allocation of an estimated 2 MB
resampling data
resampling data in trial 1 from 1
original sampling rate = 512 Hz
new sampling rate = 1024 Hz
the call to "ft_resampledata" took 0 seconds and required the additional allocation of an estimated 105 MB
input dataset 1, 1 channels, 1 trials
input dataset 2, 3 channels, 1 trials
input dataset 3, 10 channels, 1 trials
input dataset 4, 1 channels, 1 trials
input dataset 5, 1 channels, 1 trials
concatenating the channels within each trial
the call to "ft_appenddata" took 1 seconds and required the additional allocation of an estimated 560 MB
adding the comment: reordered the channels to the original order in the EDF file
the call to "ft_annotate" took 0 seconds and required the additional allocation of an estimated 463 MB
data =
label: {16x1 cell}
trial: {[16x4582400 double]}
time: {[1x4582400 double]}
fsample: 1024
cfg: [1x1 struct]
But then
>> cfg = [];
>> cfg.viewmode = 'vertical';
>> ft_databrowser(cfg, data)
shows that the EDF Annotations channel (after upsampling) has been slightly messed up (due to filters). Perhaps it can still be of use. Otherwise I also would not directly know how to link the two files to each other, as the sampling rates are very incompatible (1000 in one, and powers of 2 in the other).
Perhaps you can learn something from the EEGLAB code.
Good luck with the data
Robert
> On 09 Jun 2016, at 11:03, Robin Kramer <kramerrobin92 at gmail.com> wrote:
>
>
> 000222000.010616.103900.Events.edf <https://drive.google.com/file/d/0B4UCcTb4Xh26ZU85WUF4aHJFdms/view?usp=drive_web>
> 000222000.010616.103900.Signals.Raw.edf <https://drive.google.com/file/d/0B4UCcTb4Xh26N3BPQWFKRTIwSGM/view?usp=drive_web>Hello,
>
> Recently we started a research with a new wearable EEG system called the B-Alert X-10 from Advanced Brain Monitoring. ABM does deliver their own analyzing software and it is compatible with EEGLab but not with Fieldtrip. Has anyone attempted to analyze the B-Alert data via FieldTrip already?
>
> The way data is stored is rather odd actually. The data is epoched in every second, with 256 samples (Fs = 256) in each epoch for each channel. In other words, there are as much separate trials as there are seconds. After preprocessing, and some manual labour I could rearrange the epochs and make the data continuous, but then I encountered two challenges.
>
> First, the event markers are stored in a different EDF file. Therefore, I have to define my own trial function, but the event-marker data is also stored rather oddly.
> Second, it seems that fieldtrip cannot segment any data after preprocessing with ft_definetrials(). Sadly, before preprocessing the B-Alert data is in the strange format. Is there a workaround? I have send a link with the two EDF files, in case one would like to inspect them themselves.
>
> Thank you so much.
>
> Best regards,
>
> Robin Kramer
> Student MSc Human-Machine Communication
> University of Groningen, the Netherlands
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160609/e06bc5ae/attachment-0002.html>
More information about the fieldtrip
mailing list