<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>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. </p>
<p><br>
</p>
<p></p>
<div>cfg.trialdef.eventtype='trigger';</div>
<div>cfg.trialdef.prestim=.2;</div>
<div>cfg.trialdef.poststim=.8;</div>
<div>cfg.trialdef.ntrials=50;  %%This was changed to 1 from 64 to </div>
<div>cfg.dataset=rawEEG;</div>
<div><br>
</div>
<div>cfg=ft_definetrial(cfg)</div>
<div><br>
</div>
<div>cfg.continous='yes'</div>
<div>cfg.trialfun='ft_trialfun_general'</div>
<div>cfg.method='trial' %changed from channel to trial </div>
<div><br>
</div>
<div>PU74954_PL5=ft_preprocessing(cfg)</div>
<div><br>
</div>
<div>%% timelock analysis</div>
<div><br>
</div>
<div>cfg=[];</div>
<div>cfg.covariance='yes';</div>
<div>cfg.covariancewindow='poststim';</div>
<div>cfg.vartrllength=2;</div>
<div>timelock=ft_timelockanalysis(cfg,PU74954_PL5); </div>
<div><br>
</div>
<div>plot(timelock.time, timelock.avg);  </div>
<div><br>
</div>
<div>%% headmodel</div>
<div><br>
</div>
<div>Subject01='/home/etorres/Desktop/HAL_Fieldtrip/Anatomy/PU7493_1/RAW/anat+orig.BRIK';</div>
<div><br>
</div>
<div>mri=ft_read_mri(Subject01); </div>
<div>cfg=[];</div>
<div>cfg.output='brain';</div>
<div>seg=ft_volumesegment(cfg, mri); </div>
<div><br>
</div>
<div>cfg = [];</div>
<div>cfg.method = 'singlesphere'; </div>
<div>headmodel = ft_prepare_headmodel(cfg, seg);</div>
<div><br>
</div>
<div>%% Preparing the subject  specific grid </div>
<div>%hdr=ft_read_header(PU74954_PL5);</div>
<div>cfg=[];</div>
<div>cfg.elec=PU74954_PL5.hdr.elec;</div>
<div>cfg.headmodel=headmodel;</div>
<div>cfg.grid.resolution=1;</div>
<div>cfg.grid.unit='cm';</div>
<div>%cfg.inwardshift=-1.5;</div>
<div>grid=ft_prepare_sourcemodel(cfg); </div>
<div><br>
</div>
<div>%% Creating the leadfield </div>
<div><br>
</div>
<div>cfg=[];</div>
<div>cfg.elec=PU74954_PL5.hdr.elec;</div>
<div>cfg.reducerank='3';</div>
<div>cfg.headmodel=headmodel;</div>
<div>cfg.grid=grid;</div>
<div>cfg.normalize='yes';</div>
<div>lf=ft_prepare_leadfield(cfg); </div>
<div><br>
</div>
<div>%% Source Analysis </div>
<div><br>
</div>
<div>cfg=[];</div>
<div>cfg.method='sam';</div>
<div>cfg.grid=lf;</div>
<div>cfg.headmodel=headmodel;</div>
<div>%cfg.keepfilter='yes';</div>
<div>cfg.lcmv.fixedori='yes';</div>
<div>source_avg=ft_sourceanalysis(cfg,timelock);</div>
<div><br>
</div>
<div>%% Plotting Results </div>
<div><br>
</div>
<div>mri = ft_read_mri(Subject01);</div>
<div>mri = ft_volumereslice([], mri);</div>
<div><br>
</div>
<div>cfg=[];</div>
<div>cfg.parameter='avg.pow';</div>
<div>[interp]=ft_sourceinterpolate(cfg,source_avg,mri); </div>
<div><br>
</div>
<div>cfg=[];</div>
<div>cfg.method='slice';</div>
<div>cfg.funcolorlim=[0 10];</div>
<div>cfg.nslices=25;</div>
<div>cfg.latency=-.1;</div>
<div>cfg.funcolormap='jet'; </div>
<div>cfg.funparameter='avg.pow';</div>
<div>ft_sourceplot(cfg, interp);</div>
<br>
<p></p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<p style="font-size:16px"><span style="font-family:'Times New Roman',Times,serif; background-color:rgb(255,255,255)">Efrain Torres</span></p>
<p style="font-size:16px; background-color:rgb(255,255,255)"><font face="Times New Roman, Times, serif"></font></p>
</div>
</div>
</div>
</body>
</html>