Can I use conjugate gradient optimizer for registration in python?How can I do ?

I am interested in this as well and will broaden a bit the question as it’s tagged as beginner one. It’s been a while since I used ITK and haven’t used the python version before. I was hoping that through the new python interface, using ITK for registration of vector images with a custom optimiser (LBFGSB in my case) would be a breeze. It’s not really the case yet…

The choice of ImageRegistrationMethodv4 over ImageRegistrationMethod seems undocumented. Is ImageRegistrationMethod meant to be the latest one or is it a relic from ITK v3?

Assuming for now that v4 is preferable as this is showcased in the first example:
https://itk.org/ITKExamples/src/Registration/Common/Perform2DTranslationRegistrationWithMeanSquares/Documentation.html

I tried to instantiate a vector image registration by adapting the example but got an error:

itk.MeanSquaresImageToImageMetricv4 is not wrapped for input type `itk.Image[itk.Vector[itk.F,3],2], itk.Image[itk.Vector[itk.F,3],2]`.

I averaged my images across the last dimension to nonetheless try and change the optimiser to LBFGSBOptimiser (itk.LBFGSBOptimizer.New()) but got a type error:

TypeError: in method 'itkImageRegistrationMethodv4REGv4F2F2_SetOptimizer', argument 2 of type 'itkObjectToObjectOptimizerBaseTemplateD *'

I then moved on to try and instantiate a LBFGSBOptimizerv4 (itk.LBFGSBOptimizerv4.New()) but got an error as well:

AttributeError: module 'itk' has no attribute 'LBFGSBOptimizerv4'