Skip to content

Commit

Permalink
STYLE: Replace this-> w/ Superclass:: in AdvancedImageToImageMetric
Browse files Browse the repository at this point in the history
Made it clearer when AdvancedImageToImageMetric accesses a data member of its base class.

Follow-up to commit 548789f "Replace `this->m_Interpolator` with `Superclass::m_Interpolator`"
  • Loading branch information
N-Dekker committed Mar 21, 2024
1 parent 63d4e64 commit 23aad88
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions Common/CostFunctions/itkAdvancedImageToImageMetric.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ AdvancedImageToImageMetric<TFixedImage, TMovingImage>::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());
}
Expand Down Expand Up @@ -349,13 +349,13 @@ AdvancedImageToImageMetric<TFixedImage, TMovingImage>::CheckForBSplineInterpolat

elastix::DefaultConstruct<CentralDifferenceGradientFilterType> 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;
}
}

Expand All @@ -371,7 +371,7 @@ void
AdvancedImageToImageMetric<TFixedImage, TMovingImage>::CheckForAdvancedTransform()
{
/** Check if the transform is of type AdvancedTransform. */
m_AdvancedTransform = dynamic_cast<AdvancedTransformType *>(this->m_Transform.GetPointer());
m_AdvancedTransform = dynamic_cast<AdvancedTransformType *>(Superclass::m_Transform.GetPointer());
if (!m_AdvancedTransform)
{
itkDebugMacro("Transform is not Advanced");
Expand Down Expand Up @@ -485,7 +485,7 @@ AdvancedImageToImageMetric<TFixedImage, TMovingImage>::EvaluateMovingImageValueA
{
index[j] = static_cast<long>(Math::Round<int64_t>(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. */
Expand Down Expand Up @@ -692,11 +692,11 @@ void
AdvancedImageToImageMetric<TFixedImage, TMovingImage>::LaunchGetValueThreaderCallback() const
{
/** Setup threader. */
this->m_Threader->SetSingleMethod(this->GetValueThreaderCallback,
const_cast<void *>(static_cast<const void *>(&m_ThreaderMetricParameters)));
Superclass::m_Threader->SetSingleMethod(this->GetValueThreaderCallback,
const_cast<void *>(static_cast<const void *>(&m_ThreaderMetricParameters)));

/** Launch. */
this->m_Threader->SingleMethodExecute();
Superclass::m_Threader->SingleMethodExecute();

} // end LaunchGetValueThreaderCallback()

Expand Down Expand Up @@ -735,11 +735,11 @@ void
AdvancedImageToImageMetric<TFixedImage, TMovingImage>::LaunchGetValueAndDerivativeThreaderCallback() const
{
/** Setup threader. */
this->m_Threader->SetSingleMethod(this->GetValueAndDerivativeThreaderCallback,
const_cast<void *>(static_cast<const void *>(&m_ThreaderMetricParameters)));
Superclass::m_Threader->SetSingleMethod(this->GetValueAndDerivativeThreaderCallback,
const_cast<void *>(static_cast<const void *>(&m_ThreaderMetricParameters)));

/** Launch. */
this->m_Threader->SingleMethodExecute();
Superclass::m_Threader->SingleMethodExecute();

} // end LaunchGetValueAndDerivativeThreaderCallback()

Expand Down Expand Up @@ -800,7 +800,7 @@ void
AdvancedImageToImageMetric<TFixedImage, TMovingImage>::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');
Expand Down

0 comments on commit 23aad88

Please sign in to comment.