<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=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Jan,<div class=""><br class=""></div><div class="">Thanks so much for your reply!</div><div class="">Thats really seems to be the case. I inspected the object file closely and found the miss-match.</div><div class=""><br class=""></div><div class="">The list of geometric vertices (v) has not the same amount as the texture coordinates (vt)</div><div class="">I tried different scans and different export options, it has an effect on it but it is never matching. </div><div class="">Other programs like Cinema 4D can open it easily (so I assume the file is not corrupted).</div><div class=""><br class=""></div><div class="">By a bit research I found that v and vt seems do not necessarily need to match in general.</div><div class=""><br class=""></div><div class="">In the following link you can find my scan. Skanect is exporting the files exactly like that.</div><div class="">As mentioned before, Skanect is providing .png instead of .jpg</div><div class=""><br class=""></div><div class=""><a href="https://www.dropbox.com/sh/9pnjpq5wofs2h7i/AABieWNZhPstKlDE8m3OFX0ia?dl=0" class="">https://www.dropbox.com/sh/9pnjpq5wofs2h7i/AABieWNZhPstKlDE8m3OFX0ia?dl=0</a></div><div class=""><br class=""></div><div class="">Best</div><div class="">Rainer</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 06.07.2020 um 09:31 schrieb Schoffelen, J.M. (Jan Mathijs) <<a href="mailto:jan.schoffelen@donders.ru.nl" class="">jan.schoffelen@donders.ru.nl</a>>:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<div 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 class=""><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="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</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></div></body></html>