GUI and Console Together#
EEGPrep is designed for a mixed interactive workflow. You can load and review
data from the GUI, inspect the live workspace in eegprep-console, run a
Python command, then return to the GUI without manually copying datasets between
tools.
The important idea is simple: the GUI and console are two views of one
EEGPrepSession.
When to Use This Workflow#
Use eegprep-console --full when you want to:
learn what each menu action does by reading
LASTCOM;inspect
EEGfields immediately after a dialog closes;try a Python command before committing it to a script;
compare multiple loaded datasets in
ALLEEG;review STUDY state while using Study menu actions;
keep a complete
ALLCOMhistory for a notebook, script, or lab record.
Use eegprep-gui --full only when you want a GUI-only session and do not
need live Python inspection.
Daily Workflow#
Start the shared session:
uv run eegprep-console --full
Then move between the GUI and console:
Load sample_data/eeglab_data.set with
File > Load existing dataset.
In the console, inspect EEG["data"].shape,
CURRENTSET, and LASTCOM.
Run pop_resample(EEG, 64) in the console.
Return to the GUI and open Plot > Channel data (scroll); the browser sees the resampled current dataset.
Open Tools > Filter the data from the GUI, press OK,
then inspect LASTCOM and ALLCOM[-3:].
Copy the useful commands into a script with explicit assignment.
What Stays Synchronized#
Name |
What it means |
How it updates |
|---|---|---|
|
Current dataset dictionary. |
GUI actions and console |
|
Loaded dataset list. |
Load, save-as-new, delete, clone, and dataset-selection actions go through session storage helpers. |
|
Current dataset selection, exposed as |
Dataset menu changes and console storage calls update the same value. |
|
Most recent replayable command string. |
Successful GUI actions and history-aware |
|
Chronological session command history. |
The session appends commands once, so GUI and console history stay in the same order. |
|
Current group-analysis state. |
Study menu actions and study |
|
Bundled and installed extension inventory. |
Extension Manager and plugin registry calls store the inventory on the shared session object. |
How EEGPrep Implements It#
EEGPrepSession is the single source of truth for interactive state. The main
window, menus, dialogs, help actions, dataset menus, Study workflows, Extension
Manager, and eegprep-console all read from and write to this session.
GUI actions should update state through session helpers such as
store_current(), add_history(), set_study(), and
notify_changed(). They should not mutate a GUI-only copy of EEG that
the console cannot see.
Long-running GUI actions use the same session boundary. For example,
GUI-launched ICA opens the EEGLAB-like pop_runica options dialog on the main
thread, runs the ICA computation behind a progress dialog, then stores the
updated dataset and history only after the worker finishes successfully. While
the worker is running, progress messages are buffered safely for
eegprep-console so the replayable command remains visible before related
output.
eegprep-console wraps registered pop_* functions. When a bare call such
as pop_resample(EEG, 64) returns a dataset and command string, the wrapper
stores the returned dataset, updates LASTCOM and ALLCOM, and tells the
GUI to refresh. This auto-store behavior belongs to eegprep-console because
it has a session to update.
Normal Python scripts keep normal Python semantics:
EEG, com = pop_resample(EEG, 64, return_com=True)
Use explicit assignment in scripts, notebooks, tests, and batch jobs.
History You Can Reuse#
After a GUI action:
print(LASTCOM)
for command in ALLCOM[-5:]:
print(command)
The recorded commands are meant to be readable and scriptable. When you move them out of the console, keep explicit return values:
EEG, com = pop_eegfiltnew(EEG, locutoff=1, hicutoff=40, return_com=True)
EEG, com = pop_resample(EEG, 64, return_com=True)
Practical Rules#
Prefer
eegprep-console --fullwhile learning or reviewing data.Use the GUI for inspection-heavy actions and the console for quick checks, summaries, and repeatable commands.
Do not edit
ALLEEGby hand in the console unless you are deliberately managing session state yourself.Use
return_com=Truewhen a command should appear in a reproducible script.Remember that GUI selectors are user-facing, while direct NumPy slicing is zero-based Python.
Save reviewed datasets explicitly; synchronized state is live session state, not a substitute for saving files.
Troubleshooting State#
If the GUI and console do not show what you expect, inspect:
CURRENTSET
EEG.get("setname")
EEG["data"].shape
LASTCOM
ALLCOM[-3:]
CURRENTSTUDY
If a menu item is disabled, the current dataset or STUDY probably lacks the
fields that workflow needs. For example, component-review menus need ICA fields,
and Study plotting menus need an active STUDY with precomputed measures.