Vertices order randomly changes in SurfMesh results

Dear AFNI experts,

I’m trying to use SurfMesh to generate higher density meshes with something like:

SurfMesh -i SUMA/lh.smoothwm.gii -o SUMA.hd/lh.smoothwm.gii -edges 2
SurfMesh -i SUMA/lh.pial.gii -o SUMA.hd/lh.pial.gii -edges 2

The meshes are generated without error and the number of faces doubled as expected.
However, the order of vertices seems to be randomized, so that the correspondence between nodes with the same index in the two surfaces no longer holds.
In fact, running SurfMesh for the same input mesh twice seems to generate completely different node orders.

Is there a way to maintain the output vertices order across multiple calls to the SurfMesh command, so that we can keep the node correspondence between smoothwm and pial after upsampling?

Many thanks!

Not with SurfMesh directly. You can instead use @SUMA_Make_Spec_FS or MapIcosahedron with higher -ld options for higher mesh densities.