sccn / eeglab

EEGLAB is an open source signal processing environment for electrophysiological signals running on Matlab and developed at the SCCN/UCSD

Home Page:https://eeglab.ucsd.edu/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue when reading channel locations from Brainstorm file with empty SCS field

nguyen-td opened this issue · comments

Description

Similar to #761 but the current version throws the error Index exceeds the number of array elements. Index must not exceed 0. when the elocIn.SCS field is empty. I am trying to convert this Brainstorm chanlocs file into EEGLAB's chanlocs format.

Extending

if isfield(elocIn.SCS, chans{iChan})

by if isfield(elocIn.SCS, chans{iChan}) && ~isempty(elocIn.SCS.(chans{iChan})) will fix it.

Steps to Reproduce

  1. Download the Brainstorm chanlocs here
  2. Run readlocs('channel_BrainProducts_ActiCap_97.mat');

Versions

OS version macOS Sonoma 14.3
Matlab version R2024a
EEGLAB version dev

Thanks. This has been fixed in cf60b0a