[FieldTrip] 3d scan with structure sensor - remove_vertices seems not to remove corresponding texture indices

Piotr Gawroński piotr.gawronski at student.uj.edu.pl
Tue Dec 22 01:01:24 CET 2020


Dear community,

I am a new user of fieldtriptoolbox and have followed your tutorial on how to localize electrodes using 3D scanner, specifically using structure sensor by Occipital. I have encountered two issues and I adress each of these in separate e-mails.
Here I would like to ask about remove_vertices function behaviour.
I used matlab 2020a.

When I export model with texture, I get error informing me about invalid texture size:

Error using refine (line 72)
invalid size of texture

Error in ft_read_headshape (line 1001)
[shape.pos, shape.tri, texture] = refine(shape.pos, shape.tri,...

Error in lokalizacja_elektrod (line 30)
head_surface = ft_read_headshape(sciezka_model)

After some time I managed to find what I understand produces that error - that is, remove_vertices removes (in my case) one  un-used vertice it finds, but it seems to never remove texture vertice associated with the removed geometrical vertice. This results in different sizes of texture and vertice arrays.
When
[posR, triR, removetri] = remove_vertices(pos, tri, removepos)
is replaced  with
[posR, triR, txR, removetri] = remove_vertices_NEW(pos, tri, removepos, tx)

and one line added, that is:
% remove the vertices and triangles
...
txR = tx(keeppos,:);

then only it is possible to read in the model with its texture.

I am not however  sure (due to lack of in-depth knowledge of 3d meshes) whether it is a  bug or desired behaviour, which I do not fully comprehend. I understood that remove_vertice removes geometrical vertices which are unused by any face.

I have not reported it as an issue on github, as I am not certain whether it is a bug,as I have mentioned already.

Regards
Piotr Gawroński
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201222/0284daf7/attachment.htm>


More information about the fieldtrip mailing list