<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="">
<font size="4" class="">Hi Rainer,</font>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">The error message suggests that there’s an unexpected (at least by Fieldtrip) mismatch between the ’texture’ specification in the .obj file, as compared to the number of points that are in the same .obj file.  That is,
 there’s a mismatch between the variables that are outputted by the function read_obj_new (in fieldtrip/fileio/private). </font><span style="font-size: large;" class="">Assuming that the implementation of this referenced function is correct (i.e. that it reads
 the file correctly), it suggests that your obj-file either is corrupt, or that it has been formatted in a way that is not anticipated by the reading function. </span></div>
<div class=""><span style="font-size: large;" class=""><br class="">
</span></div>
<div class=""><span style="font-size: large;" class="">Could you confirm the mismatch by setting a breakpoint in ft_read_headshape and compare the number of returned texture points in relation to the number of point points?</span></div>
<div class=""><span style="font-size: large;" class=""><br class="">
</span></div>
<div class=""><span style="font-size: large;" class="">Would it be possible to share the combined (obj/jpg/mtl) files so that we can have a look?</span></div>
<div class=""><span style="font-size: large;" class=""><br class="">
</span></div>
<div class=""><span style="font-size: large;" class="">Best wishes,</span></div>
<div class=""><span style="font-size: large;" class="">JM</span></div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 5 Jul 2020, at 12:37, Rainer Scharf <<a href="mailto:rainer.scharf@student.tugraz.at" class="">rainer.scharf@student.tugraz.at</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Dear Community,
<div class=""><br class="">
</div>
<div class="">I’m trying to localize electrodes using a 3D Scanner according to the 3dscanner tutorial.</div>
<div class="">Everything works for the scan provided in the tutorial.</div>
<div class=""><br class="">
</div>
<div class="">I use the Skanect Occipital Structure sensor (for computer) not the one for the iPad as shown in the tutorial.</div>
<div class=""><br class="">
</div>
<div class="">After exporting the data from Skanect I get an OBJ- ,PNG- and MTL-File.</div>
<div class="">(The fieldtrip code is expecting a jpg-file)</div>
<div class=""><br class="">
</div>
<div class="">I converted the png file to jpg and also tried to let Matlab use the png-file directly, but it seems to me the texture is not matching with the structure information as the code expects it.</div>
<div class="">(Other programs like cinema 4D are matching it without any problems.)</div>
<div class=""><br class="">
</div>
<div class="">When I run the code I get an error in the <b class="">refine</b> - function:</div>
<div class="">
<div class=""><font color="#ff2600" class="">Error using refine (line 72)</font></div>
<div class=""><font color="#ff2600" class="">invalid size of texture</font></div>
</div>
<div class=""><br class="">
</div>
<div class="">I’m using fieldtrip-20200607 </div>
<div class=""><br class="">
</div>
<div class="">Thanks in advances for your advices and support,</div>
<div class=""><br class="">
</div>
<div class="">All the Best </div>
<div class="">Rainer</div>
<div class=""><br class="">
</div>
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>