13 #ifndef mitkMultiModalAffineDefaultRegistrationAlgorithm_h
14 #define mitkMultiModalAffineDefaultRegistrationAlgorithm_h
16 #include "mapDiscreteElements.h"
17 #include "mapITKAffineMattesMIMultiResRegistrationAlgorithmTemplate.h"
18 #include "mapConfigure.h"
29 template <
class TImageType>
31 public map::algorithm::boxed::ITKAffineMattesMIMultiResRegistrationAlgorithm<TImageType, TImageType, ::map::algorithm::mitkMultiModalAffineDefaultRegistrationAlgorithmUIDPolicy, SealedFixedInterpolatorPolicyMacro< ::itk::LinearInterpolateImageFunction<TImageType, map::core::continuous::ScalarType> >, map::algorithm::itk::NoComponentInitializationPolicy>
36 typedef map::algorithm::boxed::ITKAffineMattesMIMultiResRegistrationAlgorithm<TImageType, TImageType, ::map::algorithm::mitkMultiModalAffineDefaultRegistrationAlgorithmUIDPolicy, SealedFixedInterpolatorPolicyMacro< ::itk::LinearInterpolateImageFunction<TImageType, map::core::continuous::ScalarType> >, map::algorithm::itk::NoComponentInitializationPolicy>
39 typedef ::itk::SmartPointer<Self>
Pointer;
43 ITKAffineMattesMIMultiResRegistrationAlgorithm);
57 Superclass::configureAlgorithm();
59 this->setResolutionLevels(3);
60 this->_preInitialize =
true;
61 this->_useCenterOfGravity =
false;
63 this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetMaximumStepLength(3.00);
64 this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetMinimumStepLength(0.5);
65 this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetNumberOfIterations(200);
66 this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetRelaxationFactor(0.8);
67 this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetGradientMagnitudeTolerance(1e-4);
70 this->getConcreteMetricControl()->getConcreteMetric()->SetNumberOfHistogramBins(30);
71 this->getConcreteMetricControl()->getConcreteMetric()->SetUseAllPixels(
true);
72 this->getConcreteMetricControl()->getConcreteMetric()->ReinitializeSeed();
73 this->getConcreteMetricControl()->getConcreteMetric()->UseExplicitPDFDerivativesOn();
79 Superclass::doInterLevelSetup();
82 int dimCount = TImageType::ImageDimension*TImageType::ImageDimension + TImageType::ImageDimension;
83 int matrixEnd = TImageType::ImageDimension*TImageType::ImageDimension;
84 typename Superclass::ConcreteOptimizerType::ScalesType scales(dimCount);
85 double matrixScale = 1.0;
86 double transScale = 1.0;
88 if (this->getCurrentLevel() == 0)
91 transScale = 1.0 / 10000;
96 transScale = 1.0 / 1000;
99 for (
int i = 0; i < dimCount; ++i)
103 scales[i] = matrixScale;
108 scales[i] = transScale;
112 this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetScales(scales);
115 if (this->getCurrentLevel() != 0)
117 this->getConcreteMetricControl()->getConcreteMetric()->SetUseAllPixels(
false);
119 unsigned int nrOfSmpl = ::itk::Math::Round<unsigned int, double>
120 (this->getMovingImage()->GetLargestPossibleRegion().GetNumberOfPixels() * 0.30);
122 this->getConcreteMetricControl()->getConcreteMetric()->SetNumberOfSpatialSamples(nrOfSmpl);
129 void operator=(
const Self&);