[Eeglablist] ICA Problem
Joseph Dien
jdien07 at mac.com
Tue Nov 12 20:34:50 PST 2013
If I understand your script correctly, you are including both mastoid channels in your ICA. The problem is that rereferencing to mean mastoids results in the two mastoid channels having a perfect -1 correlation (they are mirror images). ICA tends to blow up when such channels are included as the data matrix is singular. You need to exclude one of the mastoid channels. You’re not losing any information since they are redundant.
Cheers!
Joe
On Nov 8, 2013, at 12:58 PM, Walker Pedersen <wsp at uwm.edu> wrote:
> Hi,
>
> I am having trouble with ICA. I am using the script below to take continuous EEG data, rereference it to average mastoid, high-pass filter and then run ICA. The ICA appears to run and doesn't give me any errors, but when I try to plot the component maps I get the error "Not Enough Unique Sample Points". These data files are about 30 mins long, at a sampling rate of 512, so I don't think it is the case that there simply isn't enough data for the ICA.
>
> This data was collected through ANT's ASA software, and was imported into EEGlab using their ASA's import plugin. The import appears to be successful, as the data can be plotted in EEGlab and looks normal. We have other data in the lab collected with neuroscan, that we have used ICA on successfully so I am wondering if there is something wrong with the importing. Has anyone else run into this problem?
>
> For reference, we are using a 64 bit Linux system, Redhat 6.4. I am actually doing the importing on a 32 windows (xp), however, as the importer does not seem to work on the linux.
>
> Thanks!
>
> Walker
>
>
>
> % Clear memory and the command window
> clear
> clc
>
> % Initialize the ALLERP structure and CURRENTERP
> ALLERP = buildERPstruct([]);
> CURRENTERP = 0;
>
>
> % This defines the set of subjects
> subject_list = {'S2001'};
> nsubj = length(subject_list); % number of subjects
>
>
> %%%%%%%%%%%%% THIS PATH WILL NEED TO BE ADJUSTED FOR CLUSTER
> % I've used lookup for newChanLoc.elp, which
> % may funtion fine if it's on the path.
> home_path = '/media/LGI/WalkerEmoReg/';
>
> % Set the save_everything variable to 1 to save all of the intermediate files to the hard drive
> % Set to 0 to save only the initial and final dataset and ERPset for each subject
> save_everything = 0;
>
> % Set the plot_PDFs variable to 1 to create PDF files with the waveforms
> % for each subject (set to 0 if you don't want to create the PDF files).
> plot_PDFs = 1;
>
> % Loop through all subjects
> for s=1:nsubj
>
> fprintf('\n******\nProcessing subject %s\n******\n\n', subject_list{s});
> % Path to the folder containing the current subject's data
> data_path = [home_path subject_list{s} '/'];
> % Check to make sure the dataset file exists
> % Initial filename = path plus Subject# plus _EEG.set
> sname = [data_path subject_list{s} '_eeg.set'];
> if exist(sname, 'file')<=0
> fprintf('\n *** WARNING: %s does not exist *** \n', sname);
> fprintf('\n *** Skip all processing for this subject *** \n\n');
> else
> %
> % Load original dataset
> %
> fprintf('\n\n\n**** %s: Loading dataset ****\n\n\n', subject_list{s});
> EEG = pop_loadset('filename', [subject_list{s} '_eeg.set'], 'filepath', data_path);
>
> %
> % Populate channel locations
> %
> fprintf('\n\n\n**** %s: Adding channel location info ****\n\n\n', subject_list{s});
> EEG = pop_chanedit(EEG, 'lookup','ChannelLocs.ced');
> % Save dataset with _Chan suffix instead of _EEG
> EEG.setname = [subject_list{s} '_Chan']; % name for the dataset menu
> if (save_everything)
> EEG = pop_saveset(EEG, 'filename', [EEG.setname '.set'], 'filepath', data_path);
> end
>
> %
> % Rereferencing channels excluding
> %
> fprintf('\n\n\n**** %s: Rereferencing ****\n\n\n', subject_list{s});
> EEG = pop_reref( EEG, [13 19],'exclude',[33:36] );
> % Save dataset with _Chan suffix instead of _EEG
> EEG.setname = [subject_list{s} '_avgref']; % name for the dataset menu
> if (save_everything)
> EEG = pop_saveset(EEG, 'filename', [EEG.setname '.set'], 'filepath', data_path);
> end
>
>
> %
> % High-pass filter the EEG
> %
> fprintf('\n\n\n**** %s: High-pass filtering EEG at 0.05 Hz ****\n\n\n', subject_list{s});
> EEG = pop_basicfilter( EEG, 1:32 , 'Cutoff', 0.05, 'Design', 'butter', 'Filter', 'highpass', 'Order', 2, 'RemoveDC', 'on' );
> EEG.setname = [EEG.setname '_hpfilt'];
>
> if (save_everything)
> EEG = pop_saveset(EEG, 'filename', [EEG.setname '.set'], 'filepath', data_path);
> end
>
> %
> % BINICA
> %
> fprintf('\n\n\n**** %s: Running BINICA ****\n\n\n', subject_list{s});
> EEG = pop_runica(EEG, 'extended',1,'interupt','on');
> EEG.setname = [EEG.setname '_ica'];
> EEG = pop_saveset(EEG, 'filename', [EEG.setname '.set'], 'filepath', data_path);
>
> end % end of the "if/else" statement that makes sure the file exists
>
> end % end of looping through all subjects
>
> fprintf('\n\n\n**** FINISHED ****\n\n\n');
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
--------------------------------------------------------------------------------
Joseph Dien,
Senior Research Scientist
Maryland Neuroimaging Center
University of Maryland
E-mail: jdien07 at mac.com
Phone: 202-297-8117
http://joedien.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20131112/da22a625/attachment.html>
More information about the eeglablist
mailing list