There is not a command specifically to get the neighbors, no. The neighbors aren't equally spaced across the surface, so for some uses they may not be what is desired. You can use -surface-geodesic-rois to get the nearby vertices out to a specified distance (output is a metric file with an roi in a separate map for every input vertex), which may be more suitable for high-level purposes. High-level questions should generally use coordinates and distances in mm, rather than relying on artifacts of representation (don't report ROI size in number of voxels or vertices, instead report it in mm^2 or mm^3).
If you do need specifically the neighbors (say, for some low-level algorithm purpose), it may be worth the time to figure out how to load the gifti surface file into whatever software you are using, and looking at the triangle array, from which it is trivial to construct the neighbor lists. This way, you also have the coordinates (so you can deal with the uneven vertex spacing), and can get more involved information (in case you need it later for something more advanced), such as which triangles share an edge. Being able to read the surface file directly would also reduce the dependence of your code on external tools. Finally, if you just want a quick hack to get the neighbors, -metric-dilate actually does dilate by 1 neighbor minimum, despite taking distance in millimeters, so specifying a distance of zero on a map where only the vertex is nonzero will give you a map where the vertex and all neighbors are nonzero. So, you can use -surface-geodesic-rois with a distance of 0 to generate a file with maps where a single vertex in each is set to 1, and then -metric-dilate with a distance of 0 to turn those into rois of the vertex and its neighbors. Yes, it is quite roundabout, and not the intended purpose of the commands. I have copied hcp-users, as this may be of general interest. Tim On Fri, Jun 29, 2018 at 8:09 PM, Kelvin Mok <[email protected]> wrote: > Hi Tim, > > > Hope this finds you well. Is there a wb_command function which can provide > the neighbouring vertices for a given index? > > > P.S. Should I post such inquiries to [email protected] > > > Thanks, > > > Kelvin > > > *Kelvin Mok* > PhD Student, Dept Biomedical Engineering, Faculty of Medicine > Montreal Neurological Institute and Hospital, McGill University > 3801 University St > <https://maps.google.com/?q=3801+University+St&entry=gmail&source=g>, NW2 > 55, Montreal, Quebec, H3A 2B4 > > _______________________________________________ HCP-Users mailing list [email protected] http://lists.humanconnectome.org/mailman/listinfo/hcp-users
