[Eeglablist] Identity bad EEG channels without running the function on my EOG channels as well

Brancaleone, Paul paul-brancaleone at uiowa.edu
Mon Dec 22 12:08:56 PST 2025


Hello,

I am creating a script to process EEG/ERP data (here called "EEG"). At the step to identify "bad" channels, I have a script as follows:

 %STEP 6: auto-detect Bad Channels using clean_channels function

    %retain the original EEG structure as a backup
    origEEG=EEG;

    %save original channel list
    origChanList = transpose({EEG.chanlocs.labels});

    %remove bad channels
    EEG=clean_channels(EEG);

    %save new channel list
    newChanList = transpose({EEG.chanlocs.labels});

    %which channels were removed?
    myBadChan = setdiff(origChanList,newChanList);

    %save them out
    %BadChannelsFile = fullfile(DIR,[SUB{i}, '_Bad_Channels.csv']);
    %# write line-by-line
    fid = fopen([DIRout '/' SUB{i}, '_Bad_Channels.csv'],'wt');
    for myindex=1:size(myBadChan,1)
        fprintf(fid, '%s,%d,%d\n', myBadChan{myindex,:});
    end
    fclose(fid);
    %this file will go to output directory

My question is: channel numbers 29 and 30 out of 31 total channels are my VEOG and HEOG, respectively. Is there a way to run the clean_channels() function on the EEG data without running it on the EOG channels as well? I do not want to mark them as "bad" or interpolate them, but I can't find a way to tun this fucntion without running it on the entire EEG file with the EOGs included.

Paul J. Brancaleone, M.S.
PhD Candidate
Social Cognitive and Addiction Neuroscience Lab
University of Iowa, Iowa City, IA
pbrancaleone at uiowa.edu
https://urldefense.com/v3/__https://scan.lab.uiowa.edu/__;!!Mih3wA!AMXv-_ObBE26JZk4iUm0gVYVWLOSaOY8B8do2Tg-uHtZ_bRMgx3tvuoozNFoOsMkBYS5UA3zogiIFMGoe9x5fULopFHrbGwCyvo$ 


More information about the eeglablist mailing list