[FieldTrip] ft_source2sparse usage for EEG data
gj
gina.joue at univr.it
Tue Apr 12 10:41:19 CEST 2016
Thank you for your help, Jan Mathijs!
These are all the related steps I did leading up to the ft_source2sparse
call, in case.
My input EEG data to FieldTrip are 2 seconds of passive visual
stimulation, preprocessed and averaged across all trials per condition
per subject in another software.
Thank you!
g
------------- begin snippet --------------
cfg = [];
cfg.method = 'mtmfft';
cfg.output = 'fourier';
cfg.keeptrials = 'yes';
cfg.tapsmofrq = 2;
cfg.foi = 12;
fft = ft_freqanalysis(cfg, data);
cfg = [];
cfg.output = {'brain','skull','scalp'};
mri_seg = ft_volumesegment(cfg, mri); % mri from standard_mri.mat (mm)
cfg=[];
cfg.tissue={'brain','skull','scalp'};
cfg.numvertices = [3000 1600 800];
mesh_hd=ft_prepare_mesh(cfg,mri_seg);
cfg = [];
cfg.method = 'bemcp';
headmodel = ft_prepare_headmodel(cfg, mesh_hd);
cfg = [];
cfg.grid.warpmni = 'yes';
cfg.grid.template = template_grid; % standard_sourcemodel3d10mm.mat
cfg.grid.nonlinear = 'yes';
cfg.mri = mri;
sourcemodel = ft_prepare_sourcemodel(cfg);
cfg = [];
cfg.elec = elecR; % elec realigned to standard_bem.mat
cfg.headmodel = headmodel; % output from ft_prepare_headmodel
cfg.grid = sourcemodel; % output from ft_prepare_sourcemodel
lf = ft_prepare_leadfield(cfg);
cfg = [];
cfg.frequency = fft.freq;
cfg.elec = elecR;
cfg.method = 'eloreta';
cfg.grid = lf;
cfg.vol = vol; % from standard_bem.mat
cfg.keeptrials = 'yes';
%cfg.rawtrial = 'yes';
source = ft_sourceanalysis(cfg, fft);
cfg = [];
cfg.projectmom = 'yes';
source_proj = ft_sourcedescriptives(cfg,source);
------------- end snippet --------------
More information about the fieldtrip
mailing list