@drowzee/biog
TypeScript icon, indicating that this package has built-in type declarations

0.0.0 • Public • Published

biog

⚡︎ Performant and Lightweight Javascript EEG Data Converter ⚡︎


Github open issues Bitbucket open issues GitHub contributors David Generic badge

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[];
  };
};

Readme

Keywords

none

Package Sidebar

Install

npm i @drowzee/biog

Weekly Downloads

0

Version

0.0.0

License

MIT

Unpacked Size

10 kB

Total Files

7

Last publish

Collaborators

  • larskarbo