Skip to content

Commit

Permalink
ENH: Increase RegistrationParameterScalesFromPhysicalShift coverage
Browse files Browse the repository at this point in the history
Increase coverage for
`itk::RegistrationParameterScalesFromPhysicalShift`:
- Exercise basic object methods using the
  `ITK_EXERCISE_BASIC_OBJECT_METHODS` macro. Remove redundant calls to
  print the filter: rely on the basic method exercising macro call.
- Test the Set/Get methods using the `ITK_TEST_SET_GET_VALUE` macro.
  • Loading branch information
jhlegarreta committed Jun 19, 2023
1 parent 9fce6c0 commit 165fb5b
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -126,6 +126,10 @@ itkAutoScaledGradientDescentRegistrationOnVectorTestTemplated(int number
std::cout << "Testing RegistrationParameterScalesFromPhysicalShift" << std::endl;
auto shiftScalesEstimator = ShiftScalesEstimatorType::New();

ITK_EXERCISE_BASIC_OBJECT_METHODS(
shiftScalesEstimator, RegistrationParameterScalesFromPhysicalShift, RegistrationParameterScalesFromShiftBase)


shiftScalesEstimator->SetMetric(metric);
ITK_TEST_SET_GET_VALUE(metric, shiftScalesEstimator->GetMetric());

Expand All @@ -136,6 +140,14 @@ itkAutoScaledGradientDescentRegistrationOnVectorTestTemplated(int number
shiftScalesEstimator->SetCentralRegionRadius(centralRegionRadius);
ITK_TEST_SET_GET_VALUE(centralRegionRadius, shiftScalesEstimator->GetCentralRegionRadius());

typename ShiftScalesEstimatorType::VirtualPointSetType::ConstPointer virtualDomainPointSet{};
shiftScalesEstimator->SetVirtualDomainPointSet(virtualDomainPointSet);
ITK_TEST_SET_GET_VALUE(virtualDomainPointSet, shiftScalesEstimator->GetVirtualDomainPointSet());

typename ShiftScalesEstimatorType::ParametersValueType smallParameterVariation = 0.01;
shiftScalesEstimator->SetSmallParameterVariation(smallParameterVariation);
ITK_TEST_SET_GET_VALUE(smallParameterVariation, shiftScalesEstimator->GetSmallParameterVariation());

scalesEstimator = shiftScalesEstimator;
}
else
Expand Down

0 comments on commit 165fb5b

Please sign in to comment.