Use of TransformRigidityPenalty Fails

Hi!

I am using deformable intensity-based algorithm to register pretreatment and posttreatment CT pairs. I want a specific region defined by a segmentation not to be deformed much during nonlinear registration. For that, I introduced TransformRigidityPenalty where I used Elastix manual and “A rigidity penalty term for nonrigid registration.” as reference. However, I am getting weird results for the registered image as can be seen below:

Below you can see the red region in 3D which I want it not to be deformed:

I use 3 different parameter maps with a multi-resolution approach ( Rigid → Affine → B-Spline). I only used TransformRigidityPenalty in 3rd parameter map which is B-Spline. Below are the parameters I used:

// **************** Main Components **************************
(FixedInternalImagePixelType "float")
(MovingInternalImagePixelType "float")
(FixedImageDimension 3)
(MovingImageDimension 3)
(Registration "MultiMetricMultiResolutionRegistration")
(Interpolator "BSplineInterpolator")
(ResampleInterpolator "FinalBSplineInterpolator")
(Resampler "DefaultResampler")
(FixedImagePyramid "FixedSmoothingImagePyramid")
(MovingImagePyramid "MovingSmoothingImagePyramid")

// ***************** Transformation **************************
(Transform "BSplineTransform")
(HowToCombineTransforms "Compose")

// ******************* Similarity measure ********************
(Metric "AdvancedMattesMutualInformation" "TransformRigidityPenalty")
(UseRelativeWeights "false")
(Metric0Weight 1.0)
(Metric0Use "true")
(Metric1Weight 1.0)
(Metric1Use "true")
(LinearityConditionWeight 100.0)
(OrthonormalityConditionWeight 1.0)
(PropernessConditionWeight 2.0)
(NumberOfHistogramBins 64)

// ******************** Multiresolution **********************
(NumberOfResolutions 4)
(ImagePyramidSchedule 4 4 4 4 4 4 2 2 2 1 1 1)
(FinalGridSpacingInVoxels 8.0 8.0 8.0)
(GridSpacingSchedule 6.0 6.0 6.0 4.0 4.0 4.0 2.0 2.0 2.0 1.0 1.0 1.0)

// ******************* Optimizer ****************************
(Optimizer "AdaptiveStochasticGradientDescent")
(AutomaticParameterEstimation "true")
(UseAdaptiveStepSizes "true")
(MaximumNumberOfIterations 300 300 300 1200)

// **************** Image sampling **********************
(NumberOfSpatialSamples 5000)
(NewSamplesEveryIteration "true")
(ImageSampler "RandomCoordinate")

// ************* Interpolation and Resampling ****************
(BSplineInterpolationOrder 3)
(FinalBSplineInterpolationOrder 3)
(DefaultPixelValue -1024)

And I set the rigidity index of voxels in the moving image via: parameter_object.SetParameter(2, "MovingRigidityImageName", "moving_rigidity_mask.nrrd"))

With iterations TransformRigidityPenalty gets less however, it is still too high:

What could be the reason for distorted regions formed in the registered image?

Thank you!

I also tried with parameter settings that Jian et al. (2022) used:

// Main Components
(Registration "MultiMetricMultiResolutionRegistration")
(Interpolator "BSplineInterpolator")
(ResampleInterpolator "FinalBSplineInterpolator")
(Resampler "DefaultResampler")
(FixedImagePyramid "FixedRecursiveImagePyramid")
(MovingImagePyramid "MovingRecursiveImagePyramid")
(NumberOfHistogramBins 64)
(ErodeMask "false")
(FixedInternalImagePixelType "float")
(MovingInternalImagePixelType "float")
(FixedImageDimension 3)
(MovingImageDimension 3)
(UseDirectionCosines "true")
// Transformation
(Transform "BSplineTransform")
(HowToCombineTransforms "Compose")
// Similarity measure
(Metric "AdvancedMattesMutualInformation" "TransformRigidityPenalty")
(Metric0Weight 0.1)
(Metric1Weight 0.5)
(LinearityConditionWeight 1.0)
(OrthonormalityConditionWeight 0.1)
(PropernessConditionWeight 0.1)
(UseLinearityCondition "false")
(UseOrthonormalityCondition "true")
(UsePropernessCondition "true")
(CalculateLinearityCondition "true")
(CalculateOrthonormalityCondition "true")
(CalculatePropernessCondition "true")
(DilateRigidityImages "false" "false" "false" "true")
(DilationRadiusMultiplier 1.0)
(UseFixedRigidityImage "false")
(UseMovingRigidityImage "true")
// Multiresolution
(NumberOfResolutions 4)
(FinalGridSpacing 8.0)
(UpsampleGridOption "true")
// Optimizer
(Optimizer "StandardGradientDescent")
(MaximumNumberOfIterations 500)
(SP_a 150000.0 120000.0 70000.0 20000.0)
(SP_alpha 0.602 0.602 0.602 0.602)
(SP_A 100.0 100.0 100.0 100.0)
// Image sampling
(NumberOfSpatialSamples 5000)
(NewSamplesEveryIteration "true")
(ImageSampler "Random")
// Interpolation and Resampling
(BSplineInterpolationOrder 3)
(FinalBSplineInterpolationOrder 3)
(DefaultPixelValue -1024)

