[FieldTrip] Activity not changing with time, SAM Beamforming
Torres, Efrain
efrain.torres at marquette.edu
Wed Mar 29 07:54:14 CEST 2017
When I plot my results using ft_sourceplot. My results do not seem to change despite changes in latency that I indicate through the configuration. Below is my code for SAM Beamformer of EEG data. I am unsure what I am doing wrong. Note that for preprocessing, it was previously done in EEGLab and imported into fieldtrip.
cfg.trialdef.eventtype='trigger';
cfg.trialdef.prestim=.2;
cfg.trialdef.poststim=.8;
cfg.trialdef.ntrials=50; %%This was changed to 1 from 64 to
cfg.dataset=rawEEG;
cfg=ft_definetrial(cfg)
cfg.continous='yes'
cfg.trialfun='ft_trialfun_general'
cfg.method='trial' %changed from channel to trial
PU74954_PL5=ft_preprocessing(cfg)
%% timelock analysis
cfg=[];
cfg.covariance='yes';
cfg.covariancewindow='poststim';
cfg.vartrllength=2;
timelock=ft_timelockanalysis(cfg,PU74954_PL5);
plot(timelock.time, timelock.avg);
%% headmodel
Subject01='/home/etorres/Desktop/HAL_Fieldtrip/Anatomy/PU7493_1/RAW/anat+orig.BRIK';
mri=ft_read_mri(Subject01);
cfg=[];
cfg.output='brain';
seg=ft_volumesegment(cfg, mri);
cfg = [];
cfg.method = 'singlesphere';
headmodel = ft_prepare_headmodel(cfg, seg);
%% Preparing the subject specific grid
%hdr=ft_read_header(PU74954_PL5);
cfg=[];
cfg.elec=PU74954_PL5.hdr.elec;
cfg.headmodel=headmodel;
cfg.grid.resolution=1;
cfg.grid.unit='cm';
%cfg.inwardshift=-1.5;
grid=ft_prepare_sourcemodel(cfg);
%% Creating the leadfield
cfg=[];
cfg.elec=PU74954_PL5.hdr.elec;
cfg.reducerank='3';
cfg.headmodel=headmodel;
cfg.grid=grid;
cfg.normalize='yes';
lf=ft_prepare_leadfield(cfg);
%% Source Analysis
cfg=[];
cfg.method='sam';
cfg.grid=lf;
cfg.headmodel=headmodel;
%cfg.keepfilter='yes';
cfg.lcmv.fixedori='yes';
source_avg=ft_sourceanalysis(cfg,timelock);
%% Plotting Results
mri = ft_read_mri(Subject01);
mri = ft_volumereslice([], mri);
cfg=[];
cfg.parameter='avg.pow';
[interp]=ft_sourceinterpolate(cfg,source_avg,mri);
cfg=[];
cfg.method='slice';
cfg.funcolorlim=[0 10];
cfg.nslices=25;
cfg.latency=-.1;
cfg.funcolormap='jet';
cfg.funparameter='avg.pow';
ft_sourceplot(cfg, interp);
Efrain Torres
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170329/3f56c986/attachment-0001.html>
More information about the fieldtrip
mailing list