Rereferencing¶
Subtract the average of some reference data.
The two most common use cases of this are a) re-referencing of EEG/EMG, where one or more channels are averaged, and the result is subtracted from all channels, and b) baseline removal, where the average in some baseline time window is taken, and subtracted from the whole time period. The range can be given either as a list of values (e.g., indices or channel names in single quotes), formatted as [value1, value2, ...], or as a range expression of the form start:stop, where all successive indices beginning with start and up to one prior to stop are included. This node also supports robust averaging using the median, which can be useful for robust re-referencing, where one or more channels are particularly noisy. Alternatively, instead of specifying a data range from the current data packet to use as reference, you can use data from another packet fed into this node through the reference_data port. This reference data must have the same shape as the data to be subtracted from except along the axis to be rereferenced. Version 1.1.0
Ports/Properties¶
data¶
Data to process.
reference_data¶
Reference data to subtract
axis¶
Axis along which to take the reference or baseline.
reference_range¶
Data range to use as reference / baseline. When the space axis is used (standard re-referencing), this is typically a channel range, e.g. ':' or ['TP8', 'TP9'] or 'Chn1':'Chn10', and the reference unit is set to 'names'. When the time axis is used (baseline removal), this is typically the baseline time window in seconds, e.g., -0.2:0.0. If [] (empty list), the data is not rereferenced.
reference_unit¶
Unit in which the reference range is given. Depending on the axis, different units are applicable, e.g., names for space, seconds for time, indices for any axis.
estimator¶
Estimator to use. Mean is the standard choice, median is a robust alternative (tolerates, e.g., bad channels) and trim_mean is a robust alternative which does not inlcude the outliers in the mean calculation.
cut_prop¶
Fraction of the outliers to cut off for trim_mean option.
use_separate_reference¶
If checked, the range property will be ignored and the data in the reference_data port will be used instead. The reference_data tensor must include the axis selected above, and be the same size as the data except along the selected axis.
verbose¶
Set to false to suppress warnings that rereferencing was not performed (no reference data, data is wrong shape, etc.) .
ignore_nans¶
Ignore nan values in the data.
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.