Skip to content

Commit 165fb5b

Browse files
committed
ENH: Increase RegistrationParameterScalesFromPhysicalShift coverage
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.
1 parent 9fce6c0 commit 165fb5b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationOnVectorTest.cxx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ itkAutoScaledGradientDescentRegistrationOnVectorTestTemplated(int number
126126
std::cout << "Testing RegistrationParameterScalesFromPhysicalShift" << std::endl;
127127
auto shiftScalesEstimator = ShiftScalesEstimatorType::New();
128128

129+
ITK_EXERCISE_BASIC_OBJECT_METHODS(
130+
shiftScalesEstimator, RegistrationParameterScalesFromPhysicalShift, RegistrationParameterScalesFromShiftBase)
131+
132+
129133
shiftScalesEstimator->SetMetric(metric);
130134
ITK_TEST_SET_GET_VALUE(metric, shiftScalesEstimator->GetMetric());
131135

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

143+
typename ShiftScalesEstimatorType::VirtualPointSetType::ConstPointer virtualDomainPointSet{};
144+
shiftScalesEstimator->SetVirtualDomainPointSet(virtualDomainPointSet);
145+
ITK_TEST_SET_GET_VALUE(virtualDomainPointSet, shiftScalesEstimator->GetVirtualDomainPointSet());
146+
147+
typename ShiftScalesEstimatorType::ParametersValueType smallParameterVariation = 0.01;
148+
shiftScalesEstimator->SetSmallParameterVariation(smallParameterVariation);
149+
ITK_TEST_SET_GET_VALUE(smallParameterVariation, shiftScalesEstimator->GetSmallParameterVariation());
150+
139151
scalesEstimator = shiftScalesEstimator;
140152
}
141153
else

0 commit comments

Comments
 (0)