17 #include "mapDeploymentDLLHelper.h"
18 #include "mapDiscreteElements.h"
19 #include "mapITKAffineMattesMIMultiResRegistrationAlgorithmTemplate.h"
20 #include "mapConfigure.h"
26 typedef map::core::discrete::Elements<3>::InternalImageType
ImageType;
32 class MultiModalAffineDefaultRegistrationAlgorithm :
33 public map::algorithm::boxed::ITKAffineMattesMIMultiResRegistrationAlgorithm<ImageType, ImageType, ::map::algorithm::MITK_MultiModal_affine_defaultUIDPolicy, SealedFixedInterpolatorPolicyMacro< ::itk::LinearInterpolateImageFunction<ImageType, map::core::continuous::ScalarType> >, map::algorithm::itk::NoComponentInitializationPolicy>
36 typedef MultiModalAffineDefaultRegistrationAlgorithm Self;
38 typedef ITKAffineMattesMIMultiResRegistrationAlgorithm<ImageType, ImageType, ::map::algorithm::MITK_MultiModal_affine_defaultUIDPolicy, SealedFixedInterpolatorPolicyMacro< ::itk::LinearInterpolateImageFunction<ImageType, map::core::continuous::ScalarType> >, map::algorithm::itk::NoComponentInitializationPolicy>
41 typedef ::itk::SmartPointer<Self>
Pointer;
44 itkTypeMacro(MultiModalAffineDefaultRegistrationAlgorithm,
45 ITKAffineMattesMIMultiResRegistrationAlgorithm);
46 mapNewAlgorithmMacro(Self);
49 MultiModalAffineDefaultRegistrationAlgorithm()
53 virtual ~MultiModalAffineDefaultRegistrationAlgorithm()
57 void configureAlgorithm()
59 Superclass::configureAlgorithm();
61 this->setResolutionLevels(3);
62 this->_preInitialize =
true;
63 this->_useCenterOfGravity =
false;
65 this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetMaximumStepLength(3.00);
66 this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetMinimumStepLength(0.5);
67 this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetNumberOfIterations(200);
68 this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetRelaxationFactor(0.8);
69 this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetGradientMagnitudeTolerance(1e-4);
72 this->getConcreteMetricControl()->getConcreteMetric()->SetNumberOfHistogramBins(30);
73 this->getConcreteMetricControl()->getConcreteMetric()->SetUseAllPixels(
true);
74 this->getConcreteMetricControl()->getConcreteMetric()->ReinitializeSeed();
75 this->getConcreteMetricControl()->getConcreteMetric()->UseExplicitPDFDerivativesOn();
81 Superclass::doInterLevelSetup();
84 int dimCount = ImageType::ImageDimension*ImageType::ImageDimension + ImageType::ImageDimension;
85 int matrixEnd = ImageType::ImageDimension*ImageType::ImageDimension;
86 Superclass::ConcreteOptimizerType::ScalesType scales(dimCount);
87 double matrixScale = 1.0;
88 double transScale = 1.0;
90 if (this->getCurrentLevel() == 0)
93 transScale = 1.0 / 10000;
98 transScale = 1.0 / 1000;
101 for (
int i = 0; i < dimCount; ++i)
105 scales[i] = matrixScale;
110 scales[i] = transScale;
114 getConcreteOptimizerControl()->getConcreteOptimizer()->SetScales(scales);
117 if (this->getCurrentLevel() != 0)
119 getConcreteMetricControl()->getConcreteMetric()->SetUseAllPixels(
false);
121 unsigned int nrOfSmpl = ::itk::Math::Round<unsigned int, double>
122 (this->getMovingImage()->GetLargestPossibleRegion().GetNumberOfPixels() * 0.30);
124 getConcreteMetricControl()->getConcreteMetric()->SetNumberOfSpatialSamples(nrOfSmpl);
130 MultiModalAffineDefaultRegistrationAlgorithm(
const Self& source);
131 void operator=(
const Self&);
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
itkEventMacroDeclaration(FocusChangedEvent, itk::AnyEvent) class MITKCORE_EXPORT TestingRenderingManager typedef RenderingManager Superclass
itk::SmartPointer< const Self > ConstPointer
mapDeployAlgorithmMacro(mitk::MultiModalAffineDefaultRegistrationAlgorithm)
map::core::discrete::Elements< 3 >::InternalImageType ImageType