Repository navigation
Fix command line execution, subject alignment and TFCE bootstrap shapes - #239
Merged
Merged
Conversation
This was referenced Sep 8, 2026
arnodelorme
marked this pull request as ready for review
September 8, 2026 03:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Fix the remaining command line blockers reproduced against current
masterat8b7e7ca9b0f80bc2faa6826ccfc0363bdd098b09. The older repeated measuresgp_valissue is already fixed upstream and is not patched again. This PR deliberately targetsmaster, not the older defaultv4.2.1branch.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
variableoption 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.