It works without any distortion!

However, if I use the parameters that are used by Luu et al. (2015) and Staring et al. (2007) as below:

//  Main Components 
(Registration "MultiMetricMultiResolutionRegistration")
(Interpolator "BSplineInterpolator")
(ResampleInterpolator "FinalBSplineInterpolator")
(Resampler "DefaultResampler")
(FixedImagePyramid "FixedRecursiveImagePyramid")
(MovingImagePyramid "MovingRecursiveImagePyramid")
(FixedInternalImagePixelType "float")
(MovingInternalImagePixelType "float")
(FixedImageDimension 3)
(MovingImageDimension 3)
(UseDirectionCosines "true")
//  Transformation 
(Transform "BSplineTransform")
(HowToCombineTransforms "Compose")
//  Similarity measure 
(Metric "AdvancedMattesMutualInformation" "TransformRigidityPenalty")
(Metric0Weight 1)
(Metric1Weight 0.1 0.1 0.1 4.0)
(LinearityConditionWeight 100.0)
(OrthonormalityConditionWeight 1.0)
(PropernessConditionWeight 2.0)
(UseLinearityCondition "true")
(UseOrthonormalityCondition "true")
(UsePropernessCondition "true")
(CalculateLinearityCondition "true")
(CalculateOrthonormalityCondition "true")
(CalculatePropernessCondition "true")
(DilateRigidityImages "false" "false" "false" "true")
(DilationRadiusMultiplier 1.0 1.0 1.0 2.0)
(UseFixedRigidityImage "false")
(UseMovingRigidityImage "true")
(NumberOfHistogramBins 32)
(ErodeMask "false")
//  Multiresolution 
(NumberOfResolutions 4)
(FinalGridSpacing 8.0)
(UpsampleGridOption "true")
//  Optimizer 
(Optimizer "AdaptiveStochasticGradientDescent")
(UseAdaptiveStepSizes "true")
(MaximumNumberOfIterations 300 300 300 1200)
(SP_a 150000.0 120000.0 70000.0 20000.0)
(SP_alpha 0.602 0.602 0.602 0.602)
(SP_A 100.0 100.0 100.0 100.0)
//  Image sampling 
(NumberOfSpatialSamples 5000)
(NewSamplesEveryIteration "true")
(ImageSampler "Random")
//  Interpolation and Resampling 
(BSplineInterpolationOrder 3)
(FinalBSplineInterpolationOrder 3)
(DefaultPixelValue -1024)

The registered images seems to be working fine till the 4th resolution (final resolution) in B-Spline.
Below you can see registered image after 3rd resolution without and distorted region and the one after final resolution with distorted regions, respectively:


Is there any hints about what might be causing such a problem?

Thank you!
References:

  1. Jian, B., Azampour, M.F., De Benetti, F., Oberreuter, J., Bukas, C., Gersing, A.S., Foreman, S.C., Dietrich, A.S., Rischewski, J., Kirschke, J.S. and Navab, N., 2022, September. Weakly-supervised Biomechanically-constrained CT/MRI Registration of the Spine. In International Conference on Medical Image Computing and Computer-Assisted Intervention (pp. 227-236). Cham: Springer Nature Switzerland.
  2. Luu, H.M., Niessen, W., Van Walsum, T., Klink, C. and Moelker, A., 2015. An automatic registration method for pre‐and post‐interventional CT images for assessing treatment success in liver RFA treatment. Medical physics, 42(9), pp.5559-5567.
  3. Staring, M., Klein, S. and Pluim, J.P., 2007. A rigidity penalty term for nonrigid registration. Medical physics, 34(11), pp.4098-4108.

Maybe @Niels_Dekker or @ntatsisk care to comment?

1 Like