rereferencing

Module: missions.nodes.spatial_filtering.rereferencing

Change the reference of an EEG signal

Inheritance diagram for pySPACE.missions.nodes.spatial_filtering.rereferencing:

Inheritance diagram of pySPACE.missions.nodes.spatial_filtering.rereferencing

Class Summary

InvalidWindowException
LaplacianReferenceNode([selected_channels, ...]) Apply the Laplacian spatial filter
AverageReferenceNode([avg_channels, ...]) Rereference EEG signal against the average of a selected set of electrodes

Classes

InvalidWindowException

class pySPACE.missions.nodes.spatial_filtering.rereferencing.InvalidWindowException[source]

Bases: exceptions.Exception

__weakref__

list of weak references to the object (if defined)

LaplacianReferenceNode

class pySPACE.missions.nodes.spatial_filtering.rereferencing.LaplacianReferenceNode(selected_channels=None, l_type='small', **kwargs)[source]

Bases: pySPACE.missions.nodes.base_node.BaseNode

Apply the Laplacian spatial filter

It derives from the need of improving the spatial resolution of EEG. The signal recorded at each electrode is a combination of the brain activity immediately underneath it and of brain activity of neighboring areas.

The idea is to filter from each electrode the contribution coming from its neighbors. It can be applied using the nearest neighboring electrodes (small Laplacian: 4 channels) or nearest and next nearest neighboring electrodes (big Laplacian: 8 channels).

The number of electrodes of the returned time series is reduced: each electrode that has less than 4 (or 8 when the big Laplacian is applied) neighbors is excluded.

References

   
author Hjorth, Bo
title An on-line transformation of EEG scalp potentials into orthogonal source derivations
journal Electroencephalography and Clinical Neurophysiology
year 1975
volume 39
number 5
pages 526–530
doi 10.1016/0013-4694(75)90056-5

Parameters

l_type:

type of Laplacian applied, e.g. ‘small’ or ‘big’

(optional, default: ‘small’)

selected_channels:
 

A list of channel names for which the filter should be applied. If None, all channels are considered.

(optional, default: None)

Exemplary Call

-
    node: LaplacianReference
    parameters:
        l_type: 'big'
Author:

Laura Manca (laura.manca89@gmail.com)

Created:

20013/09/24

POSSIBLE NODE NAMES:
 
  • Laplacian_Reference
  • LaplacianReference
  • LaplacianReferenceNode
POSSIBLE INPUT TYPES:
 
  • TimeSeries

Class Components Summary

_execute(data)
calc_distance_matrix(data[, distFunc]) Compute the distance matrix from the dictionary StreamDataset.ec
compute_laplacian(data) Compute the Laplacian
input_types
__init__(selected_channels=None, l_type='small', **kwargs)[source]
calc_distance_matrix(data, distFunc=<function <lambda>>)[source]

Compute the distance matrix from the dictionary StreamDataset.ec

StreamDataset.ec maps the coordinates of each electrode and to the respective electrode name.

compute_laplacian(data)[source]

Compute the Laplacian

\text{filtered data}_{i} =
\text{data}_{i}*\text{number of neighbours} -
\sum_{i} \text{neighbours of data}_{i}
\text{with } i = EEG channel

The channels that are at the borders or close to Ref are excluded

_execute(data)[source]
input_types = ['TimeSeries']

AverageReferenceNode

class pySPACE.missions.nodes.spatial_filtering.rereferencing.AverageReferenceNode(avg_channels=None, keep_average=False, old_ref=None, inverse=False, **kwargs)[source]

Bases: pySPACE.missions.nodes.base_node.BaseNode

Rereference EEG signal against the average of a selected set of electrodes

This node computes for every time step separately the average of a selected set of electrodes (avg_channels) and subtracts this average from each channel. It thus implements a kind of average rereferencing.

Parameters
avg_channels:

the channels over which the average is computed

(optional, default: all available channels)

keep_average:

Whether the average should be added as separate channel.

(optional, default: False)

inverse:

Determine whether avg_channels are the channels over which the average is computed (inverse=False) or the channels that are ignored when calculating the average.

(optional, default: False)

old_ref:

This is the old reference channel name usually used during recording as a reference. After re-referencing and if keep_average is set to true, this name will be used for the appended channel. If keep_average is true, but old_ref is not specified, name of the appended channel will be “avg”.

Exemplary call

-
    node : Average_Reference
    parameters : 
        avg_channels : ["C3","C4"]
        keep_average : False
        inverse : True
        old_ref : "Fcz"
Author:

Jan Hendrik Metzen (jhm@informatik.uni-bremen.de)

Created:

2009/09/28

Revised:

2013/03/25 Foad Ghaderi (foad.ghaderi@dfki.de)

For more details see:
 

http://sccn.ucsd.edu/wiki/Chapter_04:_Preprocessing_Tools

POSSIBLE NODE NAMES:
 
  • Average_Reference
  • AverageReferenceNode
  • AverageReference
POSSIBLE INPUT TYPES:
 
  • TimeSeries

Class Components Summary

_execute(data)
input_types
__init__(avg_channels=None, keep_average=False, old_ref=None, inverse=False, **kwargs)[source]
_execute(data)[source]
input_types = ['TimeSeries']