<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Manon,
<div class=""><br class="">
</div>
<div class="">It would be helpful if you share some details of your variables ‘gray’, and 'source_MEG’.<br class="">
<div><br class="">
</div>
<div>Also, note that if you intend to plot a source structure that is already defined on a surface, you need to include the exact same topological surface (in terms of number of vertices and in terms of the defined triangles). If there is no match FT will try
 and interpolate the functional values in the input source structure onto the surface, thereby assuming that the functional values are defined on a well-defined 3D grid. In your situation this does not seem to be the case.</div>
<div><br class="">
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br class="">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 23 Nov 2021, at 12:11, CHATEAUX Manon via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><font face="Calibri" size="2" style="caret-color: rgb(0, 0, 0); font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="font-size: 11pt;" class="">
<div class="">Dear Fieldtrip community,</div>
<div class=""> </div>
<div class="">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 class=""> </div>
<div class=""><font face="Courier New" size="2" class=""><span style="font-size: 10pt;" class="">cfg               = [];</span></font></div>
<div class=""><font face="Courier New" size="2" class=""><span style="font-size: 10pt;" class="">cfg.funparameter  =<span class="Apple-converted-space"> </span><font color="#A020F0" class="">'pow'</font>;</span></font></div>
<div class=""><font face="Courier New" size="2" class=""><span style="font-size: 10pt;" class="">cfg.method        =<span class="Apple-converted-space"> </span><font color="#A020F0" class="">'surface'</font>;</span></font></div>
<div class=""><font face="Courier New" size="2" class=""><span style="font-size: 10pt;" class="">cfg.surffile      = gray;</span></font></div>
<div class=""><font face="Courier New" size="2" class=""><span style="font-size: 10pt;" class="">cfg.funcolormap   =<span class="Apple-converted-space"> </span><font color="#A020F0" class="">'jet'</font>;</span></font></div>
<div class=""><font face="Courier New" size="2" class=""><span style="font-size: 10pt;" class="">cfg.opacitymap    =<span class="Apple-converted-space"> </span><font color="#A020F0" class="">'rampup'</font>;</span></font></div>
<div class=""><font face="Courier New" size="2" class=""><span style="font-size: 10pt;" class="">cfg.maskparameter =<span class="Apple-converted-space"> </span><font color="#A020F0" class="">'pow'</font>;</span></font></div>
<div class=""><font face="Courier New" size="2" class=""><span style="font-size: 10pt;" class="">cfg.camlight      =<span class="Apple-converted-space"> </span><font color="#A020F0" class="">'yes'</font>;</span></font></div>
<div class=""><font face="Courier New" size="2" class=""><span style="font-size: 10pt;" class="">ft_sourceplot(cfg, source_MEG);</span></font></div>
<div class=""><font face="Times New Roman" class=""> </font></div>
<div class="">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 class=""><font face="Times New Roman" class=""> </font></div>
<div class="">It works well for sub-01 but, with the same code, I get the following error for sub-02 :</div>
<div class=""> </div>
<div class="">the input is source data with 10000 brainordinates</div>
<div class="">the call to "ft_selectdata" took 1 seconds</div>
<div class="">not plotting anatomy</div>
<div class="">not using an atlas</div>
<div class="">not using a region-of-interest</div>
<div class="">The source functional does not contain a triangulated surface, we may need to interpolate to a surface mesh</div>
<div class=""><font face="Times New Roman" class=""> </font></div>
<div class=""><font color="red" class=""><b class="">The logical indices in position 2 contain a true value outside of the array bounds.</b></font></div>
<div class=""><font color="red" class=""> </font></div>
<div class=""><font color="red" class=""><b class="">Error in pos2transform (line 33)</b></font></div>
<div class=""><font color="red" class=""><b class="">transform = pos(:,sel)/ind(:,sel);</b></font></div>
<div class=""><font color="red" class=""> </font></div>
<div class=""><font color="red" class=""><b class="">Error in ft_sourceplot (line 1137)</b></font></div>
<div class=""><font color="red" class=""><b class="">      functional.transform = pos2transform(functional.pos);</b><b class=""></b></font></div>
<div class=""><font face="Times New Roman" class=""> </font></div>
<div class="">I looked into it a bit, and I could note that :</div>
<ol style="margin: 0px; padding-left: 36pt;" class="">
<li class="">The number of columns in ind is lower than the one in pos for sub-02, and this exactly describes the error.</li><li class="">There is a problem when computing dim at l.20 of pos2transform.m :<font face="Courier New" size="2" class=""><span style="font-size: 10pt;" class="">dim = pos2dim(pos);<br class="">
</span></font><font size="2" class=""><span style="font-size: 10pt;" class="">dim = [</span></font><font size="2" class=""><span style="font-size: 10pt;" class="">16,1,625]<span class="Apple-converted-space"> </span></span></font><font size="2" class=""><span style="font-size: 10pt;" class="">for
 sub-01 and dim = [55,1,181.818</span></font><font size="2" class=""><span style="font-size: 10pt;" class="">2]</span></font><font size="2" class=""><span style="font-size: 10pt;" class=""><span class="Apple-converted-space"> </span>for sub-02</span></font><font size="2" class=""><span style="font-size: 10pt;" class="">.
 Having a<span class="Apple-converted-space"> </span></span></font><font size="2" class=""><span style="font-size: 10pt;" class="">decimal number in dim is incorrect right?<span class="Apple-converted-space"> </span></span></font></li><li class="">When replacing<span class="Apple-converted-space"> </span><font size="2" class=""><span style="font-size: 10pt;" class="">dim = [55,1,181.818</span></font><font size="2" class=""><span style="font-size: 10pt;" class="">2]</span></font><font size="2" class=""><span style="font-size: 10pt;" class=""><span class="Apple-converted-space"> </span>by<span class="Apple-converted-space"> </span></span></font><font size="2" class=""><span style="font-size: 10pt;" class="">dim
 = [</span></font><font size="2" class=""><span style="font-size: 10pt;" class="">16,1,625]</span></font><font size="2" class=""><span style="font-size: 10pt;" class="">, when running the script for sub-02, I don’t get any error but I don’t know if<span class="Apple-converted-space"> </span></span></font><font size="2" class=""><span style="font-size: 10pt;" class="">it
 is ok to do that and if<span class="Apple-converted-space"> </span></span></font><font size="2" class=""><span style="font-size: 10pt;" class="">I can interpret the results.</span></font></li><li class="">I tried plotting sub-01 results on sub-02 mesh and it worked fine so there is nothing wrong with sub-02 mesh.<span class="Apple-converted-space"> </span></li></ol>
<div class=""><font face="Times New Roman" class=""> </font></div>
<div class="">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.<span class="Apple-converted-space"> </span></div>
<div class=""> </div>
<div class="">Thank you very much for your help!<span class="Apple-converted-space"> </span></div>
<div class=""> </div>
<div class=""> </div>
<div class="">Manon Châteaux</div>
<div class=""><font face="Times New Roman" class=""> </font></div>
<div class=""><font face="Times New Roman" class=""> </font></div>
</span></font><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8x2La1IYmhTMmRfZu62wYsIixbu2dxX6P_AiTrWbh7kQASTJBygwlGl8LP3ky2mdH6vtlUCeSGt3J4GlrTGB_16pjOQGnUsjXdttTQ$" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8x2La1IYmhTMmRfZu62wYsIixbu2dxX6P_AiTrWbh7kQASTJBygwlGl8LP3ky2mdH6vtlUCeSGt3J4GlrTGB_16pjOQGnUsjXdttTQ$</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>