[Eeglablist] using ica weights in Matlab

James Desjardins jdesjardins at brocku.ca
Sat Jun 25 09:32:18 PDT 2011


Hi Jeff,

I think that the problem is in your comp_acts line:

comp_acts = ica_weights * eeg


... it should be:

comp_acts = (ica_weights * ica_sphere) * eeg


... or using the EEG structure names:

EEG.icaact = (EEG.icaweights*EEG.icasphere)*EEG.data(EEG.icachansind,:);


This code is adapted from line 98 in Arno's eeg_getdataact.m. This is  
a function that you may find useful for your purposes.

You may also consider adjusting your memory options to "precompute ICA  
activations" this will store the equivalent of your "comp_acts" in  
EEG.icaact and you will not have to worry about that computation.

I hope this is helpful.

James Desjardins
Technician, MA Student
Department of Psychology, Behavioural Neuroscience
Cognitive and Affective Neuroscience Lab
Brock University
500 Glenridge Ave.
St. Catharines, ON, Canada
L2S 3A1
905-688-5550 x4676


Quoting Jeff Eriksen <eriksenj at ohsu.edu>:

> I am hoping to do some specialized processing in Matlab using the   
> icawinv and icaweights, part of the the ALLEEG Matlab structure.   
> First I tried to reconstruct the EEG with one component removed but   
> it did not look quite right. Next I decided to leave all components   
> in and see if I could construct all the component time courses and   
> then use them to reconstruct the whole EEG epoch. This did not come   
> out right either. To get the components, I do this:
>
> comp_acts = ica_weights * eeg
>
> Then to get the EEG back I do this:
>
> eeg-recon = icawinv * comp_acts
>
> But find that the reconstructed EEG does not quire match the   
> original EEG, and is much larger in amplitude as well.
>
> I must not be understanding fully what these matrices are.
>
> Thanks,
> -Jeff
>
>







More information about the eeglablist mailing list