wonambi.trans.montage module
- wonambi.trans.montage.compute_average_regress(x, idx_chan)[source]
Take the mean across channels and regress out the mean from each channel
- Parameters:
x (ndarray) – 2d array with channels on one dimension
idx_chan – which axis contains channels
- Returns:
ndarray – same as x, but with the mean being regressed out
- wonambi.trans.montage.create_virtual_channel(data, new_chan_name='virtual', method='average')[source]
Create a virtual channel by averaging several channels.
- Parameters:
data (instance of DataRaw) – the data to filter
new_chan_name (str) – label for the virtual channel
method (str) – ‘average’
- Returns:
mdata (instance of Data) – virtual data
- wonambi.trans.montage.montage(data, ref_chan=None, ref_to_avg=False, bipolar=None, method='average')[source]
Apply linear transformation to the channels.
- Parameters:
data (instance of DataRaw) – the data to filter
ref_chan (list of str) – list of channels used as reference
ref_to_avg (bool) – if re-reference to average or not
bipolar (float) – distance in mm to consider two channels as neighbors and then compute the bipolar montage between them.
method (str) – ‘average’ or ‘median’ or ‘regression’. ‘average’ / ‘median’ takes the mean / median across the channels selected as reference (it can be all) and subtract it from each channel. ‘regression’ keeps the residuals after regressing out the mean across channels.
- Returns:
filtered_data (instance of DataRaw) – filtered data
Notes
If you don’t change anything, it returns the same instance of data.