<div dir="ltr"><div><div><div><div>Dear Simon,<br><br></div>Thank you very much for the answer, but I think that this code should<span class=""> "create the subject specific grid, using the template grid"</span> as specified in tutorial here <a href="http://www.fieldtriptoolbox.org/tutorial/sourcemodel">http://www.fieldtriptoolbox.org/tutorial/sourcemodel</a>.<br>"<br><pre class=""><span class="">% create the subject specific grid, using the template grid that has just been created</span>
cfg                = <span class="">[</span><span class="">]</span>;
cfg.<a title="" href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html"><span class="">grid</span></a>.<span class="">warpmni</span>   = <span class="">'yes'</span>;
cfg.<a title="" href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html"><span class="">grid</span></a>.<span class="">template</span>  = template_grid;
cfg.<a title="" href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html"><span class="">grid</span></a>.<span class="">nonlinear</span> = <span class="">'yes'</span>; <span class="">% use non-linear normalization</span>
cfg.<span class="">mri</span>            = mri;
cfg.<a title="" href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html"><span class="">grid</span></a>.<span class="">unit</span>      =<span class="">'mm'</span>;
<a title="" href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html"><span class="">grid</span></a>               = ft_prepare_sourcemodel<span class="">(</span>cfg<span class="">)</span>;</pre>I believe it "align/project" the template grid with individual mri using non-linear transformation.<br></div><div><br></div>Correct me if I'm wrong.<br>I'll be more than happy to get more comments on this.<br><br></div>Best Regards,<br></div>Olga.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 9, 2016 at 2:43 PM, Simon Homolle <span dir="ltr"><<a href="mailto:s.homolle@donders.ru.nl" target="_blank">s.homolle@donders.ru.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Dear Olga,<span class=""><div><blockquote type="cite"><div dir="ltr"><p style="margin-bottom:0in;line-height:12px">Should I use template or subject-specific headmodel with “projected to template grid individualized grid”?</p></div></blockquote></div><div><br></div></span><div>I would use the individual head model based on the MRI as it provides more information for your source analysis. This should provide more accurate results.</div><span class=""><div><br></div><div><blockquote type="cite"><div dir="ltr"><p style="margin-bottom:0in;line-height:12px">Actually I tried both ways for one subject and did not notice any difference in the results. </p></div></blockquote></div><div><br></div></span><div>It seems to that this is due to this line of code, but I’m not quite sure about that:</div><span class=""><div><br></div><div><blockquote type="cite"><div dir="ltr"><p style="margin-bottom:0in;line-height:12px"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt">cfg = [];</font></font></font></p><p style="margin-bottom:0in;line-height:12px"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt">cfg.grid.warpmni = 'yes';</font></font></font></p><p style="margin-bottom:0in;line-height:12px"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt">cfg.grid.template = template_grid;</font></font></font></p><p style="margin-bottom:0in;line-height:12px"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt">cfg.grid.nonlinear = 'yes'; % use non-linear normalization</font></font></font></p><p style="margin-bottom:0in;line-height:12px"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt">cfg.mri = mri_cm{Subj_i};</font></font></font></p><p style="margin-bottom:0in;line-height:12px"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt">grid_ind{Subj_i} = ft_prepare_sourcemodel(cfg);</font></font></font></p></div></blockquote></div><div><br></div></span><div>I think with this configuration the source model that is prepared is only based on the cfg.grid.template, and completely ignores the MRI (which you are interested in). This might explain why you see no difference.</div><div><br></div><div>Bests,</div><div><br><div>
Simon Homölle<br>PhD Candidate<br>Donders Institute for Brain, Cognition and Behaviour<br>Centre for Cognitive Neuroimaging<br>Radboud University Nijmegen<br>Phone: +31-(0)24-36-65059
</div>
<br><div><blockquote type="cite"><div><div class="h5"><div>On 09 Mar 2016, at 11:57, Olga Sysoeva <<a href="mailto:olga.v.sysoeva@gmail.com" target="_blank">olga.v.sysoeva@gmail.com</a>> wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr"><p style="margin-bottom:0in;line-height:100%">Pipeline for
sourceanalysis with individualize grip</p><p style="margin-bottom:0in;line-height:100%"><br>
</p><div style="margin-bottom:0in;line-height:100%">


        
        
        
        


