Your ICP code works great and I am able to achieve very good registration of my point cloud.
The point cloud is generated by using the vertices of an isosurface of my 3D grayscale data set. I would like to use the affine transform matrix M to transform the 3D grayscale data in the same way as the point cloud of vertices were transformed.
For some reason this does not seem to work. I cannot get my dataset to rotate correctly when using the output affine transform matrix.
Could you post an example of how you can use M to rotate not a point cloud, but a grayscale 3D dataset? Or is there some reason that should not work?
Thanks for sharing your great work.