Q:Dear minc users, I am currently trying to adapt a region-growing procedure for surface data. The procedure is using a representation of the adjacency matrix between vertices, i.e. a matrix (vertices times vertices) with 1s for pairs of vertices that are spatial neighbours on the surface, and 0 otherwise. I sort of understood that the order of the vertices in the obj file is very specific and follows an iterative refinement of the surface grid. Can anyone suggest an approach to generate the adjacency matrix based on the .obj data ? Thank you in advance,

A:I’m no expert on the structure of .obj files, but I believe that one of the structures within the file is used to record the correspondence between vertices and polygons. Given that our our cortical surfaces are constructed of triangles, this table has number_of_polygons rows and 3 columns. All 3 vertices for any triangle would be adjacent, and the corresponding matrix rows-columns could be set to 1. Just loop over all triangles in the table, and you should have the matrix that you’re looking for.

HTH,

A:I guess the ‘mni_getmesh.m’ writted by Moo K. Chung is used to do what you want. Here is the link: http://www.stat.wisc.edu/~mchung/softwares/mesh/mesh.html Hope it can help you.