[Eeglablist] Adaption of Makoto's batch code to preprocess multiple subjects

Makoto Miyakoshi mmiyakoshi at ucsd.edu
Tue Dec 20 18:20:11 PST 2016


Dear Claudio,

> EEG.data(end+1, :, :) = zeros(1, EEG.pnts, EEG.trials); %just accounting
for the 3rd dimension

Sure, this seems right.

> % Adjust data rank for ICA
> g.chanind = 1:EEG.nbchan; %based on computing the rank within 'pop_runica'
> tmpdata = reshape(EEG.data(g.chanind, :,:), length(g.chanind),
EEG.pnts*EEG.trials);
> tmprank = getrank(double(tmpdata(:,1:min(3000, size(tmpdata,2)))));

I am not quite sure, but generally speaking for this rank calculation you
can collapse data dimension in this way

data = EEG.data;
tmpData = data(:,:);
rank(tmpData')

Maybe your code works fine too, I'm not saying your approach is wrong.
If you encounter any problem please let me know. Good luck!

Makoto



On Wed, Dec 14, 2016 at 5:42 AM, Claudio Georgii <
Claudio.Georgii at stud.sbg.ac.at> wrote:

> Dear  eeglablist,
>
> the original batch code (https://sccn.ucsd.edu/wiki/
> Makoto%27s_useful_EEGLAB_code#Example_of_batch_code_to_
> preprocess_multiple_subjects) uses continous data and we thought about
> adapting the code to use it for epoched data.
> This works fine for most of the code, but the "re-referencing" and "adjust
> data rank for ICA" section. Because the dimensionality of the data matrix
> is now 3D instead of 2D (due to the trial information)
>
> Thus, I wanted to ask, whether the adaptions we made are correct (changes
> marked in blue):
>
> % Re-reference to average
> EEG.nbchan = EEG.nbchan+1;
> EEG.data(end+1, :, :) = zeros(1, EEG.pnts, EEG.trials); %just accounting
> for the 3rd dimension
> EEG.chanlocs(1,EEG.nbchan).labels = 'initialReference';
> EEG = pop_reref( EEG, []);
> EEG = pop_select(EEG, 'nochannel', {'initialReference'});
>
> and more importantly:
> % Adjust data rank for ICA
> g.chanind = 1:EEG.nbchan; %based on computing the rank within 'pop_runica'
> tmpdata = reshape(EEG.data(g.chanind, :,:), length(g.chanind),
> EEG.pnts*EEG.trials);
> tmprank = getrank(double(tmpdata(:,1:min(3000, size(tmpdata,2)))));
> channelSubset = loc_subsets(EEG.chanlocs, tmprank);
> EEG = pop_select( EEG,'channel', channelSubset{1});
> EEG = pop_chanedit(EEG, 'eval','chans = pop_chancenter( chans, [],[]);');
>
> In addition, in our case 'getrank' gives consistently the following
> warning:
>
> Warning: fixing rank computation inconsistency (56 vs 55) most likely
> because running under Linux 64-bit Matlab
>
> We online average reference (during our recording). Might this produce
> this warning message and thus can be 'ignored'?
>
> Thank you very much for your help, in advance!
>
> Best,
> Claudio
> --
> Claudio Georgii, MSc.
> Phd student
> University of Salzburg - Department of Psychology
> Eating Behavior Laboratory
> Hellbrunnerstraße 34
> 5020 Salzburg - Austria
>
> Phone: 0043- (0)662 8044 5164
> E-Mail: claudio.georgii at sbg.ac.at
>
> _______________________________________________
> 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
>



-- 
Makoto Miyakoshi
Swartz Center for Computational Neuroscience
Institute for Neural Computation, University of California San Diego
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20161220/300587e1/attachment.html>


More information about the eeglablist mailing list