wonambi.widgets.notes module
Widgets containing notes (such as markers, events, and stages).
bookmarks are unique (might have the same text), are not mutually exclusive, have variable duration
events are not unique, are not mutually exclusive, have variable duration
stages are not unique, are mutually exclusive, have fixed duration
Todo
maybe it’s better to disable options related to annotations, but it’s a bit too complicated. If you do that, you can remove all “if self.annot is None” that are marked with “# remove if buttons are disabled”
- class wonambi.widgets.notes.ConfigNotes(update_widget)[source]
Bases:
Config
Widget with preferences in Settings window for the Annotations.
- class wonambi.widgets.notes.ExportEventsDialog(parent)[source]
Bases:
QDialog
Dialog for choosing export dataset options.
- class wonambi.widgets.notes.MergeDialog(parent)[source]
Bases:
QDialog
Dialog for specifying which events to merge. Events are merged when less than a minimum interval separates them. Events can be within-channel only or both within- and across-channel. Merged to channel with longest event.
- parent
the main window
- Type:
instance of QMainWindow
- idx_evt_type
List of event types.
- Type:
QListWidget
- merge_to
Current text in idx_merge_to
- Type:
str
- class wonambi.widgets.notes.Notes(parent)[source]
Bases:
QTabWidget
Widget that contains information about sleep scoring.
- parent
the main window.
- Type:
instance of QMainWindow
- config
preferences for this widget
- Type:
- annot
contains the annotations made by the user
- Type:
- idx_marker
table with the markers in the dataset
- Type:
QTableWidget
- idx_summary
layout of the “Summary” tab (we add and remove the “Recap” box)
- Type:
QVBoxLayout
- idx_annotations
push button with the text of the annotation file
- Type:
QPushButton
- idx_rater
name of the current rater
- Type:
QLabel
- idx_stats
layout of the stage statistics
- Type:
QFormLayout
- idx_eventtype_scroll
area to which you add the QGroupBox with the list of events as checkbox
- Type:
QScrollArea
- idx_eventtype_list
list of checkboxes with the event types
- Type:
list of QCheckBox
- idx_annot_list
table with the bookmarks and events in the annotations
- Type:
QTableWidget
- idx_eventtype
Combo box of the event types for the toolbar
- Type:
QComboBox
- idx_stage
Combo box of the stages for the toolbar
- Type:
QComboBox
- idx_quality
Combo box of signal quality (good/poor) for the toolbar
- Type:
QComboBox
- add_bookmark(time)[source]
Run this function when user adds a new bookmark.
- Parameters:
time (tuple of float) – start and end of the new bookmark, in s
- change_event_type(new_name=None, name=None, time=None, chan=None)[source]
Action: change an event’s type.
- detect_events(data, method, params, label)[source]
Detect events and display on signal.
- Parameters:
data (instance of ChanTime) – one segment with all channels of interest
method (str) – Method used for detection.
params (dict) – Parameters used for detection.
label (str) – Name of event type, on event labels
- enable_events()[source]
enable slow wave and spindle detection if both annotations and channels are active.
- find_row(ev_start, ev_end)[source]
Highlight event row in table from start and end time.
- Parameters:
ev_start (float) – start time, in seconds from record start
ev_end (float) – end time, in seconds from record start
- Returns:
int – index of event row in idx_annot_list QTableWidget
- get_cycle_mrkr(end=False)[source]
Mark cycle start or end.
- Parameters:
end (bool) – If True, marks a cycle end; otherwise, it’s a cycle start
- get_selected_events(time_selection=None)[source]
Returns which events are present in one time window.
- Parameters:
time_selection (tuple of float) – start and end of the window of interest
- Returns:
list of dict – list of events in the window of interest
- go_to_marker(row, col, table_type)[source]
Move to point in time marked by the marker.
- Parameters:
row (QtCore.int) –
column (QtCore.int) –
table_type (str) – ‘dataset’ table or ‘annot’ table, it works on either
- import_events(source='wonambi')[source]
action: import events from text file (Wonambi or RemLogic).
- import_fasst(checked=False, test_fasst=None, test_annot=None)[source]
Action: import from FASST .mat file
- import_staging(source, staging_start=None, as_qual=False, test_filename=None, test_rater=None)[source]
Action: import an external sleep staging file.
- Parameters:
source (str) – Name of program where staging was exported. One of ‘alice’, ‘compumedics’, ‘domino’, ‘remlogic’, ‘sandman’.
staging_start (datetime, optional) – Absolute time when staging begins.
as_qual (bool) – if True, scores will be imported as quality
- remove_bookmark(time)[source]
User removes bookmark.
- Parameters:
time (tuple of float) – start and end of the new bookmark, in s
- rename_eventtype(test_name=None, test_new_name=None)[source]
action: create dialog to rename event type.
- rename_rater(test_name=None, test_new_name=None)[source]
action: create dialog to rename event type.
- select_rater(rater=False)[source]
Action: select one rater.
- Parameters:
rater (str) – name of the rater
- toggle_check_all_eventtype()[source]
Check ‘All’ if all event types are checked in event type scroll.
- update_annotations()[source]
Update annotations made by the user, including bookmarks and events. Depending on the settings, it might add the bookmarks to overview and traces.
- update_dataset_marker()[source]
Update markers which are in the dataset. It always updates the list of events. Depending on the settings, it might add the markers to overview and traces.