wonambi.widgets.channels module
Widget to define channels, montage and filters.
- class wonambi.widgets.channels.Channels(parent)[source]
Bases:
QWidget
Widget with information about channel groups.
- parent
the main window
- Type:
QMainWindow
- config
preferences for this widget
- Type:
- filename
file with the channel groups
- Type:
path to file
- groups
each dict contains information about one channel group
- Type:
list of dict
- tabs
Widget that contains the tabs with channel groups
- Type:
QTabWidget
- load_channels(checked=False, test_name=None)[source]
Load channel groups from file.
- Parameters:
test_name (path to file) – when debugging the function, you can open a channels file from the command line
- class wonambi.widgets.channels.ChannelsGroup(chan_name, group_name, config_value, s_freq)[source]
Bases:
QWidget
Tab inside the Channels widget.
- Parameters:
chan_name (list of str) – list of all the channels in the dataset
config_value (dict) – default values for the channels
s_freq (int) – sampling frequency (to define max of filter)
- chan_name
list of all the channels in the dataset
- Type:
list of str
- idx_l0
list with the channels to plot
- Type:
QListWidget
- idx_l1
list with the channels to use as reference
- Type:
QListWidget
- idx_hp
spin box to indicate the high-pass filter
- Type:
QDoubleSpinBox
- idx_lp
spin box to indicate the low-pass filter
- Type:
QDoubleSpinBox
- idx_scale
spin_box to indicate the group-specific scaling
- Type:
QDoubleSpinBox
- idx_reref
it triggers a selection of reference channels equal to the channels to plot.
- Type:
QPushButton
- idx_color
color of the traces beloning to this channel group (it could be a property of QWidget)
- Type:
QColor
Notes
TODO: re-referencing should be more flexible, by allowing other types of referencing.
Use config_value instead of config, because it’s easier to pass dict when loading channels montage.
- add_channels_to_list(l, add_ref=False)[source]
Create list of channels (one for those to plot, one for ref).
- Parameters:
l (instance of QListWidget) – one of the two lists (chan_to_plot or ref_chan)
- get_info()[source]
Get the information about the channel groups.
- Returns:
dict – information about this channel group
Notes
The items in selectedItems() are ordered based on the user’s selection (which appears pretty random). It’s more consistent to use the same order of the main channel list. That’s why the additional for-loop is necessary. We don’t care about the order of the reference channels.