<div dir="ltr"><p class="MsoNormal"><span lang="EN-US">Dear Fieldtrip experts,<span></span></span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal"><span lang="EN-US">I would like to run ft_sourceanalysis as shown in the Appendix 1 here: <a href="http://www.fieldtriptoolbox.org/tutorial/coherence">http://www.fieldtriptoolbox.org/tutorial/coherence</a><span></span></span></p><p class="MsoNormal"><br></p>

<p class="MsoNormal"><span lang="EN-US">ft_sourceanalysis requires head model as a parameter.  I don’t have mri images for my MEG subjects (measured with 306 channel Elekta Neuromag system) and, therefore, I would need to use a template head model or a template MRI. I think that I should use a local spheres volume conduction model as suggested here: <a href="http://www.fieldtriptoolbox.org/tutorial/headmodel_meg">http://www.fieldtriptoolbox.org/tutorial/headmodel_meg</a>.<span></span></span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal"><span lang="EN-US">Could someone please let me know if standard_mri.mat is the file that I should use?<span></span></span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal"><span lang="EN-US">I created a head model using standard_mri.mat and following the instructions here: <a href="http://www.fieldtriptoolbox.org/tutorial/headmodel_meg">http://www.fieldtriptoolbox.org/tutorial/headmodel_meg</a><span></span></span></p><p class="MsoNormal"><br></p>

<p class="MsoNormal"><span lang="EN-US">I first created the head model for the example data and checked whether I can get the same result as in the example (Appendix 1: <a href="http://www.fieldtriptoolbox.org/tutorial/coherence">http://www.fieldtriptoolbox.org/tutorial/coherence</a>).  <span></span></span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal"><span lang="EN-US">However, the result doesn’t seem to be correct:<span></span></span></p><p class="MsoNormal"><span lang="EN-US"><img src="cid:ii_j69o7m2s0_15dd7d5617260ded" width="472" height="354"><br>​<br></span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal"><span lang="EN-US">Could someone please let me know what I am doing wrong?</span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal"><span lang="EN-US">Many thanks already in advance if you can help!<span></span></span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p>

<p class="MsoNormal"><span lang="EN-US">Best,<span></span></span></p>

<p class="MsoNormal"><span lang="EN-US">Maria<span></span></span></p><p class="MsoNormal"><span lang="EN-US"><br></span></p><p class="MsoNormal"><span lang="EN-US">Here is the scrip that I have tested:<span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">hdr = ft_read_header(</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">' C:\Users\Maria\Documents\filedtrip\fieldtrip-20170620\SubjectCMC.ds'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">);</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">grad = hdr.grad;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">load(</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'standard_mri.mat'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">);</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">load(</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'freq.mat'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">)</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg           = [];</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.output    = </span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'brain'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">segmentedmri  = ft_volumesegment(cfg, mri);</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg                       = [];</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.grad                  = hdr.grad;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.feedback              = false;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.method                = </span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'localspheres'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">vol                       = ft_prepare_headmodel(cfg,segmentedmri);</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg = [];</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">mri = ft_volumereslice(cfg, mri);</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg                 = [];</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.method          = </span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'dics'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.refchan         = </span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'EMGlft'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.frequency       = 18;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.hdmfile         = vol;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.inwardshift     = 1;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.grid.resolution = 1;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.grid.unit       = </span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'cm'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">source              = ft_sourceanalysis(cfg, freq);</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg            = [];</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.parameter  = </span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'coh'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.downsample = 2;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">interp         = ft_sourceinterpolate(cfg, source, mri);</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black"> </span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg              = [];</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.method       = </span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'ortho'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.interactive  = </span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'yes'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">cfg.funparameter = </span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:rgb(160,32,240)">'coh'</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span lang="EN-US" style="font-size:10pt;font-family:"Courier New";color:black">figure; ft_sourceplot(cfg, interp);</span><span lang="EN-US" style="font-size:12pt;font-family:"Courier New""><span></span></span></p></div>