Skip to content

Unable to rereference to the average reference and add back online ref in 2026.0.0 #944

@kelseyfrewin

Description

@kelseyfrewin

Description

Since upgrading to 2026.0.0, I have been unable to re-reference to the average AND add back the online reference. This is using code that I've been using in EEGLAB for the past 2 years and nothing has changed in my pipeline or my data.

When trying to re-ref to the average and add back the ref channels (whether via script or GUI) the following error is received:

Error using pop_reref (line 393)
Missing reference channel information. Edit channels and add reference first.

This occurs even when the online ref channel has been appended in advance and the ref channel has been set.

Please find link to a minimal working example script in MATLAB and example dataset: https://ueanorwich-my.sharepoint.com/:f:/g/personal/qbb22eku_uea_ac_uk/IgBLeBSQr0H7R6xcjzR0ogpeAaXQQCTYZC1_ypPzJHYCvuk?e=OB3RMm


### Steps to Reproduce

%read in
EEG = pop_loadset( 'filename', 'ERYK.set', 'filepath', Path2ParentFolder);

% Set the online ref, append channel for online ref (ready for re-referencing)

% add channel for the online reference (FCz)
EEG = pop_chanedit(EEG, 'append',63,'changefield',{64,'labels','FCz'});

% find channel location
EEG = pop_chanedit(EEG, 'lookup', filechanloc);

% set FCz as reference (to be added as a channel when re referenced
EEG = pop_chanedit(EEG, 'setref',{'1:64','FCz'});

EEG = eeg_checkset(EEG);

% re-ref to the average rereference and add back FCz
EEG = pop_reref( EEG, [],'refloc',struct('labels',{'FCz'},'type',{''},'theta',{0.7867}, ...
'radius',{0.095376},'X',{27.39},'Y',{-0.3761},'Z',{88.668},'sph_theta',{-0.7867}, ...
'sph_phi',{72.8323},'sph_radius',{92.8028},'urchan',{65},'ref',{''}, ...
'datachan',{0}));

Error using pop_reref (line 393)
Missing reference channel information. Edit channels and add reference first.


#### Expected behavior: Re-referenced to average and FCz back to the data.
#### Actual behavior: Receive error saying that the ref has been set in the data.
#### Versions
OS version MacOS Tahoe 26.4.1 (25E253)
Matlab version 2024b
EEGLAB version 2026.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions