[Eeglablist] Problems with scripting

wibral at mpih-frankfurt.mpg.de wibral at mpih-frankfurt.mpg.de
Mon Jan 22 06:44:25 PST 2007


Dear Listusers,

I have the following problemes with EEGLAB (or rather it's Matlab's
fault but I'd be interested in a workaround). I am using MATLAB R2006b
on Red Hat Enterprise Linux 64 bit. The GUI works stable for a short
while, but repeated calls to diffrent datasets or a couple of ICA
decompositions make it fail (as do many other leghtish calculations that
are not part of EEGLAB). This gets better (of course) if I start without
the desktop. But to avoid the chrashes I really need to start without
the jvm.
I therefore tried to do everything by scripting. However, the following
code failed to  save the channel  location and rereferencing
information, but curiously enough it saved the ICA weights, any ideas?
(b.t.w. I can't use the standard [ALLEEG EEG Currentset]=eeglab; as I
immedeatly get a crash because of the call to the gui there...)

%%%%%%%%%%%%%%%%%%%CODE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%clear all;
SubjectFileNames={
    'jn_wm_p3.vhdr'
    'kb_wm_p3_2.vhdr' %eeg data missing!
    'mc_wm_p3.vhdr'
    'mm_wmp3_140304.vhdr'
    'ns_wm_p3.vhdr'
    'pu_wm_p3.vhdr'
    'rc_wm_p3.vhdr'
    'ta_mw_p3_64e.vhdr'
    'vv_wm_p3.vhdr'
    };
ELPFileNames={
    'jn_wm_p3.elp'
    'kb_wm_p3_2.elp'
    'mc_wm_p3.elp'
    'mm_wmp3_140304.elp'
    'ns_wm_p3.elp'
    'pu_wm_p3.elp'
    'rc_wm_p3.elp'
    'ta_mw_p3_64e.elp'
    'vv_wm_p3.elp'
    }

if ~(length(SubjectFileNames)==length(ELPFileNames))
    disp('Non matching number of header and electrodes files!
Exiting!');
    return
end

for n=1:length(SubjectFileNames)
    dispStr=strcat('Processing subject #: ', num2str(n));
  sp(dispStr)
    %%%%%%%%%%%%%%%%%%%%%%%%EEGLAB part
   if n>1
clear EEG;
end
 
EEG = pop_loadbv('/home/wibral/Projects/ICADIPOLE/raw_63/',
SubjectFileNames{n}, 1, [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63]);
EEG.setname=SubjectFileNames{n};
EEG=pop_chanedit(EEG,  'load',{
strcat('/home/wibral/Projects/ICADIPOLE/raw_63/',ELPFileNames{n}),...
    'filetype', 'besa'});
EEG = pop_select( EEG, 'channel',[2:63] ); % Do not use data from  
%channel 1 = 'VEOG' and 64='REF' (empty)
EEG = reref( EEG, [], 'refstate','common');
EEG=pop_runica(EEG, 'icatype','fastica','approach','symm', 'g', 'tanh')
EEG = eeg_checkset( EEG);
NewFileName=strcat(SubjectFileNames{n},'_EEGonly_RR_ICA.set');
EEG.setname=NewFileName; 
save(NewFileName, 'EEG');
end
%%%%%%%%%%%%%%%END of CODE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I would also appreciate any suggestions about the best Linux 64 bit
distribution to run MATLAB R2006b, as RHEL4/CentOS4 is a real nightmare
(countless jvm and glibc issues).

Michael Wibral



More information about the eeglablist mailing list