[Eeglablist] ICA at Script Level

James Desjardins jdesjardins at brocku.ca
Wed Oct 13 13:45:01 PDT 2010


Hi Ed,

I have not used this function before but I think that it may just be a  
matter of specifying the second output as EEG.icasphere (rather than  
EEG.sphere).

> [EEG.icaweights EEG.icasphere] = runicalowmem(reshape(EEG.data,   
> EEG.nbchan, EEG.trials*EEG.pnts));


... if you still have EEG.sphere in memory you could just try the  
following (rather than rerunning the ICA):

>> EEG.icasphere = EEG.sphere;
>> eeglab redraw;

I hope that this helps.

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 "Modestino, Edward J *HS" <EJM9F at hscmail.mcc.virginia.edu>:

> Dear EEGLAB experts,
>
> If you have a background in EEGLAB scripting and can help me with   
> this, I would greatly appreciate this.
>
>
>
> I have been referring to this, but not able to solve the problem:   
> http://sccn.ucsd.edu/wiki/Chapter_02:_Writing_EEGLAB_Scripts
>
>
>
> Recently, I have had great trouble running ICA on my data using the   
> GUI due to memory constraints.  We have not been able to fix this   
> otherwise.  So, I have moved to the script level using a low memory   
> script level version of ICA.  I load my dataset into the GUI and   
> then run the script through the GUI.  Here is the script I have been  
>  using.
>
>
>
> [EEG.icaweights EEG.sphere] = runicalowmem(reshape(EEG.data,   
> EEG.nbchan, EEG.trials*EEG.pnts));
>
> EEG = eeg_checkset(EEG);
>
> [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
>
> eeglab redraw;
>
>
>
> Here is the command window output:
>
> "Input data size [62,1048575] = 62 channels, 1048575 frames
>
> Finding 62 ICA components using logistic ICA.
>
> Decomposing 272 frames per ICA weight ((3844)^2 = 1048575 weights,   
> Initial learning rate will be 0.000157494, block size 70.
>
> Learning rate will be multiplied by 0.9 whenever angledelta >= 60 deg.
>
> More than 32 channels: default stopping weight change 1E-7
>
> Training will end when wchange < 1e-007 or after 512 steps.
>
> Online bias adjustment will be used.
>
> Removing mean of each channel ...
>
> Final training data range: -2048.65 to 1315.39
>
> Computing the sphering matrix...
>
> Starting weights are the identity matrix ...
>
> Sphering the data ...
>
> Beginning ICA training ...
>
> Warning: Using 'state' to set RAND's internal state causes RAND,   
> RANDI, and RANDN
>
> to use legacy random number generators.
>
>> In runicalowmem at 896
>
>   In pop_runscript at 50
>
> step 1 - lrate 0.000157, wchange 5985964.09709237, angledelta  0.0 deg
>
> .
>
> .
>
> .
>
> step 127 - lrate 0.000000, wchange 0.00000008, angledelta 50.9 deg
>
> Sorting components in descending order of mean projected variance ..."
>
>
>
>
>
> It appears from the command window that ICA ran on the data.    
> However, the current loaded dataset that ICA was run on says there   
> are no ICA weights (GUI attached).  When I go to plot components, it  
>  says ICA needs to be run first.  So, clearly it ran but did not  
> save  the ICA to the dataset.
>
>
>
> I thought that this following command would overwrite the variables   
> in the workspace: [ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG,   
> CURRENTSET);
>
>
>
> I thought this following command would update the display in the   
> GUI: eeglab redraw;
>
>
>
> However, this is not working.
>
> Please help me if you can.
> Thanks,
> Ed Modestino
>
> Edward Justin Modestino, Ph.D.
> Postdoctoral Research Associate
> Ray Westphal Neuroimaging Laboratory
> Division of Perceptual Studies
> Department of Psychiatry and Neurobehavioral Sciences
> University of Virginia
> Email: ejm9f at virginia.edu
>
>






More information about the eeglablist mailing list