[Eeglablist] What to do with more than one IC per subject in a cluster
Tarik S Bel-Bahar
tarikbelbahar at gmail.com
Thu Mar 14 17:24:33 PDT 2013
Hello,
Here below is an example of some code that used to work when I had to
merge ICs in the past,
So I am not sure if it still works.
A standardized solution would be useful.
If possible, any followup thoughts from Makoto or Arno would be nice.
For the time being, I hope it's a step in the right direction.
IC1=1;IC2=3;
% normalize scalp maps (columns of W^-1) to have same sign
sgn = sign(corr(EEG.icawinv(:,IC1),EEG.icawinv(:,IC2)));
% average the scalp maps
EEG.icawinv(:,IC1) = (EEG.icawinv(:,IC1) + sgn*EEG.icawinv(:,IC2))/2;
EEG.icawinv(:,IC2) = [];
% recompute weights and sphering matrix % note that we assume
icaweights= W*Q where Q is the "true" sphering % matrix (who's
information is already contained in icawinv = W^-1=A)
EEG.icaweights = pinv(EEG.icawinv); EEG.icasphere = eye(EEG.nbchan);
% recompute ICA activations (S = W*X)
EEG.icaact = EEG.icaweights*EEG.data(:,:); EEG.icaact =
reshape(EEG.icaact,size(EEG.icaact,1),EEG.pnts,EEG.trials);
[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 2 ); eeglab redraw
More information about the eeglablist
mailing list