<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div></div><div><br></div><div>P.S.: Below are the basic steps I use:</div><div><br></div><div><div>%% 2.1. Build individual BEM-Model</div><div>% First Realign Volume. Set Nas LPA, RPA, and positive z-values</div><div><br></div><div>cfg=[];</div><div>cfg.method='interactive';</div><div>cfg.coordsys = 'ctf';</div><div><br></div><div>mri_r = ft_volumerealign(cfg,mri);</div><div><br></div><div>cfg=[];</div><div><br></div><div>mri_rs = ft_volumereslice(cfg,mri_r);</div><div><br></div><div>%% Segment the individual volume</div><div>cfg=[];</div><div>cfg.output={'brain' 'scalp' 'skull'};</div><div>cfg.brainsmooth = 5;</div><div>cfg.scalpsmooth = 5;</div><div>cfg.brainthreshold = .5;</div><div>cfg.scalpthreshold = .1;</div><div>mri_s = ft_volumesegment(cfg,mri_rs);</div><div><br></div><div>%% Create Headmodel</div><div>cfg=[];</div><div>cfg.interactive = 'no';</div><div>cfg.numvertices = 1000;</div><div><br></div><div>bnd_s = ft_prepare_mesh(cfg,mri_s);</div><div><br></div><div>cfg=[];</div><div>cfg.method='dipoli'; %</div><div>cfg.conductivity=[0.3300 0.0041 0.3300];</div><div><br></div><div>vol_s = ft_prepare_headmodel(cfg,bnd_s);</div><div><br></div><div>cfg = [];</div><div>cfg.mri            = mri_s;</div><div>grid               = ft_prepare_sourcemodel(cfg);</div><div><br></div><div>grid.inside = find(grid.brain==1)';</div><div>grid.outside = find(grid.brain==0)';</div><div>grid.pos = grid.pos*10; % Set right dimensions</div><div><br></div><div>%% Align Electrodes</div><div>cfg=[];</div><div>cfg.method='interactive';</div><div>cfg.elec=elec_128;</div><div>cfg.headshape=vol_s.bnd(1);</div><div><br></div><div>elec_new=ft_electroderealign(cfg);</div><div><br></div><div>%% 4. Make the Leadfield.</div><div>elec_new.type='eeg';</div><div> </div><div>cfg=[];</div><div>cfg.channel = 1:126;</div><div>cfg.elec=elec_new;</div><div>cfg.vol=vol_s;</div><div>cfg.grid=grid;</div><div><br></div><div>lf = ft_prepare_leadfield(cfg);</div><div><br></div><div>%% BEAMFORMER </div><div><br></div><div>cfg=[];</div><div>cfg.channel=1:126;</div><div>cfg.method='lcmv'; %Time-Domain-Beamformer</div><div>cfg.grid=lf;</div><div>cfg.vol=vol_s; </div><div>cfg.elec=elec_new; </div><div>cfg.reducerank  = 3; </div><div>cfg.keepfilter='yes'; </div><div><br></div><div>beamfilter = ft_sourceanalysis(cfg, dat4beam);</div><div><br></div><div>%% Keep the cfg, just add the filter.</div><div><br></div><div>cfg.grid.filter = beamfilter.avg.filter; % Now we'll use the filter defined above</div><div><br></div><div>lcmv_bl = ft_sourceanalysis(cfg, bl_dat);</div><div>lcmv_act = ft_sourceanalysis(cfg, act_dat);</div></div><div><br></div><br><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 12px; ">********************</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><b>Dr. Julian Keil</b></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><b><br></b></div>AG Multisensorische Integration<br>Psychiatrische Universitätsklinik<br>der Charité im St. Hedwig-Krankenhaus<br>Große Hamburger Straße 5-11, Raum E 307<br>10115 Berlin</div><div><br>Telefon: +49-30-2311-1879<br>Fax:        +49-30-2311-2209 </div><div><a href="http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration">http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration</a></div></span>
</div>
<br></body></html>