I am using image registration for some time now but I am still trying to understand things in more deep. It seems tracing ITK code is not that easy.

What is the math behind the metric derivative and where can I find the implementation part i.e the update function of the transform parameters? it would be nice if someone provide explanation or some simple-to-read references.

Assuming a 2D rigid transformation with only 3 parameters translation in x and y, and a rotation angle; assuming also a mean squared error metric, how is the metric derivative and the update equation look like?

is extend the concept to 3D is straight forward or involving more math and code?

I hope the questions are clear!

Thanks!