@drowzee/eeg-data-convert
v0.0.0
Published
eeg-data-convert
Downloads
1
Readme
This library acts as a converter and link between the multiple ways of storing EEG time series data in applications.
Features
- Understands multiple JSON-type, csv and OpenBCI formats
- Works with
markers
Example
Convert from EG1
to Neurosity-1
const epoch = {
data: [
[
-911.1328125,
... // 7 more samples
],
[
-802.734375,
... // 7 more samples
],
[
251.953125,
... // 7 more samples
],
[
106.93359375,
... // 7 more samples
]
],
info: { startTime: 1635707 }
};
const data = biog.load(epoch);
const sampleFormat = biog.out("samples")
console.log(sampleFormat.length) // 8
console.log(sampleFormat)
[
{
data: [-911.1328125,-802.734375,251.953125,106.93359375],
info: { startTime: 1635707 }
},
{
data: [-911.1328125,-802.734375,251.953125,106.93359375],
info: { startTime: 1635711 } // updated startTime
},
// ... 6 more samples
]
Different kinds of data
EG1
Used by eeg-pipes
type Sample = {
data: number[];
info: {
startTime: number;
samplingRate: number;
channelNames: string[];
};
};
Neurosity-1
Used by the neurosity device
type Marker = {
label: string;
timestamp: number;
};
type Epoch = {
data: number[][];
info: {
startTime: number;
samplingRate: number;
channelNames: string[];
markers?: Marker[];
};
};