eeglab2fieldtrip and planar

Montez, T. t.montez at VUMC.NL
Mon May 29 01:16:58 CEST 2006


Dear Fieldtrip experts,

I am using EEGLAB to do artifact rejection with ICA.

I export the file to fieldtrip with eeglab2fieldtrip,
but I had to make some changes to be able to compute the planar transformation
that you might want to include by default in the function:
- transform to single trial
- add the .grad 
- change data.label to column
- change data.trial to double

Best regards,
Teresa Montez





CODE:

[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
EEG = pop_loadset( 'filename', 'A004_ICA.set', 'filepath', 'E:\AD_Project\Results\');
[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0 );
eeglab redraw;

data = eeglab2fieldtrip( EEG, 'preprocessing' );

clear ALL* CURRENT* EEG LASTCOM STUDY 

cfg=[];
cfg.resamplefs = 125;
data_125 = resampledata (cfg, data);
clear data


% transform to single trial

data_125.trial2=[];

for i=1:37
data_125.trial2=[data_125.trial2 data_125.trial{i}];
end

data_125.trial={data_125.trial2};
clear data_125.trial2


data_125.time={[0:1/125:30339*(1/125)]};
data_125.offset=[1];

% import .grad from another dataset

cd E:\AD_Project\mca\Matlab\Controls\C002
load data_3_7
data_125.grad=data_3_7.grad;
clear data_3_7

% data.label must be column

data_125.label=data_125.label';

% data.trial must be double

data_125.trial{1}=double(data_125.trial{1});


cfg=[];
cfg.repair  = 'yes'
cfg.badchannel = {'MLT22'};
data_rp=megrepair(cfg,data_125)
clear data_125       
 
cfg=[];
cfg.planar  = 'yes'
cfg.planarmethod   = 'sincos';
data_p=megplanar(cfg,data_rp);
clear data_rp

save data_p data_p
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20060529/53371ed5/attachment.html>


More information about the fieldtrip mailing list