Skip to content

Fix command line execution, subject alignment and TFCE bootstrap shapes - #239

Merged
CPernet merged 4 commits into
masterfrom
codex/limo-command-line
Sep 9, 2026
Merged

CPernet merged 4 commits into
masterfrom
codex/limo-command-line

Conversation

@arnodelorme

@arnodelorme arnodelorme commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Fix the remaining command line blockers reproduced against current master at 8b7e7ca9b0f80bc2faa6826ccfc0363bdd098b09. The older repeated measures gp_val issue is already fixed upstream and is not patched again. This PR deliberately targets master, not the older default v4.2.1 branch.

Changes

Preserve an explicitly supplied STUDY through settings initialization. Handle absent or empty base workspace STUDY state for standalone contrasts. Derive subject output prefixes from the subject path instead of appending the directory tail. Fully specified batch calls default to command line completion feedback, and a missing contrast matrix raises an error instead of opening a dialog.

Normalize scalar nested filenames and ragged independent group lists without silently realigning paired observations. Preserve numeric channel vectors, including those loaded from MAT files. Support current subject prefixed R2 output and legacy output when selecting electrodes.

Preserve singleton channel dimensions in t statistic TFCE bootstrap arrays. The TFCE algorithm itself is unchanged.

Summary statistics now show progress windows and reopen the LIMO GUI only for the one argument interactive entry point. Complete command line calls return or save their results without those unsolicited windows. Progress updates use the intended window handle in interactive mode.

Plotting now stops when the supplied file list is exhausted instead of opening a file chooser for another file. Its variable option selects a variable instead of overwriting the input file list, and saved single condition subject data are indexed on the subject axis. Interactive file selection remains available when no list is supplied.

An absence of significant values with the noninteractive display flag now produces a console warning rather than a dialog. Result printing exports only a newly created result figure. It no longer risks saving or closing an unrelated open figure when a result has no significant effect to plot. Interactive notifications remain available.

Data alignment correction: forward iteration keeps subject data aligned with supplied regressors and channel vectors. Frame metadata, grouped data and repeated measures data now traverse subjects and groups consistently. Repeated measures optimized channels use the global subject index, not a per group index. This can change previously misaligned regression or grouped results, and should receive scientific review. Statistical estimators and bootstrap algorithms are not changed.

Validation

MATLAB R2025b with installed EEGLAB dependencies, synthetic data for 18 subjects. The original 27 regression cases produce 3 passes and 24 failures against unmodified current upstream. Nine additional summary, plotting and printing regressions produce one pass and eight failures against upstream. All 36 cases pass with this PR. They check returned and saved means, numerical plotted values, dialog free termination, preservation of existing figures and export of significant results.

Tests verify subject data values, paired alignment, numeric and file based channel vectors, group order, the existing trimmed mean numerical convention and every synthetic TFCE bootstrap map against direct calls to the unchanged TFCE implementation. Dialog functions are replaced by throwing sentinels. An unexpected dialog is a test failure, not an automatically accepted answer. Test fixtures and running instructions are in tests/README.md.

Real data validation completed OLS and WLS models and contrasts for all 18 Wakeman and Henson subjects. All nine integration groups pass with the final input ordering correction. An independent saved artifact audit confirms 22 second level configurations, 48 observed and null TFCE map pairs, and all 101 requested bootstrap samples. Direct comparisons of saved regression and repeated measures inputs confirm the expected order for all 18 subjects.

The full preprocessing workflow completed all stages for 18 subjects, including ASR, ICA, ICLabel, epoching, WLS, 1000 second level bootstrap samples, weighted and unweighted summaries, subject plots, contrasts, three one sample analyses, two difference plots and result printing. This was verified in stages, with downstream reruns from retained numerical outputs after fixing the discovered popup paths. It is not a claim of one final uninterrupted green wrapper run. An independent audit verifies all model and contrast references, bootstrap dimensions and summary artifacts. Printing completes with throwing dialog sentinels active, continues after a nonsignificant effect, and preserves an unrelated open figure. ICLabel used its built in MATLAB fallback after its accelerated code failed to compile locally.

The complementary EEGLAB test repository changes in sccn/eeglab_tests#13 correct stale test filenames and paths, retain outputs, and allow second level reruns from validated first level results. Related EEGLAB fixes: sccn/eeglab#955 and sccn/eeglab#956.

@arnodelorme
arnodelorme marked this pull request as ready for review September 8, 2026 03:36
@CPernet
CPernet merged commit 0b312a7 into master Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants