Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
mitkMultiModalTransDefaultRegistrationAlgorithm.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkMultiModalTransDefaultRegistrationAlgorithm_h
14 #define mitkMultiModalTransDefaultRegistrationAlgorithm_h
15 
16 #include "mapDiscreteElements.h"
17 #include "mapITKTransMattesMIMultiResRegistrationAlgorithm.h"
18 #include "mapConfigure.h"
19 
21 
22 namespace mitk
23 {
28  template<class TImageType>
30  public map::algorithm::boxed::ITKTransMattesMIMultiResRegistrationAlgorithm<TImageType, TImageType, ::map::algorithm::mitkMultiModalTransDefaultRegistrationAlgorithmUIDPolicy, SealedFixedInterpolatorPolicyMacro< ::itk::LinearInterpolateImageFunction<TImageType, map::core::continuous::ScalarType> >, map::algorithm::itk::NoComponentInitializationPolicy>
31  {
32  public:
34 
35  typedef map::algorithm::boxed::ITKTransMattesMIMultiResRegistrationAlgorithm<TImageType, TImageType, ::map::algorithm::mitkMultiModalTransDefaultRegistrationAlgorithmUIDPolicy, SealedFixedInterpolatorPolicyMacro< ::itk::LinearInterpolateImageFunction<TImageType, map::core::continuous::ScalarType> >, map::algorithm::itk::NoComponentInitializationPolicy>
37 
38  typedef ::itk::SmartPointer<Self> Pointer;
39  typedef ::itk::SmartPointer<const Self> ConstPointer;
40 
42  ITKEuler3DMattesMIMultiResRegistrationAlgorithm);
44 
45  protected:
47  {
48  };
49 
51  {
52  };
53 
54  void configureAlgorithm() override
55  {
56  Superclass::configureAlgorithm();
57 
58  this->setResolutionLevels(3);
59  this->_preInitialize = true;
60  this->_useCenterOfGravity = false;
61 
62  //optimizer
63  typename Superclass::ConcreteOptimizerType::ScalesType scales(3);
64  scales[0] = 1.0;
65  scales[1] = 1.0;
66  scales[2] = 1.0;
67 
68  this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetScales(scales);
69  this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetMaximumStepLength(3.00);
70  this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetMinimumStepLength(0.5);
71  this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetNumberOfIterations(200);
72  this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetRelaxationFactor(0.8);
73  this->getConcreteOptimizerControl()->getConcreteOptimizer()->SetGradientMagnitudeTolerance(1e-4);
74 
75  //metric
76  this->getConcreteMetricControl()->getConcreteMetric()->SetNumberOfHistogramBins(30);
77  this->getConcreteMetricControl()->getConcreteMetric()->SetUseAllPixels(true);
78  this->getConcreteMetricControl()->getConcreteMetric()->ReinitializeSeed();
79  this->getConcreteMetricControl()->getConcreteMetric()->UseExplicitPDFDerivativesOn();
80  }
81 
82  void
83  doInterLevelSetup() override
84  {
85  Superclass::doInterLevelSetup();
86 
87  if (this->getCurrentLevel() != 0)
88  {
89  this->getConcreteMetricControl()->getConcreteMetric()->SetUseAllPixels(false);
90 
91  unsigned int nrOfSmpl = ::itk::Math::Round<unsigned int, double>
92  (this->getMovingImage()->GetLargestPossibleRegion().GetNumberOfPixels() * 0.15);
93 
94  this->getConcreteMetricControl()->getConcreteMetric()->SetNumberOfSpatialSamples(nrOfSmpl);
95  }
96  };
97 
98  private:
99 
100  MultiModalTranslationDefaultRegistrationAlgorithm(const Self& source); //purposely not implemented
101  void operator=(const Self&); //purposely not implemented
102  };
103 
104 }
105 
106 #endif
mitkMultiModalTransDefaultRegistrationAlgorithm_ProfileResource.h
mitk::MultiModalTranslationDefaultRegistrationAlgorithm::Superclass
map::algorithm::boxed::ITKTransMattesMIMultiResRegistrationAlgorithm< TImageType, TImageType, ::map::algorithm::mitkMultiModalTransDefaultRegistrationAlgorithmUIDPolicy, SealedFixedInterpolatorPolicyMacro< ::itk::LinearInterpolateImageFunction< TImageType, map::core::continuous::ScalarType > >, map::algorithm::itk::NoComponentInitializationPolicy > Superclass
Definition: mitkMultiModalTransDefaultRegistrationAlgorithm.h:36
mitk::MultiModalTranslationDefaultRegistrationAlgorithm::Pointer
::itk::SmartPointer< Self > Pointer
Definition: mitkMultiModalTransDefaultRegistrationAlgorithm.h:38
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::MultiModalTranslationDefaultRegistrationAlgorithm
Definition: mitkMultiModalTransDefaultRegistrationAlgorithm.h:29
mitk::MultiModalTranslationDefaultRegistrationAlgorithm::mapNewAlgorithmMacro
mapNewAlgorithmMacro(Self)
mitk::MultiModalTranslationDefaultRegistrationAlgorithm::~MultiModalTranslationDefaultRegistrationAlgorithm
~MultiModalTranslationDefaultRegistrationAlgorithm() override
Definition: mitkMultiModalTransDefaultRegistrationAlgorithm.h:50
mitk::MultiModalTranslationDefaultRegistrationAlgorithm::configureAlgorithm
void configureAlgorithm() override
Definition: mitkMultiModalTransDefaultRegistrationAlgorithm.h:54
mitk::MultiModalTranslationDefaultRegistrationAlgorithm::Self
MultiModalTranslationDefaultRegistrationAlgorithm Self
Definition: mitkMultiModalTransDefaultRegistrationAlgorithm.h:33
mitk::MultiModalTranslationDefaultRegistrationAlgorithm::doInterLevelSetup
void doInterLevelSetup() override
Definition: mitkMultiModalTransDefaultRegistrationAlgorithm.h:83
mitk::MultiModalTranslationDefaultRegistrationAlgorithm::MultiModalTranslationDefaultRegistrationAlgorithm
MultiModalTranslationDefaultRegistrationAlgorithm()
Definition: mitkMultiModalTransDefaultRegistrationAlgorithm.h:46
mitk::MultiModalTranslationDefaultRegistrationAlgorithm::ConstPointer
::itk::SmartPointer< const Self > ConstPointer
Definition: mitkMultiModalTransDefaultRegistrationAlgorithm.h:39