Normalized mutual information combined with gradient descent as a similarity measure function for 2D/3D registration

Hello everyone, I have been working on 2D/3D registration recently and encountered a problem. In this project of mine, the sum function of normalized mutual information and gradient descent is used as the similarity measure function to measure registration. I would like to ask you, if there is any reference code, case, or idea you can provide, thank you very much.