eegprep.EEGPrepSession#
- class eegprep.EEGPrepSession(EEG=<factory>, ALLEEG=<factory>, CURRENTSET=<factory>, ALLCOM=<factory>, LASTCOM='', STUDY=None, CURRENTSTUDY=0, PLUGINLIST=<factory>)#
Bases:
objectEEGLAB-like GUI state without module globals.
- Parameters:
- __init__(EEG=<factory>, ALLEEG=<factory>, CURRENTSET=<factory>, ALLCOM=<factory>, LASTCOM='', STUDY=None, CURRENTSTUDY=0, PLUGINLIST=<factory>)#
Methods
__init__([EEG, ALLEEG, CURRENTSET, ALLCOM, ...])add_change_listener(listener)Register a callback that runs after session state changes.
add_command_echo_listener(listener)Register a callback for GUI commands to display in the console.
add_gui_action_listener(listener)Register a callback for GUI action start/end notifications.
add_history(command, *[, notify])Append an EEGLAB-style command to session history.
begin_gui_action(action)Notify listeners that a GUI action is about to run.
Clear all datasets and study state.
Return a deep copy of the current EEG selection.
Return the current EEG selection.
Return EEGLAB-style CURRENTSET scalar/list value.
Return
(index, label, selected)tuples for the Datasets menu.Delete the current dataset selection from memory.
echo_command(command)Display a GUI command without mutating session history.
end_gui_action(action)Notify listeners that a GUI action has finished.
gui_action(action)Wrap a user-triggered GUI action for console/output synchronization.
Mark the current dataset selection as saved in EEG and ALLEEG.
Return EEGLAB-style menu status tokens for the current state.
Notify listeners that session-backed state changed.
remove_change_listener(listener)Remove a previously registered session change callback.
remove_command_echo_listener(listener)Remove a previously registered command echo callback.
remove_gui_action_listener(listener)Remove a previously registered GUI action callback.
retrieve(indices)Select dataset(s) from ALLEEG using 1-based indices.
select_study(*[, command])Select the current STUDY set in the shared workspace.
Return the selected EEGLAB-facing dataset indices in order.
set_study(study[, alleeg, command])Set STUDY/CURRENTSTUDY and optionally replace loaded datasets.
store_current(eeg, *[, new, command, ...])Store
eegin ALLEEG and select it.Attributes
- add_change_listener(listener)#
Register a callback that runs after session state changes.
- Parameters:
listener (Callable[[EEGPrepSession], None])
- Return type:
None
- remove_change_listener(listener)#
Remove a previously registered session change callback.
- Parameters:
listener (Callable[[EEGPrepSession], None])
- Return type:
None
- add_command_echo_listener(listener)#
Register a callback for GUI commands to display in the console.
- remove_command_echo_listener(listener)#
Remove a previously registered command echo callback.
- add_gui_action_listener(listener)#
Register a callback for GUI action start/end notifications.
- remove_gui_action_listener(listener)#
Remove a previously registered GUI action callback.
- begin_gui_action(action)#
Notify listeners that a GUI action is about to run.
- Parameters:
action (str)
- Return type:
None
- end_gui_action(action)#
Notify listeners that a GUI action has finished.
- Parameters:
action (str)
- Return type:
None
- gui_action(action)#
Wrap a user-triggered GUI action for console/output synchronization.
- echo_command(command)#
Display a GUI command without mutating session history.
- Parameters:
command (str | None)
- Return type:
None
- notify_changed()#
Notify listeners that session-backed state changed.
- Return type:
None
- selected_dataset_indices()#
Return the selected EEGLAB-facing dataset indices in order.
- store_current(eeg, *, new=False, command='', mark_saved=False, index=None)#
Store
eegin ALLEEG and select it.
- retrieve(indices)#
Select dataset(s) from ALLEEG using 1-based indices.
- apply_workspace_state(*, eeg=<object object>, alleeg=<object object>, currentset=<object object>, allcom=<object object>, lastcom=<object object>, study=<object object>, currentstudy=<object object>, command='', append_dataset_history=False)#
Apply a GUI/console workspace update as one session transaction.
- delete_current()#
Delete the current dataset selection from memory.
- Return type:
None
- clear_all()#
Clear all datasets and study state.
- Return type:
None
- set_study(study, alleeg=None, *, command='')#
Set STUDY/CURRENTSTUDY and optionally replace loaded datasets.
- select_study(*, command='CURRENTSTUDY = 1')#
Select the current STUDY set in the shared workspace.
- Parameters:
command (str)
- Return type:
None
- add_history(command, *, notify=True)#
Append an EEGLAB-style command to session history.
- clear_history(*, notify=True)#
Clear command history and LASTCOM as one session mutation.
- Parameters:
notify (bool)
- Return type:
None
- remove_history(count, *, notify=True)#
Remove the most recent
countcommand-history entries.
- history_command_at(index)#
Return the 1-based command from most recent history first.
- clear_last_command(*, notify=True)#
Clear LASTCOM without deleting ALLCOM.
- Parameters:
notify (bool)
- Return type:
None
- mark_current_saved()#
Mark the current dataset selection as saved in EEG and ALLEEG.
- Return type:
None
- dataset_summaries()#
Return
(index, label, selected)tuples for the Datasets menu.