[Eeglablist] How to set filename and filepath of a given dataset

Pierre Vigneron pvigneron at parisnanterre.fr
Sun Nov 20 04:53:02 PST 2022


Hello the Eeglablist,

I'm new in eeglab and there is something that I don't understand.

I want to load 10 .bdf files stored in the same directory and load them 
in 10 eeglab datasets. I want this to be executed from script only (and 
not from the GUI).

Here's my script so far :

data_path = '/home/pierre/data/eeg/'
[ALLEEG EEG CURRENTSET ALLCOM] = eeglab('nogui');
filenames = dir([data_path, '*bdf']);
for k=1:length(filenames)
EEG = pop_biosig([data_path, filenames(k).name]);
[ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, k-1, 'setname', 
filenames(k).name, 'gui', 'off');
end

It seems ok but the different eeg datasets have their fields 'filename' 
and 'filepath' empty.. I guess that theses fields should correspond to 
the original bdf file, so they should be (respectively) set to 
"/home/pierre/data/eeg/" and filenames(k).name.

I read the pop_biosig() or pop_newset() descriptions and such field does 
not seem to be easily added.

Do you know how I could add these fields while loading the datasets ?

Besides, do you see any improvements in my reading functions ?

Thanks a lot,


BR


Pierre

--
*Pierre Vigneron, PhD*
Ingénieur de Recherche mutualisé Modyco <https://urldefense.com/v3/__https://modyco.fr__;!!Mih3wA!HzfcxFyWMnXVJQCuELKddJDilsD0M_IujyGfkC3M41r1LUXTA0fFdP0X17PfQPvLeXYSU1xdxUh2D0Hdl2moeIfPrLzimG8$ > / EconomiX 
<https://urldefense.com/v3/__https://economix.fr__;!!Mih3wA!HzfcxFyWMnXVJQCuELKddJDilsD0M_IujyGfkC3M41r1LUXTA0fFdP0X17PfQPvLeXYSU1xdxUh2D0Hdl2moeIfP4pG5xaw$ >
Université de Paris Nanterre
/Cette semaine, je suis situé dans les locaux de EconomiX (bâtiment 
Allais, bureau R02A)/
signature générée le dim. 20 nov. 2022 12:35:53 CET



More information about the eeglablist mailing list