I have two vtkPoints sets; both have an equal number of points. The point sets resulted from resampling two more or less similar-looking polydatas (triangular meshes). My goal is to re-order the vertex indices of one of the point sets to morphologically match the other point set (i.e. template point set). So far, I was able to achieve this goal by manually selecting some corresponding points in both point sets and eventually superimposing them to reorder the ids of the target point set.
My question is, is there any way to do it without using superimposition procedures?

I donâ€™t understand why the point idâ€™s are important to have the same shape on both point setsâ€¦ it looks like I didnâ€™t understand the problem. Is it possible to illustrate the problem and what you want to achieve with a figure?

Thanks for the reply. Sorry if the problem was vague; Iâ€™m going to provide an example. I have two laser-scanned human faces (triangular meshes), one of which I call the template, and the other one is the target. I resampled (blue noise resampling) both the template and target to get, for example, 200 uniformly distributed vertices. The result of such resampling is two point sets which both have 200 vertices, and they cover the face in a similar pattern.
Now, in the resampled template, the vertexâ€™s index on the tip of the nose is 70, while in the resampled target, the vertexâ€™s index on the noseâ€™s tip is 25. Iâ€™m trying to find a way to re-order the target indices so the nose landmark gets the same index (70).
Iâ€™m going to treat these vertices as corresponding landmarks and perform Procrustes superimposition via an automated procedure. Hopefully, this example clarified my problem a little more. The tip of the nose was an example; most of the points on the resampled target has different index from the resampled template.

Thatâ€™s clearer now. Well, I know no way to do that in VTK in a single shot. Hence, you have to break down that into simpler tasks:

let output_ps := blank pointset;
For each point in reference_ps:
let pr := current point in reference_ps;
let p2 := second_ps.find_closest( pr );
output_ps.addpoint( p2 );
endFor
let second_ps := output_ps;

That way, youâ€™ll have the second point set with collocated points with the same index order of the first point set. Now itâ€™s up to you to translate that pseudocode into VTK calls.

Thank you very much for the idea; I appreciate it. The problem is that the template and target meshes were digitised separately, so they have different coordinate systems (meshes are far apart). So the closest point approach (vtk point locator or cell locator) wonâ€™t be a proper procedure unless I manually superimpose my meshes. Since the coordinate systems are sometimes rotated, even the automated methods of superimposition (such as ICP) donâ€™t work most of the time.

From ages ago, I remember that Maya used to have a tool that could re-order vertex ids (itâ€™s not an open source, so that I couldnâ€™t see the algorithm behind that tool). I was hoping for a similar thing in vtk. I guess the optimal solution is manually superimposing my data (there are hundreds and hundreds of them, thatâ€™s why I was thinking about an automated procedure).

In that case, you need to pre-process the target mesh so they closely match in space and, hence, satisfies the algorithmâ€™s pre-condition. This is an operation called point set registration (Point-set registration - Wikipedia). Chose one that only uses rigid transformations so the pointsâ€™ relative distances remain the same.