<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 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">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: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"><i><font size="1">sourcemodel = </font></i></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"><i><font size="1"> struct with fields:</font></i></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"><i><font size="1"> pos: [6426×3 double]</font></i></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"><i><font size="1"> dim: [17 21 18]</font></i></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"><i><font size="1"> unit: 'm'</font></i></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"><i><font size="1"> inside: [17×21×18 logical]</font></i></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"><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:0 0 0 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: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"><span style="font-family:Arial,Helvetica,sans-serif"><font color="#ff0000" size="1"><br></font></span></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"><font color="#ff0000" size="1">Operands to the || and && operators must be convertible to logical scalar values.</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"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1"><br></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"><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: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 color="#ff0000" size="1"> elseif isfield(cfg, 'grid') && isfield(cfg.grid, 'inside') && any(cfg.grid.inside>1)</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"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#ff0000" size="1"><br></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"><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: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 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" color="#000000"><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" color="#000000"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><span class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></span></font></div><div><font face="arial, helvetica, sans-serif" color="#000000"><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>