EEG notes

From Helpful
Jump to navigation Jump to search
This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

Some introduction

As mentioned at electricity and humans, EEG attempts to measure activity in the brain (-encephalo-), by measuring the tiny fluctuating voltage change left over on the surface of the scalp, which on the outside is is on the scale of dozen microvolts (to at most millivolts (verify)).

We comparing that voltage to other such spots for reference, and using metal electrodes and conductive paste for better contact.


Aside from the issue of weak signals (and requiring some well engineered and low-noise amplification), we have some other issues.

For example, muscles nearer the surface are much stronger signal than the brain, so a a clenched jaw or blinking your eye is very visible in data (in very different ways - jaw is high frequency, blink low).

In fact, some of the electrodes are only there to measure those in isolation, so that we have a chance to remove them later, and some of the analysis is there just to get out some of these effects.


Setups may well be battery-powered, which is both good for safety (and relevant medical certification), and is also good for noise rejection compared to mains power supplies (such power supplies, even if high quality, make it fundamentally hard to push the capacitance-to-mains to under a few hundred or few dozen pF, while it's something you basically get for free with a battery).



What we can and can't do

"EEG waves?"

On ERPs and patterns in them

Experiment design

EEG and headphones

On sampling speed

Triggers / markers

Setup hints

Beforehand

One or some channels are misbehaving and my actiview screen is full of noise now

Processing

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.



ICA

BVA notes

Editing EEG file format notes

EDF, EDF+

EDF (European Data Format, 1992) is a time series format used in some medicine/research (more widely than just EEG).

EDF+ (2003) is an update that is largely compatible but allows discontinuous fragments, and adds annotations(verify).

An EDF+ parser can be easily made to read both EDF and EDF+

An EDF parser should read EDF+, though if data is discontinuous would treat it as if it were continuous so get the later timeframes wrong(verify).


EDF has a header (of variable size because of variable amounts of channels). That header is almost all ASCII (values 32 through 126), in fixed-size fields.

The data records often contains 'ordinary signals' (binary time series).


See also:

EDF extensions

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

There is an extension named "How to store longintegers and floats".

Which is misleading - instead they declare that there are no biological signal that need more than 14 bits of accuracy (even if sampled at more), they apply a log transform, and declare a way to store into the header that this has happened and for software aware of this to apply the opposite. It's a good trick to apply , but does not do what the title promixes.

https://www.edfplus.info/specs/edffloat.html


There is an extension named "Standard texts and polarity rules", which basically calls for some research fields to use header fields in a more standardized way.

https://www.edfplus.info/specs/edftexts.html

BDF

BDF ('BioSemi Data Format') is EDF altered to store 24-bit data.

It was created by BioSemi for storing higher-resolution EEG data.

It looks like BDF is EDF with that one change. I have seen mention of BDF+, presumably is EDF+ with the same change.(verify), but I don't see a definition on the biosemi site.


See also:


BVA data

Header file (*.vhdr)

text file (INI-like) mentioning metadata, including recording parameters

Raw EEG data file (*.eeg, sometimes .avg or .seg?(verify)):

This is a file containing the EEG data as well as additional signals recorded along with the EEG.
spec seems to just say 'described in the header' but does not specify how; might be binary or text?

Marker file (*.vmrk), optional

text file (INI-like) that describing events in time, based on the EEG recording

https://www.brainproducts.com/support-resources/brainvision-core-data-format-1-0/


Once you start working on a project, you may have and/or create multiple of those (header,data,marker) sets. Within a project, the history files will tell you how they relate, though they can be read by themselves if you don't care how people arrived at them(verify).


BVA and markers

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.


The .vmrk is a text file that, among other things, contains items like:

Mk<number> = <Type>,<Description>,<Position>,<Length>,<Channel>

e.g.

Mk2=Stimulus,S254,207,1,0

Where

  • Type - (see below)
  • Description - text
  • Position - time position, in sample position
  • Length/size - time length, in sample points amount
  • Channel - which channel number it pertains to, with 0 meaning all

And a few marker types (Voltage markers, DC Correction)have different fields.


Predefined types include: (it seems you're allowed to invent your own)

  • Stimulus
  • Response
both probably from experiment, e.g. from trigger channel data
  • New Segment
marks discontinuous recordings - the first marker is always New Segment, if you paused and resumed there will be more
segmentation also inserts these
  • Time 0
present near and after each New Segment marker, and in a raw recording this would probably sit at the same as new segment(verify)
after segmentation this may be the zero point in an e.g. -200..1000 range (or whatever your set), after the new segment
  • Bad Interval
uses position and length to mark a time range as bad
certain BVA analyses will ignore data portions marked like this
  • Peak - related to ERP peaks, placed by e.g. Peak Detection, and MinMax Markers(verify)
  • Threshold - seems meant to mark ranges from data (being above/below a threshold)(verify)
  • Comment
you could e.g. use these to indicate trials
  • DC Correction - mark places where to re-apply DC offset correcton(verify)
  • Voltage - mark changes in amplifier settings?(verify)



Processing

In BVA, markers are largely used to assist processing, including some logic to let you select a subset of markers, based on values and time.

BVA in itself has Transformations > Others > Edit Markers that lets you

change type
change description

...but this seems mostly for bulk changes.


There is not a lot of processing on the markers themselves.

If, say, markers were processed from the raw trigger channels, and you want to change how, you are mostly out of luck.


That said, if you can express that change somehow, you can do it externally, in a few ways.


One of them is:

Export > Node Export > Markers (not to be confused with Solutions > Markers > Write Markers, which uses another format)
Transformations > Others > Import Markers > Import Markers from File

This uses a different format:

<Type>, <Description>, <Position>, <Length>, Channel

e.g.

Stimulus, S254, 207, 1, All

Where differences include:

  • no enumeration column (Mk1,Mk2,...)
  • channels use names instead of numbers; or 'All' to mean all

...so you could use other software to edit your markers.



https://pressrelease.brainproducts.com/markers/

Segmentation

Unsorted

Hyperscanning

Hyperscanning is a fancy term for recording from multiple participants, in a way that you can match up.

It does not refer to a specific method of doing so.




Electrodes