From 23aad88d61d18a93ea8616152f161f91f04125a5 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Thu, 21 Mar 2024 11:32:12 +0100 Subject: [PATCH] STYLE: Replace `this->` w/ `Superclass::` in AdvancedImageToImageMetric Made it clearer when AdvancedImageToImageMetric accesses a data member of its base class. Follow-up to commit 548789f8c034300ce0b2e6d1dc7e8a514d315ecb "Replace `this->m_Interpolator` with `Superclass::m_Interpolator`" --- .../itkAdvancedImageToImageMetric.hxx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Common/CostFunctions/itkAdvancedImageToImageMetric.hxx b/Common/CostFunctions/itkAdvancedImageToImageMetric.hxx index e1b460a2d..267584a41 100644 --- a/Common/CostFunctions/itkAdvancedImageToImageMetric.hxx +++ b/Common/CostFunctions/itkAdvancedImageToImageMetric.hxx @@ -262,7 +262,7 @@ AdvancedImageToImageMetric::InitializeImageSampler() } /** Initialize the Image Sampler. */ - m_ImageSampler->SetInput(this->m_FixedImage); + m_ImageSampler->SetInput(Superclass::m_FixedImage); m_ImageSampler->SetMask(this->GetFixedImageMask()); m_ImageSampler->SetInputImageRegion(this->GetFixedImageRegion()); } @@ -349,13 +349,13 @@ AdvancedImageToImageMetric::CheckForBSplineInterpolat elastix::DefaultConstruct centralDifferenceGradientFilter{}; centralDifferenceGradientFilter.SetUseImageSpacing(true); - centralDifferenceGradientFilter.SetInput(this->m_MovingImage); + centralDifferenceGradientFilter.SetInput(Superclass::m_MovingImage); centralDifferenceGradientFilter.Update(); - this->m_GradientImage = centralDifferenceGradientFilter.GetOutput(); + Superclass::m_GradientImage = centralDifferenceGradientFilter.GetOutput(); } else { - this->m_GradientImage = nullptr; + Superclass::m_GradientImage = nullptr; } } @@ -371,7 +371,7 @@ void AdvancedImageToImageMetric::CheckForAdvancedTransform() { /** Check if the transform is of type AdvancedTransform. */ - m_AdvancedTransform = dynamic_cast(this->m_Transform.GetPointer()); + m_AdvancedTransform = dynamic_cast(Superclass::m_Transform.GetPointer()); if (!m_AdvancedTransform) { itkDebugMacro("Transform is not Advanced"); @@ -485,7 +485,7 @@ AdvancedImageToImageMetric::EvaluateMovingImageValueA { index[j] = static_cast(Math::Round(cindex[j])); } - (*gradient) = this->m_GradientImage->GetPixel(index); + (*gradient) = Superclass::m_GradientImage->GetPixel(index); } /** The moving image gradient is multiplied with its scales, when requested. */ @@ -692,11 +692,11 @@ void AdvancedImageToImageMetric::LaunchGetValueThreaderCallback() const { /** Setup threader. */ - this->m_Threader->SetSingleMethod(this->GetValueThreaderCallback, - const_cast(static_cast(&m_ThreaderMetricParameters))); + Superclass::m_Threader->SetSingleMethod(this->GetValueThreaderCallback, + const_cast(static_cast(&m_ThreaderMetricParameters))); /** Launch. */ - this->m_Threader->SingleMethodExecute(); + Superclass::m_Threader->SingleMethodExecute(); } // end LaunchGetValueThreaderCallback() @@ -735,11 +735,11 @@ void AdvancedImageToImageMetric::LaunchGetValueAndDerivativeThreaderCallback() const { /** Setup threader. */ - this->m_Threader->SetSingleMethod(this->GetValueAndDerivativeThreaderCallback, - const_cast(static_cast(&m_ThreaderMetricParameters))); + Superclass::m_Threader->SetSingleMethod(this->GetValueAndDerivativeThreaderCallback, + const_cast(static_cast(&m_ThreaderMetricParameters))); /** Launch. */ - this->m_Threader->SingleMethodExecute(); + Superclass::m_Threader->SingleMethodExecute(); } // end LaunchGetValueAndDerivativeThreaderCallback() @@ -800,7 +800,7 @@ void AdvancedImageToImageMetric::CheckNumberOfSamples(unsigned long wanted, unsigned long found) const { - this->m_NumberOfPixelsCounted = found; + Superclass::m_NumberOfPixelsCounted = found; if (found < wanted * this->GetRequiredRatioOfValidSamples()) { itkExceptionMacro("Too many samples map outside moving image buffer: " << found << " / " << wanted << '\n');