Optimizer's stopping condition is rounding error. Registration framework

Hi everyone,

I’m doing B-Spline registration of CT vs CBCT images.

The Registration method Im using is:

 registration_method = sitk.ImageRegistrationMethod()
  
 grid_physical_spacing = [15.0]*3 
 image_physical_size = [size*spacing for size,spacing in zip(fixed_image.GetSize(), fixed_image.GetSpacing())]
 mesh_size = [int(image_size/grid_spacing + 0.5) \
              for image_size,grid_spacing in zip(image_physical_size,grid_physical_spacing)]

 initial_transform = sitk.BSplineTransformInitializer(image1 = fixed_image, 
                                                      transformDomainMeshSize = mesh_size, order=3)    

 registration_method.SetInitialTransformAsBSpline(initial_transform,
                                                  inPlace=False)

 registration_method.SetMetricAsMattesMutualInformation(numberOfHistogramBins=150)


 registration_method.SetMetricSamplingStrategy(registration_method.RANDOM)
 registration_method.SetMetricSamplingPercentage(0.001)



 registration_method.SetInterpolator(sitk.sitkLinear)
 registration_method.SetOptimizerAsLBFGS2(solutionAccuracy=1e-10, numberOfIterations=150, deltaConvergenceTolerance=1e-10)

The Optimizer’s stopping condition is: A rounding error occurred

I would like to understand why the optimizer always stop for a rounding error and how to stop this to happen.

Thanks in advance,
Luciano

This is very strict. The usual values are close to the image spacing, .e.g 0.01 or 0.001. That might be the reason.

To the image dimension in which dimension, meters?

For which parameter is the suggestion? solutionAccuracy and deltaConvergenceTolerance?

Thanks,
Luciano

ITK is unitless. ITK uses whichever unit your image spacing is expressed in. That is usually millimeters in medicine, meters in earth observation satellite images, milli-arc-seconds in astronomy (I think).

Probably both parameters need to be much larger.

I have the similar issue in multiscale mode. Following the instructions here:
https://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/65_Registration_FFD.html#:~:text=registration_method.SetOptimizerAsLBFGS2(solutionAccuracy%3D1e-2%2C%20numberOfIterations%3D100%2C%20deltaConvergenceTolerance%3D0.01)

registration_method.SetOptimizerAsLBFGS2(
            solutionAccuracy=1e-2,
            # hessianApproximateAccuracy=60,
            numberOfIterations=1000,
            deltaConvergenceTolerance=10,
            # lineSearchMaximumEvaluations=40,
            # lineSearchMaximumStep=1e20,
            # lineSearchMinimumStep=1e-20,
            # lineSearchAccuracy=1e-4
        )

The fixed and moving image sizeare: (96, 72) (57, 86)
The metric curve looks like:
image