Skip to content

Commit

Permalink
Merge pull request #4076 from jhlegarreta/AddRegistrationParameterSca…
Browse files Browse the repository at this point in the history
…lesEstimatorIvarMacros

ENH: Add macros to `itk::RegistrationParameterScalesEstimator` ivars
  • Loading branch information
jhlegarreta committed Jun 19, 2023
2 parents 64796ac + 37a2151 commit 9fce6c0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Expand Up @@ -150,13 +150,15 @@ class ITK_TEMPLATE_EXPORT RegistrationParameterScalesEstimator
* with the images when appropriate.
*/
itkSetObjectMacro(Metric, MetricType);
itkGetConstObjectMacro(Metric, MetricType);

/** m_TransformForward specifies which transform scales to be estimated.
* m_TransformForward = true (default) for the moving transform parameters.
* m_TransformForward = false for the fixed transform parameters.
*/
itkSetMacro(TransformForward, bool);
itkGetConstMacro(TransformForward, bool);
itkBooleanMacro(TransformForward);

/** Get/Set a point set for virtual domain sampling. */
itkSetObjectMacro(VirtualDomainPointSet, VirtualPointSetType);
Expand All @@ -165,6 +167,7 @@ class ITK_TEMPLATE_EXPORT RegistrationParameterScalesEstimator

/** the radius of the central region for sampling. */
itkSetMacro(CentralRegionRadius, IndexValueType);
itkGetConstMacro(CentralRegionRadius, IndexValueType);

/** Estimate parameter scales */
void
Expand Down
Expand Up @@ -16,6 +16,7 @@
*
*=========================================================================*/
#include "itkGradientDescentOptimizerv4.h"
#include "itkIntTypes.h"
#include "itkMeanSquaresImageToImageMetricv4.h"
#include "itkRegistrationParameterScalesFromPhysicalShift.h"
#include "itkRegistrationParameterScalesFromJacobian.h"
Expand Down Expand Up @@ -124,8 +125,17 @@ itkAutoScaledGradientDescentRegistrationOnVectorTestTemplated(int number
{
std::cout << "Testing RegistrationParameterScalesFromPhysicalShift" << std::endl;
auto shiftScalesEstimator = ShiftScalesEstimatorType::New();

shiftScalesEstimator->SetMetric(metric);
shiftScalesEstimator->SetTransformForward(true); // default
ITK_TEST_SET_GET_VALUE(metric, shiftScalesEstimator->GetMetric());

auto transformForward = true;
ITK_TEST_SET_GET_BOOLEAN(shiftScalesEstimator, TransformForward, transformForward);

itk::IndexValueType centralRegionRadius = 5;
shiftScalesEstimator->SetCentralRegionRadius(centralRegionRadius);
ITK_TEST_SET_GET_VALUE(centralRegionRadius, shiftScalesEstimator->GetCentralRegionRadius());

scalesEstimator = shiftScalesEstimator;
}
else
Expand Down

0 comments on commit 9fce6c0

Please sign in to comment.