[Eeglablist] ICA data rank calculation question

Hamza Imtiaz hm477041 at dal.ca
Sat Jun 29 12:53:24 PDT 2024


Hi,

I noticed several patients from a dataset I'm working on were dropped during preprocessing, specifically during the ICA (pop_runica). In the command window the last messages were:

Attempting to convert data matrix to double precision for more accurate ICA results.
Data rank (0) is smaller than the number of channels (19).
runica(): number of components must be 1 to 0.

I traced it back to the rank being calculated in the following lines:
tmpdata = reshape( EEG.data(g.chanind,:,:), length(g.chanind), EEG.pnts*EEG.trials);
tmprank = getrank(double(tmpdata(:,1:min(3000, size(tmpdata,2)))), pca_opt);
tmpdata = tmpdata - repmat(mean(tmpdata,2), [1 size(tmpdata,2)]); % zero mean

I'm wondering why tmprank is calculated in the first 3000 samples only? As it happened, a recording that failed the rank check had a 30 second period in the beginning where all electrodes readings didn't change, making them all parallel in the 3-D space. So, the rank of the data was 19 for the entire recording but 0 for the first 30 seconds. What are the implications of calculating rank on the entire data, rather than the first 3000 samples? Thank you in advance for your guidance.

Kind regards,
Hamza


More information about the eeglablist mailing list