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:

ConfigChannels

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

apply()[source]

Apply changes to the plots.

color_group(checked=False, test_color=None)[source]

Change the color of the group.

create()[source]

Create Channels Widget

create_action()[source]

Create actions related to channel selection.

del_group()[source]

Delete current group.

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

new_group(checked=False, test_name=None)[source]

Create a new channel group.

Parameters:
  • checked (bool) – comes from QAbstractButton.clicked

  • test_name (str) – used for testing purposes to avoid modal window

Notes

Don’t call self.apply() just yet, only if the user wants it.

read_group_info()[source]

Get information about groups directly from the widget.

reset()[source]

Reset all the information of this widget.

save_channels(checked=False, test_name=None)[source]

Save channel groups to file.

update(self)[source]
update(self, QRect) None
update(self, QRegion) None
Channels.update(self, int, int, int, int) -> None
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.

highlight_channels(l, selected_chan)[source]

Highlight channels in the list of channels.

Parameters:

selected_chan (list of str) – channels to indicate as selected.

rereference()[source]

Automatically highlight channels to use as reference, based on selected channels.

class wonambi.widgets.channels.ConfigChannels(update_widget)[source]

Bases: Config

Widget with preferences in Settings window for Channels.

create_config()[source]

Placeholder: it’ll be replaced with actual layout.