<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>Dear Fieldtrip community,</div>
<div> </div>
<div>I am trying to plot results on a mesh I created from a participant’s MRI. For this I use the following code :</div>
<div> </div>
<div><font face="Courier New" size="2"><span style="font-size:10pt;">cfg               = [];</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:10pt;">cfg.funparameter  = <font color="#A020F0">'pow'</font>;</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:10pt;">cfg.method        = <font color="#A020F0">'surface'</font>;</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:10pt;">cfg.surffile      = gray;</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:10pt;">cfg.funcolormap   = <font color="#A020F0">'jet'</font>;</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:10pt;">cfg.opacitymap    = <font color="#A020F0">'rampup'</font>;</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:10pt;">cfg.maskparameter = <font color="#A020F0">'pow'</font>;</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:10pt;">cfg.camlight      = <font color="#A020F0">'yes'</font>;</span></font></div>
<div><font face="Courier New" size="2"><span style="font-size:10pt;">ft_sourceplot(cfg, source_MEG);</span></font></div>
<div><font face="Times New Roman"> </font></div>
<div>source_MEG actually contains data in the frequency domain for one frequency point only, for sources that are on the “surface” of the gray matter.</div>
<div><font face="Times New Roman"> </font></div>
<div>It works well for sub-01 but, with the same code, I get the following error for sub-02 :</div>
<div> </div>
<div>the input is source data with 10000 brainordinates</div>
<div>the call to "ft_selectdata" took 1 seconds</div>
<div>not plotting anatomy</div>
<div>not using an atlas</div>
<div>not using a region-of-interest</div>
<div>The source functional does not contain a triangulated surface, we may need to interpolate to a surface mesh</div>
<div><font face="Times New Roman"> </font></div>
<div><font color="red"><b>The logical indices in position 2 contain a true value outside of the array bounds.</b></font></div>
<div><font color="red"> </font></div>
<div><font color="red"><b>Error in pos2transform (line 33)</b></font></div>
<div><font color="red"><b>transform = pos(:,sel)/ind(:,sel);</b></font></div>
<div><font color="red"> </font></div>
<div><font color="red"><b>Error in ft_sourceplot (line 1137)</b></font></div>
<div><font color="red"><b>      functional.transform = pos2transform(functional.pos);</b><b> </b></font></div>
<div><font face="Times New Roman"> </font></div>
<div>I looked into it a bit, and I could note that :</div>
<ol style="margin:0;padding-left:36pt;">
<li>The number of columns in ind is lower than the one in pos for sub-02, and this exactly describes the error.</li><li>There is a problem when computing dim at l.20 of pos2transform.m :<font face="Courier New" size="2"><span style="font-size:10pt;">dim = pos2dim(pos);<br>

</span></font><font size="2"><span style="font-size:10pt;">dim = [</span></font><font size="2"><span style="font-size:10pt;">16,1,625] </span></font><font size="2"><span style="font-size:10pt;">for sub-01 and dim = [55,1,181.818</span></font><font size="2"><span style="font-size:10pt;">2]</span></font><font size="2"><span style="font-size:10pt;">
for sub-02</span></font><font size="2"><span style="font-size:10pt;">. Having a </span></font><font size="2"><span style="font-size:10pt;">decimal number in dim is incorrect right? </span></font></li><li>When replacing <font size="2"><span style="font-size:10pt;">dim = [55,1,181.818</span></font><font size="2"><span style="font-size:10pt;">2]</span></font><font size="2"><span style="font-size:10pt;"> by </span></font><font size="2"><span style="font-size:10pt;">dim
= [</span></font><font size="2"><span style="font-size:10pt;">16,1,625]</span></font><font size="2"><span style="font-size:10pt;">, when running the script for sub-02, I don’t get any error but I don’t know if </span></font><font size="2"><span style="font-size:10pt;">it
is ok to do that and if </span></font><font size="2"><span style="font-size:10pt;">I can interpret the results.</span></font></li><li>I tried plotting sub-01 results on sub-02 mesh and it worked fine so there is nothing wrong with sub-02 mesh. </li></ol>
<div><font face="Times New Roman"> </font></div>
<div>I don’t really understand what this part of ft_sourceplot does so I don’t know what to do and how to solve the problem. </div>
<div> </div>
<div>Thank you very much for your help! </div>
<div> </div>
<div> </div>
<div>Manon Châteaux</div>
<div><font face="Times New Roman"> </font></div>
<div><font face="Times New Roman"> </font></div>
</span></font>
</body>
</html>