[Eeglablist] Importing Brain Vision Recorder data files automatically

Andreas Widmann widmann at uni-leipzig.de
Wed Feb 7 09:23:40 PST 2018


Hi Shingo,

you were already close. pop_loadbv needs the file path as first argument. In case of the current directory a '.' is sufficient. If you want to load the data into the GUI you will additionally need a pop_newset command. In case you continue processing on the command line/script this is not necessary.

Hope this helps! Best,
Andreas

allfiles = dir('*.vhdr');
for n=1:length(allfiles)
    loadName=allfiles(n).name;
    dataName=loadName(1:end-5)
    
    % Step2: Import data.
    EEG = pop_loadbv('.', loadName);
    %    EEG.setname = dataName;
    [ALLEEG EEG CURRENTSET] = pop_newset( ALLEEG, EEG, CURRENTSET, 'setname', dataName )
end
eeglab redraw

> Am 07.02.2018 um 17:37 schrieb 時本真吾 <tokimoto at mejiro.ac.jp>:
> 
> Dear EEGLAB users,
> 
> I would like to process my EEG data files recorded by Brain Vision Recorder with batch codes. As many of you know, EEG data files by Brain Vision Recorder consist of three files with different suffixes, namely, eeg, vhdr, and vmrk. A pop-up menu appears and two clicks are required to import the vhdr file. Could anyone tell me the way to import multiple vhdr files automatically without a click. My batch codes at the beginning are as follows:
> 
> allfiles = dir('*.vhdr');
> for n=1:length(allfiles) 
> loadName=allfiles(n).name; 
> dataName=loadName(1:end-4); 
> 
>    % Step2: Import data.
>    EEG = pop_loadbv(loadName);
>    EEG.setname = dataName;
> 
> Thank you in advance.
> 
> Sincerely,
> 
> ******************************************
> Shingo Tokimoto, Ph.D.
> in Linguistics and Psychology
> Department of Foreign Languages
> Mejiro University
> 4-31-1, Naka-Ochiai, Shinjuku, Tokyo,
> 161-8539, Japan
> tokimoto at mejiro.ac.jp
> ******************************************
> 
> _______________________________________________
> 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
> 




More information about the eeglablist mailing list