Common channel file and scripting

hey,
I have a common channel file for a given subject with 3D position (.xyz).
I import it in Common files and I edit "MRI registration" to project channels on scalp.
Then I import, using gui, EEG data (.set) which have not 3D positions in the EEGlab file and I answer "no" to "delete existing channel file" and I keep my 3D position as defined in Common files.

But if I try to import EEG data by scripting:

sFiles = bst_process('CallProcess', 'process_import_data_time', sFiles, [], ...
    'subjectname', 'pil53', ...
    'condition',    'BaselineConcat', ...
    'datafile',     {RawFiles, 'EEG-EEGLAB'}, ...
    'timewindow',   [], ...
    'split',        0, ...
    'ignoreshort',  1, ...
    'channelalign', 1, ...
    'usectfcomp',   1, ...
    'usessp',       1, ...
    'freq',         [], ...
    'baseline',     []);

It modifies my channel file in "Common Files" and I loose the 3D positions:


How could I fix it by scripting, please?

Hi @Francois
Maybe my message isn't enough clear?
Regards

Sorry for the response delay.

The proper way to do this is to first link the EEG dataset to the database, and then call the process Add EEG positions. As illustrated in the EEG/Epilepsy tutorial:

Note that using "Common channel files" is not recommended anymore: