<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Dear all, </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I am still working on computing the leadfield using MNI templates to create ROIs. My recent work has been focused on translating the MEG tutorial to EEG. Anyway, I am really confused with the results I am obtaining, I have some concerns and I would be grateful if somebody could help me on this topic. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">1. I started preparing the sourcemodel with a EEG headmodel, using the code below:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">vol = </font></i></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">  struct with fields:</font></i></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">     bnd: [1×3 struct]</font></i></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">    cond: [0.3300 0.0041 0.3300]</font></i></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">     mat: [3000×3000 double]</font></i></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">    type: 'dipoli'</font></i></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">    unit: 'mm'</font></i></div></blockquote></blockquote><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1"><br></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1" color="#274e13"><b>                        <i>cfg = [];<br>                        cfg.grid.xgrid          = [-90 : 5 : 90];  <br>                        cfg.grid.ygrid          = [-115: 5 : 85];<br>                        cfg.grid.zgrid          = [-70 : 5 : 100];  <br>                        cfg.tight  = 'yes';<br>                        cfg.headmodel   = vol;<br>                        template_grid   = ft_prepare_sourcemodel(cfg);<br>                        template_grid = ft_convert_units(template_grid,'mm');</i></b></font><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1" color="#274e13"><b><i><br></i></b></font></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1"><br></font></i></div></blockquote></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">template_grid = </font></i></div></blockquote></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">  struct with fields:</font></i></div></blockquote></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">       dim: [29 37 30]</font></i></div></blockquote></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">       pos: [32190×3 double]</font></i></div></blockquote></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">      unit: 'mm'</font></i></div></blockquote></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">    inside: [32190×1 logical]</font></i></div></blockquote></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">       cfg: [1×1 struct]</font></i></div></blockquote></div></blockquote><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">And I obtained quite good results: </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><img src="cid:ii_jw1p7dxm0" alt="image.png" width="212" height="198" style="margin-right: 0px;"></div></div></blockquote></blockquote><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">2. Then I use a typical MNI template from Fieldtrip, called ROI_MNI_v4.nii to create the mask for selecting the ROIs:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1">atlas = </font></div></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1">  struct with fields:</font></div></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1">            dim: [91 109 91]</font></div></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1">            hdr: [1×1 struct]</font></div></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1">      transform: [4×4 double]</font></div></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1">           unit: 'mm'</font></div></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1">         tissue: [91×109×91 double]</font></div></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1">    tissuelabel: {1×116 cell}</font></div></blockquote></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1">       coordsys: 'mni'</font></div></blockquote></div></blockquote></blockquote><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1">     <b><font color="#274e13">   <i>  atlas = ft_read_atlas('ROI_MNI_v4.nii');</i></font></b></font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1" color="#274e13"><b><i>                        atlas = ft_convert_units(atlas,'mm');</i></b></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1" color="#274e13"><b><i>                        cfg = [];</i></b></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1" color="#274e13"><b><i>                        cfg.atlas      = atlas;</i></b></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1" color="#274e13"><b><i>                        cfg.roi        = atlas.tissuelabel;  </i></b></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1" color="#274e13"><b><i>                        cfg.inputcoord = 'mni';</i></b></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1" color="#274e13"><b><i>                        mask           = ft_volumelookup(cfg, template_grid);</i></b></font></div></blockquote><b><font color="#274e13"><i><font face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">                                      </span></font><font size="1">% create temporary mask according to the atlas entries<br></font></i></font></b><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1" color="#274e13"><b><i>         <span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span>t<span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span>mp                  = repmat(template_grid.inside,1,1);</i></b></font></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1" color="#274e13"><b><i>                <span class="gmail_default" style="font-family:arial,helvetica,sans-serif">      </span>  tmp(tmp==1)          = 0;<br>             <span class="gmail_default" style="font-family:arial,helvetica,sans-serif">     </span>      tmp(mask)            = 1;<br>                   <span class="gmail_default" style="font-family:arial,helvetica,sans-serif">     </span>% define inside locations according to the atlas based mask<br>                  <span class="gmail_default" style="font-family:arial,helvetica,sans-serif">     </span>  template_grid.inside = tmp;</i></b></font><font face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><b><font color="#274e13"><i></i></font></b></span><br></font></blockquote><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><img src="cid:ii_jw1pgag61" alt="image.png" width="224" height="183" style="margin-right: 0px;"></div></div></blockquote></blockquote><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">3. After, I computed the sourcemodel using previous templete grid and standard_mri.mat file.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><font size="1">mri = </font></div></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><font size="1">  struct with fields:</font></div></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><font size="1">          dim: [181 217 181]</font></div></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><font size="1">        xgrid: [1×181 double]</font></div></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><font size="1">        ygrid: [1×217 double]</font></div></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><font size="1">        zgrid: [1×181 double]</font></div></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><font size="1">      anatomy: [181×217×181 uint8]</font></div></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><font size="1">    transform: [4×4 double]</font></div></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><font size="1">          hdr: [1×1 struct]</font></div></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><font size="1">         unit: 'mm'</font></div></div></blockquote></blockquote></blockquote><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1" color="#274e13"><b> <i>mri = ft_read_mri('standard_mri.mat');</i></b></font></div></blockquote></blockquote><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1" color="#274e13"><b><i>                              cfg                = [];<br>                              cfg.template  = template_grid;<br>                               cfg.mri            = mri;<br>                             sourcemodel        = ft_prepare_sourcemodel(cfg);</i></b></font><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1" color="#274e13"><b><br></b></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#274e13">4. Also used a headmodel:</font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#274e13"><br></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">                      <font size="1">  <span style="font-family:Arial,Helvetica,sans-serif">hdm = ft_read_mri('headmodel_eeg.mat'); %read the headmodel</span><font color="#274e13"><br></font></font></div><font size="1">                       <span class="gmail_default" style="font-family:arial,helvetica,sans-serif">       </span> hdm         = ft_convert_units(hdm, 'mm');<br>                       <span class="gmail_default" style="font-family:arial,helvetica,sans-serif">       </span>sourcemodel = ft_convert_units(sourcemodel, 'mm');</font><div><font size="1"><br></font></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font size="1"><i><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span>hdm = </i></font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>  struct with fields:</i></font></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>             bnd: [1×3 struct]</i></font></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>            cond: [0.3333 0.0167 0.3333]</i></font></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>    skin_surface: 3</i></font></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>          source: 1</i></font></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>             mat: [1000×6000 double]</i></font></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>            type: 'bemcp'</i></font></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>            unit: 'mm'</i></font></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font size="1"><i>             cfg: [1×1 struc</i></font>t]<font size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span><br></font></div></blockquote></blockquote><div><div><font size="1"><br></font><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div><img src="cid:ii_jw1pqfsq3" alt="image.png" width="224" height="204" style="margin-right: 0px;"></div></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div>But as you can see, I do not match a perfect alineation, I try to apply volume align using fidutials but that was not the solution. On the other hand, I am not transforming the electrodes to ROIs I still have electrode data. What can I do to solve this error?. </div><div><br></div></div></blockquote></blockquote><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">5. Finally I compute the leadfield as follows:</span></font></div><div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></span></font></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1"><i><span style="font-family:Arial,Helvetica,sans-serif">sourcemodel = </span></i></font></div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>  struct with fields:</i></font></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>       pos: [7942×3 double]</i></font></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>       dim: [19 22 19]</i></font></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>    inside: [7942×1 logical]</i></font></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><font size="1"><i>      unit: 'mm'</i></font></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font size="1"><i><span style="font-family:Arial,Helvetica,sans-serif">       cfg: [1×1 struct]</span></i></font></div></blockquote></blockquote></blockquote><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px">                <i><font size="1" color="#274e13"><b><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span>   cfg                 = [];<br>                        cfg.vol        = hdm;                          <br>                        cfg.reducerank = 3; % I am working with EEG data<br>                        cfg.sourcemodel  = sourcemodel;<br>                        leadfield = ft_prepare_leadfield(cfg, data);<br><br></b></font></i></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><i><font size="1"><font color="#274e13"><b><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span></b></font>leadfield = </font></i></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><i><font size="1">  struct with fields:</font></i></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><i><font size="1">                pos: [7942×3 double]</font></i></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><i><font size="1">                dim: [19 22 19]</font></i></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><i><font size="1">             inside: [7942×1 logical]</font></i></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><i><font size="1">               unit: 'mm'</font></i></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><i><font size="1">                cfg: [1×1 struct]</font></i></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><i><font size="1">          leadfield: {1×7942 cell}</font></i></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><i><font size="1">              label: {128×1 cell}</font></i></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><i><font size="1">    leadfielddimord: '{pos}_chan_ori'</font><font size="1" color="#274e13"><b><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span><br></b></font></i></blockquote></blockquote></blockquote><i><font size="1" color="#274e13"><b>                   </b></font></i></div><div><font color="#274e13" style=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thank you very much in advance, </span></font></div><div><font color="#274e13"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></span></font></div><div><font color="#274e13"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></span></font></div><div><font color="#274e13"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></span></font></div><div><font color="#274e13"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></span></font></div><div><font color="#274e13" style=""><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">Irene</span>     <br></font><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El jue., 23 may. 2019 a las 11:37, Irene Varela Leniz (<<a href="mailto:irene.varela@alumni.mondragon.edu">irene.varela@alumni.mondragon.edu</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Dear Tzvetan, </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El jue., 23 may. 2019 a las 9:22, Tzvetan Popov (<<a href="mailto:tzvetan.popov@uni-konstanz.de" target="_blank">tzvetan.popov@uni-konstanz.de</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="ltr"></div><div dir="ltr">Dear Irene,</div><div dir="ltr">This is not going to work.</div><div dir="ltr">1. The headmodel is expressed in units of ‘m’ and aligned to the 4D/bti MEG coordinates. This has nothing to do with your EEG electrode positions.</div><div dir="ltr">2. As you already anticipated the type of headmodel is not appropriate for EEG source analysis.</div><div dir="ltr"><br></div><div dir="ltr">I recommend the following:</div><div dir="ltr">1. Work out the tutorial with the provided data. </div><div dir="ltr">2. Go thru it again and try to internalize the order of the analysis steps.</div><div dir="ltr">3. Switch to an EEG source analysis tutorial. Use the provided data there and try to understand the key differences. For example here: <a href="http://www.fieldtriptoolbox.org/workshop/natmeg/dipolefitting/" target="_blank">http://www.fieldtriptoolbox.org/workshop/natmeg/dipolefitting/</a></div><div dir="ltr">Or also here <a href="http://www.fieldtriptoolbox.org/workshop/aarhus/beamformingerf/" target="_blank">http://www.fieldtriptoolbox.org/workshop/aarhus/beamformingerf/</a></div><div dir="ltr">4. Go back and try to merge the two tutorials to reflect your needs.</div><div dir="ltr"><br></div><div dir="ltr">Good luck</div><div dir="ltr">Tzvetan </div><div dir="ltr"><br>Am 23.05.2019 um 08:55 schrieb Irene Varela Leniz <<a href="mailto:irene.varela@alumni.mondragon.edu" target="_blank">irene.varela@alumni.mondragon.edu</a>>:<br><br></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Dear both, </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">You are right. I thought I was working with the latest version but I did not know that another more recent one had been released on April 19th. Anyway, what I could see investigating inside the function is that they have changed the way to configure the cfg in the function, right?<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">The function is not able to understand the cfg that I am configuring. I must mention that in my case, I am working with EEG, so for example the configuration of lcmv.reducerank I had to change it to 3. Anyway I get the following error related to the cfg:<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">                      <i>  cfg                 = [];</i></span><i><br style="font-family:Arial,Helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">                        cfg.label         = data.label;</span><br style="font-family:Arial,Helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">                        cfg.elec          = data.elec;</span><br style="font-family:Arial,Helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">                        cfg.vol         = hdm;</span><br style="font-family:Arial,Helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">                        cfg.lcmv.reducerank = 3; % I am working with EEG data</span><br style="font-family:Arial,Helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">                        cfg.normalize           = 'yes'</span><br style="font-family:Arial,Helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">                        cfg.grid = sourcemodel;</span><br style="font-family:Arial,Helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">                        [grid] = ft_prepare_leadfield(cfg);</span><br style="font-family:Arial,Helvetica,sans-serif"></i><div style="font-family:Arial,Helvetica,sans-serif"><i><br></i></div><div style="font-family:Arial,Helvetica,sans-serif"><i><br></i></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div style="font-family:Arial,Helvetica,sans-serif"><font color="#ff0000"><i>Error using ft_prepare_leadfield (line 110)</i></font></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div style="font-family:Arial,Helvetica,sans-serif"><font color="#ff0000"><i><b>It seems as if the first input argument is a FieldTrip data structure, while a cfg is expected</b></i></font></div></div></blockquote></blockquote><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I also add information about how the data (EEG), the headmodel and the sourcemodel are:<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><b>hdm = </b></i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i>  struct with fields:</i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i>     bnd: [1×1 struct]</i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i>    type: 'singleshell'</i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i>    unit: 'm'</i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i>     cfg: [1×1 struct]</i></div></blockquote></blockquote><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><b>sourcemodel = </b></i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i>  struct with fields:</i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i>       pos: [6426×3 double]</i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i>       dim: [17 21 18]</i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i>      unit: 'm'</i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i>    inside: [17×21×18 logical]</i></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i>       cfg: [1×1 struct]</i></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><br></i></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><b>data = <br> </b> struct with fields:<br>           hdr: [1×1 struct]<br>         trial: {1×69 cell}<br>          time: {1×69 cell}<br>          elec: [1×1 struct]<br>       fsample: 256<br>         label: {128×1 cell}<br>    sampleinfo: [69×2 double]<br>           cfg: [1×1 struct]</i><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><br></i></div></blockquote></blockquote><font face="arial, helvetica, sans-serif"><i><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span></i></font>On the other hand, if I'm working with EEG, do you think it makes sense to use files <i>standard_singleshell.mat</i>, <i>atlas ROI_MNI_V4.nii</i>, <i>mri.mat </i>and <i>hdm.mat</i> to create the leadfield? Do I need others for EEG?<font face="arial, helvetica, sans-serif"><i><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span><br></i></font><div><font face="arial, helvetica, sans-serif"><i><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></span></i></font></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thank you for your attention. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Best wishes, </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Irene </div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mié., 22 may. 2019 a las 9:51, Schoffelen, J.M. (Jan Mathijs) (<<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank">jan.schoffelen@donders.ru.nl</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>
<div>You are not using the most recent fieldtrip code. See attached screenshot for a section of ft_checkconfig (which I took from
<a href="https://github.com/fieldtrip/fieldtrip" target="_blank">https://github.com/fieldtrip/fieldtrip</a> (utilities/ft_checkconfig.m)</div>
<div><br>
</div>
<div>The error message in your earlier e-mail pointed to line 529.</div>
<div><br>
</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<Screen Shot 2019-05-22 at 09.48.49.png><br>
<div>
<blockquote type="cite">
<div>On 22 May 2019, at 09:42, Irene Varela Leniz <<a href="mailto:irene.varela@alumni.mondragon.edu" target="_blank">irene.varela@alumni.mondragon.edu</a>> wrote:</div>
<br class="gmail-m_-4823299330203997256gmail-m_-3444701284167771701gmail-m_-7690022541708529962gmail-m_-6822762809677964255Apple-interchange-newline">
<div>
<div dir="ltr">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Dear Shoffelen, </div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I am working with last Fieldtrip and MATLAB version so I'm afraid that's not the problem.</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Best wishes, </div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Irene</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">El mié., 22 may. 2019 a las 9:38, Schoffelen, J.M. (Jan Mathijs) (<<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank">jan.schoffelen@donders.ru.nl</a>>) escribió:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>Hi Irene,
<div><br>
</div>
<div>Please check which version of the code you are using, and update to a more recent version to FieldTrip, and try again. The line + error you report does not match the ones in the current version of Fieldtrip.</div>
<div><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
<div>
<div>
<blockquote type="cite">
<div>On 22 May 2019, at 09:21, Irene Varela Leniz <<a href="mailto:irene.varela@alumni.mondragon.edu" target="_blank">irene.varela@alumni.mondragon.edu</a>> wrote:</div>
<br class="gmail-m_-4823299330203997256gmail-m_-3444701284167771701gmail-m_-7690022541708529962gmail-m_-6822762809677964255gmail-m_-2232218543815307315Apple-interchange-newline">
<div>
<div dir="ltr">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Dear Fieldtripers, </div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I am trying to replicate the well-known
<i>tutorial:salzburg [FielTrip] (</i><a href="http://old.fieldtriptoolbox.org/tutorial/salzburg" style="font-family:Arial,Helvetica,sans-serif" target="_blank">http://old.fieldtriptoolbox.org/tutorial/salzburg</a>). Anyway, I am getting some
 errors that I could not manage to solve. I would be really grateful if someone could lend me a hand<span style="color:rgb(60,60,60);font-family:Arial,sans-serif">.</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(60,60,60);font-family:Arial,sans-serif"><br>
</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(60,60,60);font-family:Arial,sans-serif">I am working on section called "</span><span style="font-family:arial,sans-serif;color:rgb(45,45,45)">Localizing
 auditory evoked fields using beamforming techniques in parceled brain space". </span><span style="font-family:Arial,Helvetica,sans-serif">I managed to compute the
<i>sourcemode</i>l as explained in the tutorial without any problem. But now, when "Computing the leadfield" I get an error message related with
<i>sourcemodel.inside </i>field, </span><span style="font-family:Arial,Helvetica,sans-serif">which makes it impossible for me to create the leadfield. The structure is the following:</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif"><br>
</span></div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">sourcemodel =
</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">  struct with fields:</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">       pos: [6426×3 double]</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">       dim: [17 21 18]</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">      unit: 'm'</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">    inside: [17×21×18 logical]</font></i></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><i><font size="1">       cfg: [1×1 struct]</font></i></div>
</blockquote>
</blockquote>
</blockquote>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif"><br>
</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">The structure for computing the leadfield:</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif"><br>
</span></div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">                     <font size="1">
<i>  cfg                 = [];<br>
                        cfg.label         = data.label;<br>
                        cfg.elec          = data.elec;<br>
                        cfg.vol         = hdm;<br>
                        cfg.lcmv.reducerank = 2; % I am working with EEG data<br>
                        cfg.grid = sourcemodel;<br>
                        [grid] = ft_prepare_leadfield(cfg)</i></font></div>
</blockquote>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif"><br>
</span></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">An the error I get:</span></div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif"><font color="#ff0000" size="1"><br>
</font></span></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1">Operands to the || and && operators must be convertible to logical scalar values.</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1"><br>
</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1">Error in ft_checkconfig (line 529)</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1">  elseif isfield(cfg, 'grid') && isfield(cfg.grid, 'inside') && any(cfg.grid.inside>1)</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1"><br>
</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1">Error in ft_prepare_leadfield (line 156)</font></div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1">cfg = ft_checkconfig(cfg, 'inside2logical', 'yes');</font></div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1"><br>
</font></div>
</blockquote>
</blockquote>
</blockquote>
<font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span></font>I think the error comes from the fact that
<i>source<span class="gmail_default" style="font-family:arial,helvetica,sans-serif">model</span>.inside</i> is a 3-dimensional logical array<span class="gmail_default" style="font-family:arial,helvetica,sans-serif">. The operation -
<span style="color:rgb(255,0,0);font-size:x-small">any(cfg.grid.inside>1)</span>   does not output a logical scalar value because<i> sourcemodel.inside</i> is in 3 dimensions. </span>
<div><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">So far I have always worked with models whose inside parameter was of one dimension. Anyway, I'm not sure if this is the problem, please correct me if I'm wrong.</span><font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"></span><br>
</font></div>
<div><font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><span style="font-family:arial,helvetica,sans-serif">Has anyone encountered this same problem, and does anyone know how to fix it?</span>  <font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thank you very much for your attention, </span></font></div>
<div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><font face="arial, helvetica, sans-serif"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif">Irene</span></font></div>
<div><font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
<div><font color="#ff0000" face="arial, helvetica, sans-serif" size="1"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</span></font></div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</div>
</blockquote>
</div>
<br>
</div>

_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>
</div></blockquote><blockquote type="cite"><div dir="ltr"><span>_______________________________________________</span><br><span>fieldtrip mailing list</span><br><span><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></span><br><span><a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a></span><br></div></blockquote></div>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>
</blockquote></div>