<br></div><p style="margin-bottom:0in;line-height:100%">Dear field trippers,</p><p style="margin-bottom:0in;line-height:100%"><br>
</p><p style="margin-bottom:0in;line-height:100%">I have a question
related to pipeline for sourceanalysis with individualize grid.</p><p style="margin-bottom:0in;line-height:100%">Should I use
template or subject-specific headmodel with “projected to template
grid individualized grid”? Below is my pipeline with details of
what I mean.  Actually I tried both ways for one subject and did not
notice any difference in the results. Does it mean that I do not need
to constract headmodel for each subject? That's indeed save a lot of
time, but I'd like to get your green light on this.</p><p style="margin-bottom:0in;line-height:100%">Best Regards,</p><p style="margin-bottom:0in;line-height:100%">Olga.</p><p style="margin-bottom:0in;line-height:100%"><br>
</p><p style="margin-bottom:0in;line-height:100%">% 1. load template
grid, e.g. 
</p><p style="margin-bottom:0in;line-height:100%"><br>
</p><p style="margin-bottom:0in;line-height:100%"><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">load(</font></font></font><font color="#a020f0"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">'/net/server/mnt/programs/olgas/fieldtrip-20160119/template/sourcemodel/standard_sourcemodel3d10mm.mat'</font></font></font><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">);</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">template_grid
= sourcemodel;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><br>
</p><p style="margin-bottom:0in;line-height:100%"><a name="-1098129259_make_the_individual_subjects_grid"></a>
<font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">%2.
</font></font></font>Make the individual subjects' grid</p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">%a)
Load individual subject mri, e.g.</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><br>
</p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">[mri{Subj_i}]
= ft_read_mri(path_MRI{Subj_i});</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">mri_cm{Subj_i}
= ft_convert_units(mri{Subj_i}, 'cm');</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><br>
</p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">%</font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">b)</font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">
construct individual grid by projecting to template grid</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22">
</font><br>
</p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg
               = [];</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.grid.warpmni
  = 'yes';</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.grid.template
 = template_grid;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.grid.nonlinear
= 'yes'; % use non-linear normalization</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.mri
           = mri_cm{Subj_i};</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">grid_ind{Subj_i}
    = ft_prepare_sourcemodel(cfg);</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><br>
</p><p style="margin-bottom:0in;line-height:100%">% 3. Make source reconstruction, using individualized grid and<b> template? or individual
headmodel</b></p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">%</font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">a)
load template volume</font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">
load('/net/server/data/programs/olgas/fieldtrip-20160119/template/headmodel/standard_singleshell.mat');</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font color="#228b22">
<font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">template_vol
= vol;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><br>
</p><p style="margin-bottom:0in;line-height:100%"><font>
      <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg
            = [];</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.grid
       = grid_ind{Subj_i};</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
     </font><font>  <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2"><b>cfg.vol
        = vol_K0012_cm; </b></font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2"><b>%
</b></font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2"><b>individual</b></font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2"><b>
</b></font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2"><b>or
template </b></font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2"><b>vol???</b></font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.channel
    = {</font></font></font><font color="#a020f0"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">'MEG'</font></font></font><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">};</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.grad
       = freq_cmb{Subj_i}.grad;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">sourcemodel_lf_K0012
 = ft_prepare_leadfield(cfg, freq_cmb{Subj_i});</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
</font><br>
</p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg
                  = [];</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.frequency
        = freq_cmb{Subj_i}.freq;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.grad
             = freq_cmb{Subj_i}.grad;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.method
           = </font></font></font><font color="#a020f0"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">'dics'</font></font></font><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.keeptrials
       = </font></font></font><font color="#a020f0"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">'yes'</font></font></font><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
      </font><font> <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2"><b>cfg.grid
             = sourcemodel_lf{Subj_i}; % </b></font></font></font><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2"><b>sourcemodel
after leadfield with individual or template headmodel?</b></font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <b><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.vol
              = vol_K0012_cm; </font></font></b></font><b><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">%
</font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">individual</font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">
</font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">or
template </font></font></font><font color="#228b22"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">vol???</font></font></font></b></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.keeptrials
       = </font></font></font><font color="#a020f0"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">'yes'</font></font></font><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.dics.lambda
      = </font></font></font><font color="#a020f0"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">'5%'</font></font></font><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.dics.keepfilter
  = </font></font></font><font color="#a020f0"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">'yes'</font></font></font><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.dics.fixedori
    = </font></font></font><font color="#a020f0"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">'yes'</font></font></font><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">cfg.dics.realfilter
  = </font></font></font><font color="#a020f0"><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">'yes'</font></font></font><font><font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">;</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><font>
       <font face="lucidatypewriter, serif"><font style="font-size:10pt" size="2">source_K0012
             = ft_sourceanalysis(cfg, freq_cmb{Subj_i});</font></font></font></p><p style="margin-bottom:0in;line-height:100%"><br>
</p><p style="margin-bottom:0in;line-height:100%"><br>
</p>

</div></div></div>
_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div></blockquote></div><br></div></div><br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>